コード例 #1
0
        public ActionResult SaveCourseAssign(CourseAssign courseassign)
        {
            if (ModelState.IsValid)
            {
                if (GetAssignCourse(courseassign.CourseID) == null)
                {
                    bool IsCourseAssign = cAssignManager.Save(courseassign);
                    if (IsCourseAssign)
                    {
                        ViewBag.Message = "Course assigned successfully";
                    }
                    else
                    {
                        ViewBag.errMessage = "Course assigned failed";
                    }
                }
                else
                {
                    ViewBag.errMessage = "Course is already assigned";
                }
                ModelState.Clear();
            }

            List <Department> departments = departmentManager.GetAllDepartment();

            ViewBag.departments = new SelectList(departments, "depCode", "depName");
            return(View());
        }
コード例 #2
0
 public ActionResult CourseAssign(CourseAssign courseAssign)
 {
     if (ModelState.IsValid)
     {
         string message = courseAssignManager.Save(courseAssign);
         ViewBag.Departments = departmentManager.GetSelectListItemsForDropdown();
         ViewBag.Message     = message;
         ModelState.Clear();
         return(View());
     }
     else
     {
         ViewBag.Message = "Model is not valid";
         return(View());
     }
 }
コード例 #3
0
 public ActionResult AssignCourseToTeacher(CourseAssign courseAssign)
 {
     ViewBag.Departments = departmentManager.GetCategoryForDropDown();
     if (ModelState.IsValid)
     {
         courseAssign.Action     = Actions.ActionInsert;
         courseAssign.ActionDate = DateTime.Now.ToString("F");
         courseAssign.ActionBy   = "Me";
         courseAssign.IsDelete   = 0;
         ViewData["Message"]     = courseAssignManager.Save(courseAssign);
         ModelState.Clear();
         return(View());
     }
     else
     {
         ViewData["Message"] = Message.Warning("Fill up all fields correctly");
         return(View(courseAssign));
     }
 }
コード例 #4
0
 public ActionResult Save(CourseAssign courseAssign)
 {
     ViewBag.DepartmentList = GetAllDepartmentForDropdown();
     if (ModelState.IsValid)
     {
         string message = CourseAssignManager.Save(courseAssign);
         ViewBag.Message = message;
         if (message == "Course Is Successfully Assigned")
         {
             ModelState.Clear();
             return(View());
         }
         else
         {
             return(View(courseAssign));
         }
     }
     else
     {
         ViewBag.Message = "Please Fill All Field With Correct Format";
         return(View(courseAssign));
     }
 }
コード例 #5
0
 public ActionResult CourseAssignToTeacher(CourseAssign aCourseAssign)
 {
     ViewBag.Message     = aCourseAssignManager.Save(aCourseAssign);
     ViewBag.Departments = aCourseAssignManager.GetAllDepartments();
     return(View());
 }
コード例 #6
0
 public ActionResult Assign(AssignModel assign, int departmentId)
 {
     ViewBag.message     = manager.Save(assign);
     ViewBag.departments = departmentManager.GetAllDepartment();
     return(View());
 }