using System;
using System.Collections.Generic;
using System.Text;
using System.ComponentModel;

namespace Sched.CustomClasses
{
    public class StudentGroup : INotifyPropertyChanged
    {
        private int _id = 0;
        private int _curriculumId = 0;
        private int _semesterId = 0;
        private string _name = string.Empty;
        private int _capacity = 20;
        private int _yearOfStudy = 1;

        public int Id
        {
            get { return _id; }
            set { _id = value; OnPropertyChanged("Id"); }
        }
        public int CurriculumId
        {
            get { return _curriculumId; }
            set { _curriculumId = value; OnPropertyChanged("CurriculumId"); }
        }
        public int SemesterId
        {
            get { return _semesterId; }
            set { _semesterId = value; OnPropertyChanged("SemesterId"); }
        }
        public string Name
        {
            get { return _name; }
            set { _name = value; OnPropertyChanged("Name"); }
        }
        public int Capacity
        {
            get { return _capacity; }
            set { _capacity = value; OnPropertyChanged("Capacity"); }
        }
        public int YearOfStudy
        {
            get { return _yearOfStudy; }
            set { _yearOfStudy = value; OnPropertyChanged("YearOfStudy"); }
        }

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

        public StudentGroup()
        {
        }
        public StudentGroup(int Id, int CurriculumId, int SemesterId, string Name)
        {
            this.Id = Id;
            this.CurriculumId = CurriculumId;
            this.SemesterId = SemesterId;
            this.Name = Name;
        }

        public override string ToString()
        {
            return $"{_name} ({Id})";
        }
    }
}
