public JsonResult ActivateWorkroom(int WorkroomId, int LocationMasterId) { MethodResponse response = new MethodResponse() { Result = false, ErrorMessage = "Error Activating Workroom" }; Helpers.InspectionService service = new Helpers.InspectionService(); response.Result = service.SetActivator(LocationMasterId, WorkroomId, true); response.ErrorMessage = service.ErrorMessage; return(Json(response)); }
public ActionResult EditWorkroom() { var rObject = new MethodResponse() { Result = true, ErrorMessage = "" }; int locid, wrid = 0; var loc_qv = HttpContext.Request.Params["LocationId"]; var wr_qv = HttpContext.Request.Params["Id"]; var cid = HttpContext.Request.Params["CIDv"]; if (int.TryParse(loc_qv, out locid) && int.TryParse(wr_qv, out wrid)) { bool status = false; if (bool.TryParse(HttpContext.Request.Params["Status"], out status)) { Helpers.InspectionService service = new Helpers.InspectionService(); rObject.Result = service.SetActivator(locid, wrid, status); if (rObject.Result && cid.Length == 6) { service.ClearCachedWorkroomUserObject(cid); service.CacheWorkroomUserObject(cid); } rObject.ErrorMessage = service.ErrorMessage; } else { rObject.Result = false; rObject.ErrorMessage = "Error Parsing Status"; return(Json(rObject, JsonRequestBehavior.AllowGet)); } } else { rObject.Result = false; rObject.ErrorMessage = "Error Parsing Index id's"; return(Json(rObject, JsonRequestBehavior.AllowGet)); } return(Json(true, JsonRequestBehavior.AllowGet)); }