public JsonResult GetProdLineRollConfigs(int lineTypeId) { ProdLineRollConfigService plrcsrv = new ProdLineRollConfigService(); List <ProdLineRollConfigDto> list = plrcsrv.GetAll().Where(q => q.TypeID == lineTypeId).OrderBy(q => q.Order).ToList(); return(Json(list, JsonRequestBehavior.AllowGet)); }
public JsonResult ProdLineRollConfigDelete(int id) { TPO.Web.Core.ResponseMessage responseMessage; try { using (ProdLineRollConfigService service = new ProdLineRollConfigService()) { service.Delete(id); } responseMessage = SetResponseMesssage(ActionTypeMessage.SuccessfulSave); } catch (Exception exc) { responseMessage = SetResponseMesssage(ActionTypeMessage.FailedSave, exc.Message); } return(Json(responseMessage, JsonRequestBehavior.AllowGet)); }
public JsonResult ProdLineRollConfigSave(string row) { TPO.Web.Core.ResponseMessage responseMessage; ProdLineRollConfigViewModel prodLineRollConfig = JsonConvert.DeserializeObject <ProdLineRollConfigViewModel>(row); try { if (prodLineRollConfig != null) { ProdLineRollConfigDto dto = new ProdLineRollConfigDto(); using (ProdLineRollConfigService service = new ProdLineRollConfigService()) { Mapper.Map(prodLineRollConfig, dto); if (prodLineRollConfig.Id > 0) { service.Update(dto); } else { service.Add(dto); } } } responseMessage = SetResponseMesssage(ActionTypeMessage.SuccessfulSave); } catch (Exception exc) { responseMessage = SetResponseMesssage(ActionTypeMessage.FailedSave, exc.Message); } prodLineRollConfig.ResponseMessage = responseMessage; return(Json(prodLineRollConfig, JsonRequestBehavior.AllowGet)); }