public ActionResult Add([ModelBinder(typeof(DevExpressEditorsBinder))] AlertGroupModel alertGroupModel) { alertGroupModel._UserId = (int)Session["userId"]; alertGroupService = new AlertGroupService(); if (ModelState.IsValid) { alertGroupService.Add(alertGroupModel); alertGroupModel = alertGroupService.GetNewModel(); } else { string message = GetErrorModel(); throw new Exception(string.Format("[VALIDATION] {0}", message)); } alertGroupModel._FormMode = Models.FormModeEnum.New; return(PartialView(VIEW_FORM_PARTIAL, alertGroupModel)); }
public ActionResult Delete(int Id = 0) { alertGroupService = new AlertGroupService(); if (Id != 0) { alertGroupService = new AlertGroupService(); alertGroupService.DeleteById((int)Session["userId"], Id); } AlertGroupModel alertGroupModel = new AlertGroupModel(); return(PartialView(VIEW_FORM_PARTIAL, alertGroupModel)); }