public ActionResult Edit(string id) { long idParse; WebServiceGuide model = new WebServiceGuide(); if (long.TryParse(id, out idParse)) { model = webServiceGuideBll.GetModelById(idParse); } return(View(model)); }
public AjaxResult Edit(WebServiceGuide model, long @operator) { AjaxResult result = new AjaxResult(); var procResult = dal.Edit(model, @operator); result.flag = procResult.IsSuccess; if (result.flag) { result.message = "修改成功!"; } else { result.message = procResult.ProcMsg; } return(result); }
public AjaxResult Add(WebServiceGuide model) { AjaxResult result = new AjaxResult(); var procResult = dal.Add(model); result.flag = procResult.IsSuccess; if (result.flag) { result.message = "新增成功!"; } else { result.message = procResult.ProcMsg; } return(result); }
public ProcResult Add(WebServiceGuide model) { ProcResult result = new ProcResult(); try { db.WebServiceGuide.Add(model); result.IsSuccess = db.SaveChanges() > 0; } catch (Exception ex) { result.ProcMsg = ex.InnerException.Message; LogUtil.Exception("ExceptionLogger", ex); } return(result); }
public ProcResult Edit(WebServiceGuide model, long currentOperator) { ProcResult result = new ProcResult(); try { model.Creator = currentOperator; model.CreateTime = DateTime.Now; db.WebServiceGuide.Attach(model); db.Entry(model).State = System.Data.Entity.EntityState.Modified; result.IsSuccess = db.SaveChanges() > 0; return(result); } catch (Exception ex) { result.ProcMsg = ex.InnerException.Message; LogUtil.Exception("ExceptionLogger", ex); } return(result); }
public ActionResult Edit(WebServiceGuide model) { var currentUser = HttpContext.Session[Constants.USER_KEY] as USP.Models.POCO.User; model.Creator = currentUser.SysOperator.ID; model.CreateTime = DateTime.Now; model.Auditor = null; model.AuditTime = null; if (ModelState.IsValid) { var result = webServiceGuideBll.Edit(model, currentUser.SysOperator.ID); if (result.flag) { TempData["isSuccess"] = "true"; TempData["MessageInfo"] = "完善信息成功!"; return(View("Index")); } } TempData["isSuccess"] = "false"; TempData["MessageInfo"] = "完善信息失败!"; return(View(model)); }
public ProcResult Auditor(WebServiceGuide model, long auditor) { ProcResult result = new ProcResult(); try { var entity = GetModelById(model.ID); if (entity != null) { entity.Auditor = auditor; entity.AuditTime = DateTime.Now; } db.Entry <WebServiceGuide>((WebServiceGuide)entity).State = System.Data.Entity.EntityState.Modified; result.IsSuccess = db.SaveChanges() > 0; } catch (Exception ex) { result.ProcMsg = ex.InnerException.Message; LogUtil.Exception("ExceptionLogger", ex); } return(result); }
public ActionResult Add(WebServiceGuide model) { var currentUser = HttpContext.Session[Constants.USER_KEY] as USP.Models.POCO.User; if (ModelState.IsValid) { model.CreateTime = DateTime.Now; model.Creator = currentUser.SysOperator.ID; AjaxResult result = webServiceGuideBll.Add(model); if (result.flag) { TempData["returnMsgType"] = "success"; TempData["returnMsg"] = "添加成功"; return(View("Index")); } else { TempData["returnMsgType"] = "error"; TempData["returnMsg"] = result.message; } } return(View(model)); }