Exemplo n.º 1
0
 public void UpdateMenu(SysModuleElement model)
 {
     model.UpdateBy   = Repository._loginInfo.Account;
     model.UpdateTime = DateTime.Now;
     UnitWork.Update <SysModuleElement>(model);
     UnitWork.Save();
 }
Exemplo n.º 2
0
        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));
        }
Exemplo n.º 5
0
 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));
 }
Exemplo n.º 6
0
 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));
 }