public ActionResult AssignToTeacher(CourseAssignToTeacher assign)
        {
            Teacher                      aTeacher               = new Teacher();
            DepartmentManager            aDepartmentManager     = new DepartmentManager();
            CourseAssignToTeacherManager assignToTeacherManager = new CourseAssignToTeacherManager();
            TeacherManager               aTeacherManager        = new TeacherManager();

            ViewBag.departments = aDepartmentManager.GetAllDepartmentInfo();
            aTeacherManager.GetAllTeachers();
            if (aTeacher.RemainingCredit < assign.CourseCredit)
            {
            }
            var assinglist            = assignToTeacherManager.GetAllCourseassinAssignToTeachers();
            var assingcoursttoteacher = assinglist.FirstOrDefault(t => t.CourseId == assign.CourseId);
            var assigntrue            = assignToTeacherManager.GetAllCourseassinAssignToTeachersTrue();
            var assigntruefind        = assigntrue.FirstOrDefault(c => c.CourseId == assign.CourseId);
            var assignfalse           = assignToTeacherManager.GetAllCourseassinAssignToTeachersFalse();
            var assigntfalsefind      = assignfalse.FirstOrDefault(c => c.CourseId == assign.CourseId);

            if (assign.CourseCredit == 0.0)
            {
                ViewBag.message = "Input Values";
            }
            else
            {
                if (assigntruefind != null)
                {
                    ViewBag.message = "Course Already Assigned";
                }
                else if (assigntfalsefind != null)
                {
                    if (assignToTeacherManager.UpdateAssignCourse(assign) > 0)
                    {
                        ViewBag.message = "Assign Successfull";
                    }
                    else
                    {
                        ViewBag.message = "Assign Failed";
                    }
                }
                else
                {
                    if (assignToTeacherManager.AssignCourseToTeacher(assign) > 0)
                    {
                        assignToTeacherManager.UpdateRemainingCredit(assign.CourseCredit, assign.TeacherId);

                        ViewBag.message = "Assign Successfull";
                    }
                    else
                    {
                        ViewBag.message = "Failed to Assign";
                    }
                }
            }
            return(View());
        }