public JsonResult Edit(MBR_Info entity) { if (entity != null && ModelState.IsValid) { using (MBREntities db = new MBREntities()) { MBRInfoService us = new MBRInfoService(db); if (us.Edit(ref errors, entity)) { LogHandler.WriteServiceLog(LogonUser.RealName, "InfoID:" + entity.InfoID + ",Title:" + entity.Title, Resource.EditSucceed, Resource.Edit, "MBR膜管理"); return(Json(JsonHandler.CreateMessage(1, Resource.EditSucceed))); } else { string ErrorCol = errors.Error; LogHandler.WriteServiceLog(LogonUser.RealName, "InfoID:" + entity.InfoID + ",Title:" + entity.Title, Resource.EditFail, Resource.Edit, "MBR膜管理"); return(Json(JsonHandler.CreateMessage(0, Resource.EditFail + ErrorCol))); } } } else { return(Json(JsonHandler.CreateMessage(0, Resource.EditFail))); } }
public ViewResult ANIndex(int?InfoID) { MBR_Info Info = null; if (InfoID.HasValue) { using (MBREntities db = new MBREntities()) { Info = db.MBR_Info.Find(InfoID.Value); } } if (Info == null) { throw new Exception("请选择膜"); } ViewBag.MBRInfo = Info; ANInfoModel model = new ANInfoModel(); using (MBREntities db = new MBREntities()) { model.CLCurve = db.AN_CLCurve.Find(InfoID.Value); model.HighCurve = db.AN_HighCurve.Find(InfoID.Value); model.LowCurve = db.AN_LowCurve.Find(InfoID.Value); } model.InfoID = (int)InfoID; return(View(model)); }
public ActionResult Details(int id) { using (MBREntities db = new MBREntities()) { MBRInfoService us = new MBRInfoService(db); MBR_Info entity = us.GetById(id); return(View(entity)); } }
public ActionResult Edit(int id) { MBR_Info entity = null; using (MBREntities db = new MBREntities()) { entity = db.MBR_Info.Include("MBR_Pool").Where(m => m.InfoID == id).FirstOrDefault(); } return(View(entity)); }
public JsonResult Create(MBR_Info entity) { using (MBREntities db = new MBREntities()) { MBRInfoService us = new MBRInfoService(db); if (us.Create(ref errors, entity)) { LogHandler.WriteServiceLog(LogonUser.RealName, "InfoID:" + entity.InfoID + ",Title:" + entity.Title, Resource.InsertSucceed, Resource.Create, "MBR膜管理"); return(Json(JsonHandler.CreateMessage(1, Resource.InsertSucceed), JsonRequestBehavior.AllowGet)); } else { string ErrorCol = errors.Error; LogHandler.WriteServiceLog(LogonUser.RealName, "InfoID:" + entity.InfoID + ",Title:" + entity.Title, Resource.InsertFail, Resource.Create, "MBR膜管理"); return(Json(JsonHandler.CreateMessage(0, Resource.InsertFail + ErrorCol), JsonRequestBehavior.AllowGet)); } } }
public ViewResult OffLineIndex(int?InfoID) { MBR_Info Info = null; if (InfoID.HasValue) { using (MBREntities db = new MBREntities()) { Info = db.MBR_Info.Find(InfoID.Value); } } if (Info == null) { throw new Exception("请选择膜"); } ViewBag.MBRInfo = Info; return(View()); }