예제 #1
0
        public JsonResult Add(Domain.Dto.Sys_RolesDto role)
        {
            if (!string.IsNullOrEmpty(role.Description))
            {
                var model = new iPow.Infrastructure.Data.DataSys.Sys_Roles();
                model.Description = role.Description;
                model.RoleID      = roleService.GetNewRoleId();
                roleService.Add(model, null);
            }
            var data = this.GetStateTrueList();
            var dto  = data.ToDto();

            return(Json(dto, JsonRequestBehavior.AllowGet));
        }
예제 #2
0
        public JsonResult Edit(Domain.Dto.Sys_RolesDto role)
        {
            if (role != null && !string.IsNullOrEmpty(role.Description))
            {
                var model = roleService.Get(role.Id);
                model.Description = role.Description;
                try
                {
                    roleService.Modify(model, null);
                }
                catch
                {
                }
            }
            var data = this.GetStateTrueList();
            var dto  = data.ToDto();

            return(Json(dto, JsonRequestBehavior.AllowGet));
        }