public PartialViewResult AdminUserPartial() { Helpers.AdminService service = new Helpers.AdminService(); AdminUserViewModel m = new AdminUserViewModel() { amdata = service.GetAdminGrid() }; return(PartialView("_AccountsPartial", m)); }
public PartialViewResult ALPartial() { AlPartialViewModel m = new AlPartialViewModel(); Helpers.AdminService service = new Helpers.AdminService(); m = new AlPartialViewModel() { aldata = service.GetAlertEmails("INS"), LocSerOptions = service.GetSerLocs(), ErrorMessage = "ERR: " + service.ErrorMessage }; return(PartialView("_AlertsPartial", m)); }
public JsonResult SaveAM(string method, int id, string address, bool status, string nav) { var rObject = new MethodResponse() { Result = true, ErrorMessage = "", Content = new Models.WorkroomsUserObject[] { } }; Helpers.AdminService service = new Helpers.AdminService(); try { if (id == 0 && method != "am_add") { throw new Exception("email id not recieved"); } if (address.Length == 0 && method != "am_delete") { throw new Exception("email address not recieved"); } var amO = new AdminsGridView() { id = id, Address = address, Status = status, }; switch (method) { case "am_add": rObject.Result = service.AddAdmin(amO); break; case "am_edit": rObject.Result = service.EditAdmin(amO); break; case "am_delete": rObject.Result = service.DeleteAdmin(amO.id); break; default: rObject.ErrorMessage = "control handler error"; rObject.Result = false; break; } } catch (Exception ex) { rObject.Result = false; rObject.ErrorMessage = ex.Message; } if (rObject.Result == true) { removeCacheHTML(nav); service.ClearAdminEmailCache(); } else { rObject.ErrorMessage = service.ErrorMessage; } return(Json(rObject)); }
public JsonResult SaveEM(string method, string Email, string CID, bool INSCOMP, bool AUTOCOMP, bool INSCOMPEX, string Code, string nav) { var rObject = new MethodResponse() { Result = true, ErrorMessage = "", Content = new Models.WorkroomsUserObject[] { } }; Helpers.AdminService service = new Helpers.AdminService(); try { if (Code.Trim().Length == 0) { throw new Exception("alert code not recieved"); } if (Email.Trim().Length == 0) { throw new Exception("Email address not recieved"); } var aO = new AlertManager() { Email = Email.Trim(), Code = Code, CID = CID, INSCOMP = INSCOMP, AUTOCOMP = AUTOCOMP, INSCOMPEX = INSCOMPEX, }; switch (method) { case "em_add": rObject.Result = service.AddEmail(aO); break; case "em_edit": rObject.Result = service.EditActiveAlert(aO); break; case "em_delete": rObject.Result = service.DeleteAAEmail(aO); break; default: rObject.ErrorMessage = "control handler error"; rObject.Result = false; break; } } catch (Exception ex) { rObject.Result = false; rObject.ErrorMessage = ex.Message; } if (rObject.Result == true) { removeCacheHTML(nav); } else { rObject.ErrorMessage = service.ErrorMessage; } return(Json(rObject)); }
public JsonResult RefreshAM() { Helpers.AdminService service = new Helpers.AdminService(); return(Json(service.GetAdminGrid())); }
public JsonResult RefreshEM() { Helpers.AdminService service = new Helpers.AdminService(); return(Json(service.GetAlertEmails("INS"))); }