private void UploadCompleted(object sender, ECCentral.Portal.Basic.Controls.Uploader.UploadCompletedEventArgs e)
        {
            FileUploader uploader = (FileUploader)sender;

            if (uploader == null ||
                e.UploadResult != SingleFileUploadStatus.Success)
            {
                return;
            }
            string serverFilePath = e.ServerFilePath;

            m_dataFacade.ImportProductShiftDetail(serverFilePath, (obj, args) =>
            {
                if (args.FaultsHandle())
                {
                    return;
                }
                if (args.Result)
                {
                    //Window.Alert("导入成功");
                    Window.Alert(ResProductShiftDetailRepor.Msg_ImportSuccess);
                }
                else
                {
                    //Window.Alert("发生未知错误,导入失败,请稍后再试。");
                    Window.Alert(ResProductShiftDetailRepor.Msg_ImportError);
                }
            });
        }
Пример #2
0
        void upload_UploadCompleted(object sender, UploadCompletedEventArgs args)
        {
            if (UploadCompleted != null)
            {
                this.Dispatcher.BeginInvoke(() =>
                {
                    UploadCompleted(this, args);
                });
            }

            m_AllUploadCompletedEventArgs.UploadInfo.Add(args);

            int c = m_files.Count(p => (p.Status == UploadStatus.Canceled) ||
                                  (p.Status == UploadStatus.Complete) ||
                                  (p.Status == UploadStatus.Error) ||
                                  (p.Status == UploadStatus.Removed));

            //所有文件都上传完成了(无论成功还是失败)
            if (m_files.Count == c)
            {
                this.Dispatcher.BeginInvoke(() =>
                {
                    Uploading = false;
                    this.m_uploadFilesButton.Content = ResUploader.Uploader_UploadFiles;
                    if (this.AllFileUploadCompleted != null)
                    {
                        this.AllFileUploadCompleted(this, m_AllUploadCompletedEventArgs);
                    }
                });
            }
        }