Ejemplo n.º 1
0
        private void EditRoleAction(int roleId)
        {
            RoleDetailView personDetail = new RoleDetailView((int)roleId);

            personDetail.Closed += RoleDetailDialog_Closed;
            personDetail.Show();
        }
Ejemplo n.º 2
0
        private void AddRoleAction()
        {
            RoleDetailView roleDetail = new RoleDetailView();

            roleDetail.Closed += RoleDetailDialog_Closed;
            roleDetail.Show();
        }
Ejemplo n.º 3
0
        public JsonResult Create(RoleDetailView vm)
        {
            CreateRoleRequest request = new CreateRoleRequest();

            request.RoleName    = vm.RoleName;
            request.Description = vm.Description;
            CreateRoleResponse response = _roleService.CreateRole(request);

            return(Json(response));
        }
Ejemplo n.º 4
0
        public JsonResult GetDetail(System.Int32 id)
        {
            RoleDetailView vm      = new RoleDetailView();
            GetRoleRequest request = new GetRoleRequest();

            request.RoleId = id;
            GetRoleResponse response = _roleService.GetRole(request);

            if (response.RoleFound)
            {
                vm = response.Role.ConvertToRoleDetailView();
            }

            return(Json(vm, JsonRequestBehavior.AllowGet));
        }
Ejemplo n.º 5
0
        public JsonResult Update(RoleDetailView vm)
        {
            GetRoleRequest request = new GetRoleRequest();

            request.RoleId = vm.RoleId;

            ModifyRoleRequest updateRequest = _roleService.GetRole(request).Role.ConvertToModifyRoleRequest();

            updateRequest.RoleId      = vm.RoleId;
            updateRequest.RoleName    = vm.RoleName;
            updateRequest.Description = vm.Description;

            ModifyRoleResponse response = _roleService.ModifyRole(updateRequest);

            return(Json(response));
        }