public ActionResult AddCaseTypes(PostCaeTypeViewModel model) { try { if (ModelState.IsValid) { var list = model.CaseTypes.Select(x => new ealert_user_case_type() { ect_user_key = model.UserKey, ect_case_type_key = x, ect_created_by = User.Identity.GetUserId(), ect_is_active = true, ect_created_date = DateTime.Now.ToEST() }).ToList(); _ealertCaseTypesService.AssginCaseTypes(model.UserKey, list); return(Json(new { success = true })); } return(Json(new { success = false, data = string.Join("<br/>", this.GetModalErrors().Values) })); } catch (Exception ex) { Elmah.ErrorSignal.FromCurrentContext().Raise(ex); return(Json(new { success = false, data = string.Join("<br/>", this.GetModalErrors().Values) })); } }
public ActionResult AddCaseTypes(string userKey, string userFullName) { var assignedCaseTypeList = _ealertCaseTypesService.GetAllAssignedCaseTypes(userKey).Select(x => x.CaseTypeKey); var model = new PostCaeTypeViewModel() { CaseTypes = assignedCaseTypeList.ToList(), UserKey = userKey }; return(PartialView("_AddCaseTypes", model)); }