public IActionResult AssignMark(ExamMark examMark) { try { int Logged = Convert.ToInt32(HttpContext.Session.GetInt32("Logged")); int User = Convert.ToInt32(HttpContext.Session.GetInt32("User")); if (Logged == 1 && User == 2) { examMark.Calculate(); teacherDA.UpdateMark(examMark); string success = "Marks entered successfully"; return(RedirectToAction("StudentList", new { message = success })); } else { return(RedirectToAction("Login", "Home")); } } catch (Exception ex) { string exMessage = "oops! There is a problem in assigning marks."; return(RedirectToAction("Index", "ExeptionHandler", new { Exeption = exMessage })); } }