public JsonResult Modify(Application app) { var response = new Qz.Core.Entity.Response<Application>(); if (app == null || app.Id <= 0) { response.Status = 1; response.Message = "系统应用Id 为 0或不存在 !"; return Json(response); } var entity = service.GetById(app.Id); if (entity.Status != 0) { response.Status = entity.Status; response.Message = entity.Message; return Json(response); } entity.Data.Name = app.Name; entity.Data.Remark = app.Remark; entity.Data.SortCode = app.SortCode; entity.Data.Enabled = app.Enabled; entity.Data.ModifyDate = DateTime.Now; entity.Data.ModifyUserId = SessionUser.Data.Id; entity.Data.ModifyUserName = SessionUser.Data.UserName; response = service.Modify(new Qz.Core.Entity.Request<Application>() { Obj = entity.Data }); return Json(response); }
public JsonResult Add(Application app) { var entity = new Application() { Name = app.Name, Enabled = app.Enabled, Remark = app.Remark, SortCode = app.SortCode, Code = app.Code, CreateUserId = SessionUser.Data.Id, CreateUserName = SessionUser.Data.UserName, CreateDate = DateTime.Now }; var response = service.Add(new Qz.Core.Entity.Request<Application> { Obj = entity }); return Json(response); }