public async Task <ActionResult> Edit(Classroom classroom)
        {
            if (ModelState.IsValid)
            {
                bool overlap    = false;
                var  cClassroom = await _classroomRepository.GetAsync(classroom.Id);

                if (cClassroom == null)
                {
                    //check if there is overlap
                    overlap = chkOverlap(classroom);
                    if (!overlap)
                    {
                        var nClassroom = new Data.Classroom
                        {
                            ClassroomName = classroom.ClassroomName,
                            StartDate     = classroom.StartDate,
                            StartTime     = classroom.StartTime,
                            EndTime       = classroom.EndTime,
                            CourseId      = classroom.SelectedCourse
                        };
                        await _classroomRepository.InsertAsync(nClassroom);
                    }
                }
                else
                {
                    //check if there is overlap
                    overlap = chkOverlap(classroom);

                    if (!overlap)
                    {
                        cClassroom.ClassroomName = classroom.ClassroomName;
                        cClassroom.StartDate     = classroom.StartDate;
                        cClassroom.StartTime     = classroom.StartTime;
                        cClassroom.EndTime       = classroom.EndTime;
                        cClassroom.CourseId      = classroom.SelectedCourse;
                        await _classroomRepository.UpdateAsync(cClassroom);
                    }
                }


                return(RedirectToAction("Index"));
            }
            else
            {
                return(View());
            }
        }