//get from database - DataGridView
        public static Unavailability_Curriculum FromDatabase(DataGridView datagridView, int i = -1)
        {
            if (i == -1)
            {
                if (datagridView.CurrentRow != null)
                {
                    i = datagridView.CurrentRow.Index;
                }
            }
            if (i == -1)
            {
                return(null);
            }

            if (datagridView[0, i].CellValue() == null || datagridView[1, i].CellValue() == null ||
                datagridView[2, i].CellValue() == null)
            {
                return(null);
            }

            //new Unavailability_Course
            string courseCode = datagridView[0, i].CellValue();
            string dateString = datagridView[1, i].CellValue();
            int    timeSlot   = int.Parse(datagridView[2, i].CellValue());
            Unavailability_Curriculum unavailabilityCurriculum = Unavailability_Curriculum.FromDatabase(courseCode, dateString, timeSlot);

            return(unavailabilityCurriculum);
        }
 public static Unavailability_Curriculum FromDatabase(Unavailability_Curriculum other)
 {
     return(FromDatabase(other.Curriculum.CurriculumCode, other.DateTime.Date.ToString("d"), other.Timeslot));
 }
 protected bool Equals(Unavailability_Curriculum other)
 {
     return(Equals(Curriculum, other.Curriculum) && DateTime.Equals(other.DateTime) && Timeslot == other.Timeslot);
 }