Exemplo n.º 1
0
        public async Task <IActionResult> Update(Application.Models.ViewModels.Permission.PermissionUpdateViewModel vm)
        {
            bool commandBool = await _SERVICE.Update(vm);

            // 是否存在消息通知
            if (commandBool)
            {
                return(Json(new { status = true, msg = "成功!" }));
            }
            else
            {
                var           notificationDatas = _NOTIFICATIONS.GetNotifications();
                StringBuilder strMsg            = new StringBuilder();
                foreach (var item in notificationDatas.Where(x => x.Key == "Permission").ToList())
                {
                    strMsg.Append(item.Value);
                }
                if (strMsg.Length < 1)
                {
                    strMsg.Append("发生异常!");
                }
                return(Json(new { status = false, msg = strMsg.ToString() }));
            }
        }
Exemplo n.º 2
0
        public async Task <Boolean> Update(Application.Models.ViewModels.Permission.PermissionUpdateViewModel vm)
        {
            var CommandData = new Domain.Models.CommandModels.Permission.UpdateCommandModel(vm.PermissionId.StringToGuid(), vm.PermissionName, vm.PermissionType.IntToEnum <Domain.Models.CommandModels.Permission.PermissionCommandModel.PermissionTypeEnum>(), vm.PermissionAction, vm.PermissionParentId, vm.IsValid);

            return(await Bus.SendCommand(CommandData));
        }