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

namespace Sched.CustomClasses
{
    public class Room : INotifyPropertyChanged
    {
        private int _id;
        private string _name;
        private int _buildingId;
        private int _roomTypeId;
        private int _capacity;
        private string _description;

        public int Id
        {
            get { return _id; }
            set { _id = value; OnPropertyChanged("Id"); }
        }
        public string Name
        {
            get { return _name; }
            set { _name = value; OnPropertyChanged("Name"); }
        }
        public int BuildingId
        {
            get { return _buildingId; }
            set { _buildingId = value; OnPropertyChanged("BuildingId"); }
        }
        public int RoomTypeId
        {
            get { return _roomTypeId; }
            set { _roomTypeId = value; OnPropertyChanged("RoomTypeId"); }
        }
        public int Capacity
        {
            get { return _capacity; }
            set { _capacity = value; OnPropertyChanged("Capacity"); }
        }
        public string Description
        {
            get { return _description; }
            set { _description = value; OnPropertyChanged("Description"); }
        }

        public event PropertyChangedEventHandler PropertyChanged;
        private void OnPropertyChanged(string info)
        {
            var handler = PropertyChanged;
            handler?.Invoke(this, new PropertyChangedEventArgs(info));
        }
                      
        public Room()
        {
            this.Id = 0;
            this.Name = string.Empty;
            this.BuildingId = 0;
            this.RoomTypeId = 0;
            this.Capacity = 0;
            this.Description = string.Empty;
        }
        public Room(int Id, string Name, int BuildingId, int RoomTypeId, int Capacity, string Description)
        {
            this.Id = Id;
            this.Name = Name;
            this.BuildingId = BuildingId;
            this.RoomTypeId = RoomTypeId;
            this.Capacity = Capacity;
            this.Description = Description;            
        }

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

    public class RoomType: INotifyPropertyChanged
    {
        private int _id;
        private string _name;
        private string _description;
        public int Id{
            get { return _id; }
            set { _id = value; OnPropertyChanged("Id"); }
        }
        public string Name
        {
            get { return _name; }
            set { _name = value; OnPropertyChanged("Name"); }
        }
        public string Description
        {
            get { return _description; }
            set { _description = value; OnPropertyChanged("Description"); }
        }
  
        public event PropertyChangedEventHandler PropertyChanged;
        private void OnPropertyChanged(string info)
        {
            var handler = PropertyChanged;
            handler?.Invoke(this, new PropertyChangedEventArgs(info));
        }
        
        public RoomType()
        {
            this.Id = 0;
            this.Name = "RoomName";
            this.Description = string.Empty;
        }
        public RoomType(int Id, string Name, string Description)
        {
            this.Id = Id;
            this.Name = Name;
            this.Description = Description;
        }

        public override string ToString()
        {
            return $"{_id} - " + _name;
        }
    }

    public class Building: INotifyPropertyChanged
    {
        private int _id = 0;
        private string _name = string.Empty;
        private string _faculty = string.Empty;
        private string _address = string.Empty;

        public int Id
        {
            get { return _id; }
            set { _id = value; OnPropertyChanged("Id"); }
        }
        public string Name
        {
            get { return _name; }
            set { _name = value; OnPropertyChanged("Name"); }
        }
        public string Faculty
        {
            get { return _faculty; }
            set { _faculty = value; OnPropertyChanged("Faculty"); }
        }
        public string Address
        {
            get { return _address; }
            set { _address = value; OnPropertyChanged("Address"); }
        }

        public Building()
        {
        }
        public Building(int Id, string Name, string Faculty, string Address)
        {
            this.Id = Id;
            this.Name = Name;
            this.Faculty = Faculty;
            this.Address = Address;
        }

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

        public override string ToString()
        {
            return $"{_id} - ({_faculty}) {_name} {_address}";
        }
    }
}
