public ActionResult Addmission(RegistrationViewModel model) { try { model.SessionList = addmissionService.GetSessionList(); model.CourseList = addmissionService.GetCourseList(); model.CreatedBy = Convert.ToInt32(Session["UserId"]); int AddMissionId = addmissionService.CreateAddmission(model); TempData["Message"] = AddMissionId; TempData["msg"] = "Admission created successfully!"; return(RedirectToAction("Addmission", "Addmission", new { id = model.Id })); } catch (Exception ex) { TempData["msg"] = ex.Message; return(View(model)); } }