using System;
using System.Collections.Generic;
using System.Text;
using System.ComponentModel;
using System.Collections.ObjectModel;
using System.Data;
using System.Diagnostics;

namespace Sched.CustomClasses
{
    public class AssignmentData : INotifyPropertyChanged
    {
        //Assignment
        private int _semesterId;
        private string _categoryName;
        private int _categoryId;
        private Lesson _lssn = new Lesson();
        private AutoscheduleData _asd = new AutoscheduleData();

        public int SemesterId
        {
            get { return _semesterId; }
            set
            {
                _semesterId = value;
                Lssn.SemesterId = _semesterId;
                OnPropertyChanged("SemesterId");
            }
        }
        public string CategoryName
        {
            get { return _categoryName; }
            set { _categoryName = value; OnPropertyChanged("CategoryName"); }
        }
        public int CategoryId
        {
            get { return _categoryId; }
            set {  _categoryId = value; OnPropertyChanged("CategoryId"); }
        }      
        public Lesson Lssn
        {
            get { return _lssn; }
            set { _lssn = value;  OnPropertyChanged("Lssn"); }
        }
        public AutoscheduleData Asd
        {
            get { return _asd; }
            set { _asd = value; OnPropertyChanged("Asd"); }
        }

        public event PropertyChangedEventHandler PropertyChanged;
        private void OnPropertyChanged(string info)
        {
            var handler = PropertyChanged;
            handler?.Invoke(this, new PropertyChangedEventArgs(info));
        }

        public AssignmentData()
        {
            _semesterId = -1;
            _categoryId = -1;
        }

        public override string ToString()
        {
            return "Sem:" + _semesterId + " CName:" + _categoryName + " Cid:"+ _categoryId;
        }
    }
}
