public void UpdateMenu(SysModuleElement model) { model.UpdateBy = Repository._loginInfo.Account; model.UpdateTime = DateTime.Now; UnitWork.Update <SysModuleElement>(model); UnitWork.Save(); }
public void AddMenu(SysModuleElement model) { model.CreateBy = Repository._loginInfo.Account; model.CreateTime = DateTime.Now; UnitWork.Add(model); UnitWork.Save(); }
public HttpResponseMessage Post([FromBody] SysModuleElement sysModuleElementInfo) { return(ActionWarpper.Process(sysModuleElementInfo, OperationCodes.ASYSELEM, () => { var repo = RepositoryManager.GetRepository <ISysModuleElementRepository>(); repo.Insert(sysModuleElementInfo); return Request.CreateResponse(HttpStatusCode.OK, sysModuleElementInfo); }, this)); }
public HttpResponseMessage Put(int id, [FromBody] SysModuleElement sysModuleElementInfo) { return(ActionWarpper.Process(sysModuleElementInfo, OperationCodes.MSYSELEM, () => { sysModuleElementInfo.ElementID = id; var repo = RepositoryManager.GetRepository <ISysModuleElementRepository>(); repo.Update(sysModuleElementInfo); return Request.CreateResponse(HttpStatusCode.OK); }, this)); }
public string UpdateMenu(SysModuleElement model) { try { _app.UpdateMenu(model); } catch (Exception ex) { Result.Code = 500; Result.Message = ex.InnerException?.Message ?? ex.Message; } return(JsonHelper.Instance.Serialize(Result)); }
public string AddMenu(SysModuleElement model) { try { model.CreateTime = DateTime.Now; _app.AddMenu(model); } catch (Exception ex) { Result.Code = 500; Result.Message = ex.InnerException?.Message ?? ex.Message; } return(JsonHelper.Instance.Serialize(Result)); }