コード例 #1
0
        /// <summary>
        /// 删除任务
        /// </summary>
        /// <param name="testData"></param>
        /// <returns></returns>
        protected async Task Delete(object testData)
        {
            MessageBoxResult Confirm = await MessageBox.ConfirmAsync("确定要删除?");

            MessageService.Show($"您选择了:{Confirm.ToString()}", MessageType.Success);
            await Task.Delay(300);

            if (Confirm == MessageBoxResult.Ok)
            {
                QuartzOptionDTO quartzOption = ( QuartzOptionDTO )testData;
                if (quartzOption.Id == 1000 || quartzOption.Id == 1001)
                {
                    MessageService.Show($"不允许删除 ", MessageType.Warning);
                    return;
                }
                var result = await quartzService.DeleteByAsync(p => p.Id == quartzOption.Id);

                if (result)
                {
                    await schedulerFactory.Remove(mapper.Map <QuartzOption>(quartzOption));
                    await ResetCache();
                }

                MessageService.Show($"删除结果:{JsonConvert.SerializeObject(result)} ");
            }
            await ReLoadData();
        }
コード例 #2
0
        protected async Task DeleteChecked()
        {
            MessageBoxResult Confirm = await MessageBox.ConfirmAsync("确定要删除?");

            if (Confirm == MessageBoxResult.Ok)
            {
                #region  除
                QuartzOptionDTO[] quartzOptions = new QuartzOptionDTO[table.SelectedRows.Count()];
                table.SelectedRows.CopyTo(quartzOptions);
                var jobIds = quartzOptions?.Select(p => p.Id);
                if (jobIds != null && (jobIds.Contains(1000) || jobIds.Contains(1001)))
                {
                    this.MessageService.Show($"默认任务不可删除 ", MessageType.Error);
                    return;
                }

                var JobIds = quartzOptions.Select(p => p.Id);
                var result = await quartzService.DeleteByAsync(p => JobIds.Contains(p.Id));

                if (result)
                {
                    await ResetCache();

                    foreach (var quartzOption in quartzOptions)
                    {
                        await schedulerFactory.Remove(mapper.Map <QuartzOption>(quartzOption));
                    }
                }
                MessageService.Show($"删除结果:{JsonConvert.SerializeObject(result)} ");
                #endregion
            }
            await ReLoadData();
        }
コード例 #3
0
        internal async Task ReplyNow()
        {
            var model = form.GetValue <NewReplyModel>();

            if (string.IsNullOrWhiteSpace(model?.Content))
            {
                await CloseAsync(new NewReplyModel());
            }
            else
            {
                MessageBoxResult Confirm = await MessageBox.ConfirmAsync("是否要提交回复");

                if (Confirm == MessageBoxResult.Ok)
                {
                    if ((await authenticationStateTask).User.Identity.IsAuthenticated)
                    {
                        await CloseAsync(model);
                    }
                    else
                    {
                        MessageService.Show("请登录后再回复帖子", MessageType.Warning);
                    }
                }
                else
                {
                    MessageService.Show("您选择了取消", MessageType.Info);
                }
            }
        }
コード例 #4
0
        private async Task HandleClearCache()
        {
            if (await MessageBox.ConfirmAsync("Do you really want to clear server cache?"))
            {
                await MaintenanceFacade.ClearCache();

                Messenger.AddInformation("Server cache cleared.");
            }
        }
コード例 #5
0
        private async Task RemoveCultureFromLocalStorage()
        {
            if (await MessageBox.ConfirmAsync("Do you really want to remove culture cache?"))
            {
                await LocalStorageService.RemoveItemAsync("culture");

                Messenger.AddInformation(AdmninIndexLocalizer["CultureRemoved"]);                 // TODO Just a demo
            }
        }
コード例 #6
0
        public async Task ConfirmAsync(Func <Task <BaseResponse> > action, Action <BaseResponse> callback = null, string ConfirmMessage = "确定要执行该操作吗?")
        {
            MessageBoxResult Confirm = await MessageBox.ConfirmAsync(ConfirmMessage);

            if (Confirm == MessageBoxResult.Ok)
            {
                var result = await action();

                if (result.IsSuccess)
                {
                    callback?.Invoke(result);
                }
                MessageService.Show(result.Message, result.IsSuccess ? MessageType.Success : MessageType.Error);
            }
            else
            {
                MessageService.Show("您选择了取消", MessageType.Info);
            }
        }
コード例 #7
0
ファイル: BAdminBase.cs プロジェクト: ghd258/BlazAdmin
        internal async System.Threading.Tasks.Task LogoutAsync()
        {
            var result = await MessageBox.ConfirmAsync("是否确认注销登录?");

            if (result != MessageBoxResult.Ok)
            {
                return;
            }

            await form.SubmitAsync("/account/login?callback=" + NavigationManager.Uri);
        }
コード例 #8
0
        internal async System.Threading.Tasks.Task LogoutAsync()
        {
            var result = await MessageBox.ConfirmAsync("是否确认注销登录?");

            if (result != MessageBoxResult.Ok)
            {
                return;
            }

            await UserService.LogoutAsync(form, NavigationManager.Uri);
        }
コード例 #9
0
        private async Task ExecuteDeleteAsync(object context, object tableDataSource)
        {
            var result = await messageBox.ConfirmAsync("确认删除吗?");

            if (result != MessageBoxResult.Ok)
            {
                return;
            }
            ((List <KeyValueModel>)tableDataSource).Remove((KeyValueModel)context);
            currentTable.Refresh();
        }
コード例 #10
0
        /// <summary>
        /// 遗留问题,暂时只能直接刷新url
        /// </summary>
        /// <param name="replyId"></param>
        /// <returns></returns>
        protected async Task DeleteRep(string replyId)
        {
            MessageBoxResult Confirm = await MessageBox.ConfirmAsync("确定要删除?");

            if (Confirm == MessageBoxResult.Ok)
            {
                var result = await NetService.DeleteRelpy(replyId);

                if (result.IsSuccess)
                {
                    NavigationManager.NavigateTo(NavigationManager.Uri, true);
                }
            }
        }
コード例 #11
0
        /// <summary>
        /// 删除纪录
        /// </summary>
        /// <param name="topic"></param>
        public async Task Del(object topic)
        {
            MessageBoxResult Confirm = await MessageBox.ConfirmAsync("确定要删除?");

            if (Confirm == MessageBoxResult.Ok)
            {
                if (topic is PersonalTopicDisplayDto topicModel)
                {
                    var result = await NetService.DeleteTopic(topicModel.Id);

                    if (result.IsSuccess)
                    {
                        await LoadDatas();

                        ToastSuccess("删除成功");
                    }
                }
            }
        }
コード例 #12
0
        /// <summary>
        /// 删除纪录
        /// </summary>
        /// <param name="topic"></param>
        public async Task Del(object topic)
        {
            MessageBoxResult Confirm = await MessageBox.ConfirmAsync("确定要取消收藏?");

            if (Confirm == MessageBoxResult.Ok)
            {
                if (topic is PersonalFollowDisplayDto followModel)
                {
                    var result = await NetService.CancelFollow(followModel.FollowId);

                    if (result.IsSuccess)
                    {
                        await SearchData();

                        ToastWarning("取消收藏了");
                    }
                }
            }
        }
コード例 #13
0
        /// <summary>
        /// 删除纪录
        /// </summary>
        /// <param name="topic"></param>
        protected async Task Del(object topic)
        {
            MessageBoxResult Confirm = await MessageBox.ConfirmAsync("确定要删除?");

            if (Confirm == MessageBoxResult.Ok)
            {
                if (topic is PersonalReplyDisplayDto replyDto)
                {
                    var result = await NetService.DeleteRelpy(replyDto.Id);

                    if (result.IsSuccess)
                    {
                        await LoadDatas();

                        ToastSuccess("删除成功");
                    }
                }
            }
        }
コード例 #14
0
        protected async Task Delete(object context)
        {
            var claim = ((RoleClaimDto)context);

            MessageBoxResult Confirm = await MessageBox.ConfirmAsync("确定要删除该记录吗?");

            if (Confirm == MessageBoxResult.Ok)
            {
                var DeleteResult = await NetService.DeleteRoleClaim(claim);

                if (DeleteResult.IsSuccess)
                {
                    await LoadDatas();
                }
                MessageService.Show(DeleteResult.Message, DeleteResult.IsSuccess ? MessageType.Success : MessageType.Error);
            }
            else
            {
                MessageService.Show("您选择了取消", MessageType.Info);
            }
        }
コード例 #15
0
        /// <summary>
        /// 遗留问题,暂时只能直接刷新url
        /// </summary>
        /// <param name="replyId"></param>
        /// <returns></returns>
        protected async Task DeleteRep(string replyId)
        {
            MessageBoxResult Confirm = await MessageBox.ConfirmAsync("确定要删除?");

            if (Confirm == MessageBoxResult.Ok)
            {
                var result = await NetService.DeleteRelpy(replyId);

                if (result.IsSuccess)
                {
                    //if (OnItemDeleted.HasDelegate)
                    //    await OnItemDeleted.InvokeAsync(replyId);

                    //await LoadData();
                    //ToastSuccess("删除成功");
                    ////var deleteReply = Replys.FirstOrDefault(p => p.Id == replyId);
                    ////Replys.Remove(deleteReply);
                    //await Task.Delay(500);
                    NavigationManager.NavigateTo(NavigationManager.Uri, true);
                    //MarkAsRequireRender();
                    //StateHasChanged();
                }
            }
        }