public ActionResult SaveStudentResult(StudentResultSave studentResultSave) { var studentList = _studentRegisterManager.GetAllStudents(); ViewBag.Students = new SelectList(studentList, "StudentId", "RegNumber"); var gradeList = _studentResultManager.GetGradeList(); ViewBag.Grades = new SelectList(gradeList, "GradeId", "GradeName"); var courses = _studentEnrollManager.GetEnrolledCoursesByStudentId(studentResultSave.StudentRegisterId); ViewBag.Courses = new SelectList(courses, "CourseId", "CourseName"); int rowAffected = _studentResultManager.SaveStudentResult(studentResultSave); if (ModelState.IsValid) { if (rowAffected > 0) { studentResultSave.GradeId = 0; studentResultSave.EnrollCourseId = 0; ViewBag.ValidationMsg = "Successfull."; ModelState.Clear(); return(View(studentResultSave)); } } if (rowAffected == -1) { ViewBag.ValidationMsg = "Please select course."; return(View(studentResultSave)); } ViewBag.ValidationMsg = "Saving failed.Try again."; return(View(studentResultSave)); }
public ActionResult SaveResult(Enroll enroll) { ViewBag.StudentRegNo = AStudentResultManager.GetStudentRegNoForDropdown(); ViewBag.allGradelist = AStudentResultManager.GetAllGradeForDropdown(); ViewBag.Message = AStudentResultManager.SaveStudentResult(enroll); return(View()); }
public ActionResult StudentResult(StudentResults studentResults) { try { string Alart = _studentResultManager.SaveStudentResult(studentResults); ViewBag.Message = Alart; GetAllRessult(); return(View()); } catch (Exception ex) { throw new Exception(ex.Message); } }
public ActionResult Save(StudentResult studentResult) { try { ViewBag.Students = studentManager.GetStudents(); ViewBag.message = studentResultManager.SaveStudentResult(studentResult); return(View()); } catch { return(View()); } }
public ActionResult SaveResult(StudentResult aStudentResult) { List <SelectListItem> getSelectRegNo = aStudentManager.GetSelectRegNo(); ViewBag.GetSelectRegNo = getSelectRegNo; List <SelectListItem> getSelectGrade = aCourseEnrollManager.GetSelectGrade(); ViewBag.GetSelectGrade = getSelectGrade; ViewBag.Message = aStudentResultManager.SaveStudentResult(aStudentResult); ModelState.Clear(); return(View()); }
public ActionResult SaveResult(StudentResult aStudentResult) { StudentManager aStudentManager = new StudentManager(); GradeManager aGradeManager = new GradeManager(); StudentResultManager aStudentResultManager = new StudentResultManager(); ViewBag.students = aStudentManager.GetAllStudents(); ViewBag.gredes = aGradeManager.GetAllGrades(); var studentlist = aStudentResultManager.GetAllStudentResultsByRegNo(aStudentResult.RegistrationNo); var studentcourse = studentlist.FirstOrDefault(s => s.CourseId == aStudentResult.CourseId); if (aStudentResult.CourseId == 0) { ViewBag.message = "Select Course"; } else { if (studentcourse != null) { ViewBag.message = "This Course Grade Already Exist"; } else { if (aStudentResultManager.SaveStudentResult(aStudentResult) > 0) { ViewBag.message = "Result Saved Successfully"; } else { ViewBag.message = "Save Failed"; } } } return(View()); }
public ActionResult SaveResult(CourseAssignToStudent courseAssignToStudent) { ViewBag.Message = studentResultManager.SaveStudentResult(courseAssignToStudent); ViewBag.StudentRegNumList = studentManager.GetStudentRegNumList(); return(View()); }