Exemplo n.º 1
0
        public ActionResult StudentDashboard()
        {
            StudentsExams objExam = new StudentsExams();

            objExam.StudentId = long.Parse("0" + Request.Cookies["UserId"].Value);
            List <StudentsExams> examList = examBL.CRUDAddExams(objExam, "L");

            return(View(examList));
        }
Exemplo n.º 2
0
 public ActionResult AddStudentExam(StudentsExams objExam)
 {
     try
     {
         objExam.LoggedInUser = long.Parse("0" + Request.Cookies["UserId"].Value);
         StudentsExams objUserDetails = objExamBL.CRUDAddExams(objExam, (objExam.StudentExamId > 0 ? "U" : "I")).FirstOrDefault();
         if (objUserDetails.CRUDStatus == "success" || objUserDetails.StudentExamId > 0)
         {
             TempData["SuccessMessage"] = "You have " + (objExam.StudentExamId > 0 ? "updated" : "added") + " one Student Exam successfully";
             return(RedirectToAction("Students", "Student"));
         }
         else
         {
             TempData["ErrorMessage"] = objUserDetails.CRUDStatus;
             return(RedirectToAction("Students", "Student"));
         }
     }
     catch (Exception ex)
     {
         TempData["ErrorMessage"] = ex.Message;
         return(RedirectToAction("Students", "Student"));
     }
 }