Example #1
0
        /// <summary>
        /// 从服务器删除文件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private async void Image_Delete_MouseLeftButtonUpAsync(object sender, System.Windows.Input.MouseButtonEventArgs e)
        {
            Lib.PlanFile SelectFile = LB_FileList.SelectedItem as Lib.PlanFile;
            if (!AppFuns.ShowMessage($"删除文件《{SelectFile.Name}》?", "确认", showYesNo: true))
            {
                return;
            }
            ExcuteResult delResult = await DataPlanFileRepository.DeleteFileInfo(SelectFile);

            if (delResult.State == 0)
            {
                _UCPlanInfoVM.PlanFiles.Remove(SelectFile);
            }
        }
Example #2
0
        /// <summary>
        /// 删除该文件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private async void btn_DeleteFileAsync(object sender, RoutedEventArgs e)
        {
            if (AppFuns.ShowMessage($"确定要删除[{_CurUCViewModel.CurFile.Name}]文件吗?", Caption: "确认", showYesNo: true))
            {
                ExcuteResult JsonResult = await DataPlanFileRepository.DeleteFileInfo(_CurUCViewModel.CurFile);

                if (JsonResult.State == 0)
                {
                    _DelFileCallBackFun?.Invoke(_CurUCViewModel.CurFile);
                    AppFuns.SetStateBarText(JsonResult.Msg);
                }
                else
                {
                    AppFuns.ShowMessage(JsonResult.Msg, "消息");
                }
            }
        }