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);
        }
Exemple #2
0
        public JsonResult Modify(Role role)
        {
            var response = new Qz.Core.Entity.Response <Role>();

            if (role == null || role.Id <= 0)
            {
                response.Status  = 1;
                response.Message = "角色Id 为 0或不存在 !";
                return(Json(response));
            }

            var entity = service.GetById(role.Id);

            if (entity.Status != 0)
            {
                response.Status  = entity.Status;
                response.Message = entity.Message;
                return(Json(response));
            }

            entity.Data.RoleName       = role.RoleName;
            entity.Data.Remark         = role.Remark;
            entity.Data.SortCode       = role.SortCode;
            entity.Data.Enabled        = role.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 <Role>()
            {
                Obj = entity.Data
            });

            return(Json(response));
        }
Exemple #3
0
        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));
        }
Exemple #4
0
        public JsonResult Modify(Role role)
        {
            var response = new Qz.Core.Entity.Response<Role>();

            if (role == null || role.Id <= 0)
            {
                response.Status = 1;
                response.Message = "角色Id 为 0或不存在 !";
                return Json(response);
            }

            var entity = service.GetById(role.Id);
            if (entity.Status != 0)
            {
                response.Status = entity.Status;
                response.Message = entity.Message;
                return Json(response);
            }

            entity.Data.RoleName = role.RoleName;
            entity.Data.Remark = role.Remark;
            entity.Data.SortCode = role.SortCode;
            entity.Data.Enabled = role.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<Role>()
            {
                Obj = entity.Data
            });

            return Json(response);
        }