public JsonResult ConfigAddSave(T_BorrowGoodsConfig model) { try { model.isMultiple = 0; model.Type = "审核人"; db.T_BorrowGoodsConfig.Add(model); db.SaveChanges(); return(Json(new { State = "Success" }, JsonRequestBehavior.AllowGet)); } catch (Exception e) { return(Json(new { State = "Faile", Message = e.Message }, JsonRequestBehavior.AllowGet)); } }
public ActionResult ViewConfigEdit(int ID) { T_BorrowGoodsConfig model = db.T_BorrowGoodsConfig.Find(ID); ViewData["boolList"] = Com.BoolList; if (model != null) { return(View(model)); } else { return(HttpNotFound()); } }
public JsonResult ConfigEditSave(T_BorrowGoodsConfig model) { try { T_BorrowGoodsConfig editModel = db.T_BorrowGoodsConfig.Find(model.ID); editModel.Name = model.Name; editModel.Step = model.Step; editModel.Type = model.Type; db.Entry <T_BorrowGoodsConfig>(editModel).State = System.Data.Entity.EntityState.Modified; db.SaveChanges(); return(Json(new { State = "Success" }, JsonRequestBehavior.AllowGet)); } catch (Exception e) { return(Json(new { State = "Faile", Message = e.Message }, JsonRequestBehavior.AllowGet)); } }