Пример #1
0
        private void HistoryForm_Load(object sender, EventArgs e)
        {
            this.label1.Text = modelTets.propName + "检测项折线图";
            SimpleLoading loadingfrm = new SimpleLoading(this);
            //将Loaing窗口,注入到 SplashScreenManager 来管理
            SplashScreenManager loading = new SplashScreenManager(loadingfrm);

            loading.ShowLoading();
            try
            {
                if (modelTets.propName == "中医体质辨识")
                {
                    this.pal_home_fill_fill_fill_top.Visible = false;
                }
                MySendDataTableData += this.ucTestGridTable1.BindingData;
                SetCartesianChartData();
            }
            catch (Exception ex)
            {
                System.Windows.Forms.MessageBox.Show(ex.Message.ToString());
            }
            finally
            {
                loading.CloseWaitForm();
            }
        }
Пример #2
0
        private void btnStart_Click(object sender, EventArgs e)
        {
            Stopwatch watch = new Stopwatch();

            watch.Start();

            this.btnStart.Enabled = false;

            List <Web_ItemLibrary> allData = new List <Web_ItemLibrary>();

            SimpleLoading       loadingfrm = new SimpleLoading(this);
            SplashScreenManager loading    = new SplashScreenManager(loadingfrm);

            loading.ShowLoading();

            //临时数据
            //  8a8632fe-fcb0-4e56-b4b9-7bc965885994  =  https://www.pic.jzbl.com/ItemFiles/0d54bf62-e42b-460b-aab4-7e6bd1990221/8a8632fe-fcb0-4e56-b4b9-7bc965885994/6367115379197304639880898.jpg  直接得到原图
            //  91fbcff0-304c-4fa6-b3d7-3f6662cd609a  =  https://www.pic.jzbl.com/ItemFiles/8b166b7c-d1cf-47b2-806a-3a81ee78b6e3/91fbcff0-304c-4fa6-b3d7-3f6662cd609a/6368089569974537847086484_small.jpg  去_small得到原图

            //  3a966d22-56ba-4d23-9ab5-0355523d1604  =  https://www.pic.jzbl.com/itemFiles/6760efac-e98b-4539-adf3-a842280803dd/2019-09-21/3a966d22-56ba-4d23-9ab5-0355523d1604/i/s/ca4e0b991569072379.jpg  去/s/ 得到原图

            //  9a599ffe-039c-4886-a28c-1936b5e4e5eb  =  https://www.pic.jzbl.com/itemFiles/8e5dc0f7-ed86-4d3c-89db-3a8593f6a2d7/2020-03-02/9a599ffe-039c-4886-a28c-1936b5e4e5eb/i/s/950b1f8a1583157228.jpg  去/s/ 加ori_ 得到原图
            //string[] tdata = { "8a8632fe-fcb0-4e56-b4b9-7bc965885994", "91fbcff0-304c-4fa6-b3d7-3f6662cd609a", "3a966d22-56ba-4d23-9ab5-0355523d1604"}; //"9a599ffe-039c-4886-a28c-1936b5e4e5eb"
            string[] tdata = { "8a8632fe-fcb0-4e56-b4b9-7bc965885994", "3a966d22-56ba-4d23-9ab5-0355523d1604" }; //"9a599ffe-039c-4886-a28c-1936b5e4e5eb"



            using (var context = new DataModelEntities())
            {
                //排除
                //allData = context.Web_ItemLibrary
                //    .Where(o => o.IsDelete == 0 && !string.IsNullOrEmpty(o.ItemContentBefore))
                //    // .Take(50)
                //    .OrderByDescending(o => o.CreateDate)
                //    .ToList();
                allData = context.Web_ItemLibrary
                          .Where(o => tdata.Contains(o.ItemId))
                          .OrderByDescending(o => o.CreateDate)
                          .ToList();

                if (allData.Any())
                {
                    loading.CloseWaitForm();
                }
            }
            gjxm = allData.Count;

            this.tsslgyxm.Text = $"共计项目:{gjxm},有效项目{0}";
            this.tsslgj.Text   = 0.ToString();

            this.ContentImgUploadToOSS(allData, watch);

            //Task task = Task.Run(() =>
            //{
            //    this.ContentImgUploadToOSS(allData, watch);
            //    //this.ContentImgDataCopy(allData, watch);
            //});

            // this.btnStart.Enabled = task.IsCompleted;
        }
Пример #3
0
        private void ReadIdCardFrm_Load(object sender, EventArgs e)
        {
            this.lbl_Address.Text                               =
                this.lbl_Agency.Text                            =
                    this.lbl_Birthday.Text                      =
                        this.lbl_Code.Text                      =
                            this.lbl_ExpireEnd.Text             =
                                this.lbl_ExpireStart.Text       =
                                    this.lbl_Folk.Text          =
                                        this.lbl_Gender.Text    =
                                            this.lbl_Names.Text = "";
            InitFont();
            SimpleLoading loadingfrm = new SimpleLoading(this);
            //将Loaing窗口,注入到 SplashScreenManager 来管理
            SplashScreenManager loading = new SplashScreenManager(loadingfrm);

            loading.ShowLoading();
            try
            {
                Start1("5211336");
            }
            catch (Exception)
            {
                throw;
            }
            finally
            {
                loading.CloseWaitForm();
            }
        }
Пример #4
0
        private void UserSelectForm_Load(object sender, EventArgs e)
        {
            ucDatePickerExt1.CurrentTime = DateTime.Now.AddMonths(-1);
            ucDatePickerExt2.CurrentTime = DateTime.Now;
            SimpleLoading       loadingfrm = new SimpleLoading(this);
            SplashScreenManager loading    = new SplashScreenManager(loadingfrm);

            loading.ShowLoading();
            try
            {
                homeForm                = (HomeForm)this.Owner.Owner;
                readIdCardFrm           = (ReadIdCardFrm)this.Owner;
                MySendDataUserInfoData += this.ucTestGridTableCustom1.BindingUserInfoData;
                BindingData();
                SetDataGridtableData();
            }
            catch (Exception ex)
            {
                LogHelper.WriteLine("UserSelectForm: " + ex.Message.ToString());
            }
            finally
            {
                loading.CloseWaitForm();
            }
        }
Пример #5
0
        //private void btnGetData_Click(object sender, EventArgs e)
        //{

        //    using (var context = new DataModelEntities())
        //    {
        //        var data = context.Web_ItemLibrary
        //            .Where(o => o.IsDelete.ToString().Equals("0"))
        //            .OrderByDescending(o => o.CreateDate)
        //            .ToList();

        //        MessageBox.Show($"DataCount:{data.Count()}");
        //        Debug.WriteLine("DataCount:" + data.Count());

        //    }

        //}

        private void btnStart_Click(object sender, EventArgs e)
        {
            SimpleLoading loadingfrm = new SimpleLoading(this);
            //将Loaing窗口,注入到 SplashScreenManager 来管理
            SplashScreenManager loading = new SplashScreenManager(loadingfrm);

            loading.ShowLoading();
            using (var context = new DataModelEntities())
            {
                var data = context.Web_ItemLibrary
                           .Where(o => o.IsDelete.ToString().Equals("0"))
                           .OrderByDescending(o => o.CreateDate)
                           .ToList();

                if (data.Any())
                {
                    loading.CloseWaitForm();
                }
            }


            return;


            Task task = Task.Run(() =>
            {
                TitleImgCopy();
            });

            btnStart.Enabled = task.IsCompleted;
        }
Пример #6
0
        static void Main()
        {
            AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);
            Application.EnableVisualStyles();

            Application.SetCompatibleTextRenderingDefault(false);

            RegisterFrm   registerFrm = null;
            SimpleLoading loadingfrm  = new SimpleLoading(registerFrm);
            //将Loaing窗口,注入到 SplashScreenManager 来管理
            SplashScreenManager loading = new SplashScreenManager(loadingfrm);

            //判断是否已经有实例在运行
            Process instance = RunningInstance();

            if (instance == null) //没有实例在运行
            {
                loading.ShowLoading();
                //try catch 包起来,防止出错
                try
                {
                    CheckoutModel checkoutModel = new CheckoutModel();
                    string        a = string.Empty, b = string.Empty;
                    checkoutModel.res = RegeditTime.InitRegedit(ref a, ref b, checkoutModel.path, checkoutModel.registerCodeName);

                    checkoutModel.sericalNumber = a;
                    checkoutModel.registerCode  = b;

                    LogHelper.WriteLine("程序主入口: 注册结果:" + checkoutModel.res + ",激活码:" + checkoutModel.sericalNumber + ",注册码:" +
                                        "" + checkoutModel.registerCode + "");

                    loading.CloseWaitForm();

                    registerFrm = new RegisterFrm(checkoutModel);
                    registerFrm.ShowDialog();//显示注册激活窗体

                    if (registerFrm.DialogResult == DialogResult.OK)
                    {
                        Application.Run(new HomeForm(checkoutModel, registerFrm.json));
                    }
                }
                catch (Exception e)
                {
                    loading.CloseWaitForm();
                    /*可选处理异常*/
                    LogHelper.WriteLine("程序主入口:" + e.Message.ToString());
                }
            }
            else //已经有一个实例在运行
            {
                //显示窗口
                ShowWindowAsync(instance.MainWindowHandle, 1);
                //窗口显示在最前端
                SetForegroundWindow(instance.MainWindowHandle);
            }
        }
        //AutoReSizeForm arsf = new AutoReSizeForm();
        public Form1()
        {
            InitializeComponent();
            int SH = Screen.PrimaryScreen.Bounds.Height;
            int SW = Screen.PrimaryScreen.Bounds.Width;

            this.Size   = new Size(SW, SH);
            WindowState = FormWindowState.Maximized;
            SetStyle(ControlStyles.ResizeRedraw |
                     ControlStyles.OptimizedDoubleBuffer | ControlStyles.UserPaint | ControlStyles.Opaque |
                     ControlStyles.AllPaintingInWmPaint, true);
            UpdateStyles();
            //arsf.controllInitializeSize(this);//记录变化之前的位置
            pCurrentWin = this;
            loadingfrm  = new LodingFrm(this);
            loading     = new SplashScreenManager(loadingfrm);
            loading.ShowLoading();
            Log4net.LogHelper.Info("程序启动");
            GetDoctorAndClinc();
            #region 设置显示屏幕
            ScreenType = AppContext.AppConfig.StartupScreen;
            switch (AppContext.AppConfig.StartupScreen)
            {
            case "1":
                var rcf = new RtScreenFrm();
                rcf.Dock = DockStyle.Fill;
                panelControl1.Controls.Add(rcf);
                break;

            case "2":
                var rscf = new RtSmallScreenFrm();
                rscf.Dock = DockStyle.Fill;
                panelControl1.Controls.Add(rscf);
                break;

            case "3":
                var rdscf = new RtDoctorSmallScreenFrm();
                rdscf.Dock = DockStyle.Fill;
                panelControl1.Controls.Add(rdscf);
                break;

            case "4":
                var ddd = new DepartmentDoctorDescription();
                ddd.Dock = DockStyle.Fill;
                panelControl1.Controls.Add(ddd);
                break;

            default:
                MessageBoxUtils.Show("配置的启动屏不正确,请检查后重启", MessageBoxButtons.OK, MessageBoxIcon.Asterisk, MessageBoxDefaultButton.Button1, null);
                System.Environment.Exit(0);
                break;
            }
            #endregion
        }
        private void btnStart_Click(object sender, EventArgs e)
        {
            Stopwatch watch = new Stopwatch();

            watch.Start();

            this.btnStart.Enabled = false;
            this.cb01.Enabled     = false;
            this.cb02.Enabled     = false;
            this.cb03.Enabled     = false;
            txtTarget.Enabled     = false;
            btnTarget.Enabled     = false;

            List <Web_ItemLibrary> allData = new List <Web_ItemLibrary>();

            SimpleLoading       loadingfrm = new SimpleLoading(this);
            SplashScreenManager loading    = new SplashScreenManager(loadingfrm);

            loading.ShowLoading();
            using (var context = new DataModelEntities())
            {
                //排除
                allData = context.Web_ItemLibrary
                          .Where(o => o.IsDelete == 0 && !string.IsNullOrEmpty(o.ItemContentBefore))
                          // .Take(50)
                          .OrderByDescending(o => o.CreateDate)
                          .ToList();

                if (allData.Any())
                {
                    loading.CloseWaitForm();
                }
            }
            gjxm = allData.Count;

            this.tsslgyxm.Text = $"共计项目:{gjxm},有效项目{0}";
            this.tsslgj.Text   = 0.ToString();

            Task task = Task.Run(() =>
            {
                this.ContentImgDataCopy(allData, watch);
            });

            this.btnStart.Enabled = task.IsCompleted;
            this.cb01.Enabled     = task.IsCompleted;
            this.cb02.Enabled     = task.IsCompleted;
            this.cb03.Enabled     = task.IsCompleted;
            btnTarget.Enabled     = task.IsCompleted;
            txtTarget.Enabled     = task.IsCompleted;
        }
Пример #9
0
        private void btnStart_Click(object sender, EventArgs e)
        {
            Stopwatch watch = new Stopwatch();

            watch.Start();

            btnStart.Enabled  = false;
            txtTarget.Enabled = false;
            btnTarget.Enabled = false;

            List <Web_ItemLibrary> allData = new List <Web_ItemLibrary>();

            SimpleLoading       loadingfrm = new SimpleLoading(this);
            SplashScreenManager loading    = new SplashScreenManager(loadingfrm);

            loading.ShowLoading();
            using (var context = new DataModelEntities())
            {
                allData = context.Web_ItemLibrary
                          .Where(o => !string.IsNullOrEmpty(o.ItemFilePath.ToString()) && o.IsDelete == 0)
                          .OrderBy(o => o.CreateDate)
                          .ToList();

                if (allData.Any())
                {
                    loading.CloseWaitForm();
                }
            }


            this.tsslgj.Text = $"共计:{allData.Count}";

            Task task = Task.Run(() =>
            {
                this.FileDataCopy(allData, watch);
            });

            btnStart.Enabled  = task.IsCompleted;
            btnTarget.Enabled = task.IsCompleted;
            txtTarget.Enabled = task.IsCompleted;
        }
Пример #10
0
        private void packZipBtn_Click(object sender, EventArgs e)
        {
            PFWinFormHelper.GetGridSelectedRows(pathDGView, rows => {
                //var targetPath = "D:\\wxj\\pf_project";
                var targetPath = ConfigurationManager.AppSettings["ZipTargetPath"];
                PFDataHelper.CreateDirectory(targetPath);

                PFWinFormHelper.MultiFuncLoadingFlag = true;        //flag 为false时候,退出执行耗时操作

                MultiFuncLoading loadingfrm = new MultiFuncLoading(this);
                // 将Loaing窗口,注入到 SplashScreenManager 来管理
                SplashScreenManager loading = new SplashScreenManager(loadingfrm);
                loading.ShowLoading();
                // 设置loadingfrm操作必须在调用ShowLoading之后执行
                loadingfrm.SetTxt("多功能Loaidng界面", "拼命加载中...客官耐心等待", "Please Waitting...");

                // try catch 包起来,防止出错
                try
                {
                    int i     = 0;
                    int total = rows.Count;
                    foreach (var row in rows)
                    {
                        i++;
                        ZipUtility zip       = new ZipUtility();
                        var path             = row.Cells["FolderPath"].Value.ToString();
                        var fileName         = row.Cells["FolderName"].Value.ToString();
                        var excludeFolderArr = row.Cells["excludeFolder"].Value == null ? null : row.Cells["excludeFolder"].Value.ToString().Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
                        loadingfrm.SetJD("当前:正在打包", "当前进度:" + fileName + "(" + i + "/" + total + ")");

                        zip.ZipFileFromDirectory(path, Path.Combine(targetPath, fileName + "_" + DateTime.Now.ToString("yyyyMMdd") + "_" + ConfigurationManager.AppSettings["FromWhere"] + ".zip"), 4, excludeFolderArr);
                    }
                }
                catch (Exception) { /*可选处理异常*/ }
                finally { loading.CloseWaitForm(); }


                System.Diagnostics.Process.Start(targetPath); //如果是本地访问就直接打开文件夹
            });
        }
Пример #11
0
 private void ZytzbsShowInfo_Load(object sender, EventArgs e)
 {
     this.Text  = nameStr;
     loadingfrm = new SimpleLoading(this);
     //将Loaing窗口,注入到 SplashScreenManager 来管理
     loading = new SplashScreenManager(loadingfrm);
     loading.ShowLoading();
     try
     {
         string url    = EnConfigHelper.GetConfigValue("request", "url");
         string apistr = url + "/app/allInOneClient/getConstitutionTcm";
         //向java端进行注册请求
         StringBuilder postData = new StringBuilder();
         postData.Append("{");
         postData.Append("constitution_name:\"" + nameStr.Split('(')[0] + "\",");
         postData.Append("}");
         //接口调用
         string strJSON = HttpHelper.PostUrl(apistr, postData.ToString());
         //返回结果
         json = HttpHelper.Deserialize <ResultJson_Zytzbs>(strJSON);
         if (json.result == "true")
         {
             loading.CloseWaitForm();
             this.webBrowser1.Document.Write(json.data.cContent);
         }
         else
         {
             loading.CloseWaitForm();
             this.webBrowser1.Document.Write(json.message.ToString());
         }
     }
     catch (Exception ex)
     {
         loading.CloseWaitForm();
         this.webBrowser1.Document.Write(ex.Message.ToString());
         /*可选处理异常*/
         LogHelper.WriteLine("RegisterFrm:" + ex.Message.ToString());
     }
 }
Пример #12
0
        /// <summary>
        ///  显示 load 返回数据
        /// </summary>
        /// <param name="form"></param>

        private void LoadData()
        {
            // List<Web_ItemLibrary> allData = new List<Web_ItemLibrary>();

            SimpleLoading loadingfrm = new SimpleLoading(this);
            //将Loaing窗口,注入到 SplashScreenManager 来管理
            SplashScreenManager loading = new SplashScreenManager(loadingfrm);

            loading.ShowLoading();
            using (var context = new DataModelEntities())
            {
                _allData = context.Web_ItemLibrary
                           .Where(o => o.IsDelete.ToString().Equals("0"))
                           .OrderByDescending(o => o.CreateDate)
                           .ToList();

                if (_allData.Any())
                {
                    loading.CloseWaitForm();
                }
            }

            //   return allData;
        }
Пример #13
0
        /// <summary>
        /// 获取注册码
        /// </summary>
        public void GetRegisterCode()
        {
            try
            {
                loadingfrm = new SimpleLoading(this);
                //将Loaing窗口,注入到 SplashScreenManager 来管理
                loading = new SplashScreenManager(loadingfrm);
                loading.ShowLoading();

                if (this.model.res == 0)
                {
                    try
                    {
                        string        url      = EnConfigHelper.GetConfigValue("request", "url");
                        string        apistr   = url + "/app/allInOneClient/getClientStatus";
                        StringBuilder postData = new StringBuilder();
                        postData.Append("{");
                        postData.Append("licence_code:\"" + this.model.sericalNumber + "\",");
                        postData.Append("mac_code:\"" + this.model.registerCode + "\"");
                        postData.Append("}");
                        //接口调用
                        string strJSON = HttpHelper.PostUrl(apistr, postData.ToString());
                        //返回结果
                        json = HttpHelper.Deserialize <ResultJSON>(strJSON);
                        if (json.result == "true")
                        {
                            loading.CloseWaitForm();
                            this.json.data.checkItemList.Insert(0, new CheckModel {
                                tempPropID = 0, propName = "全部"
                            });
                            this.DialogResult = DialogResult.OK;//关键:设置登陆成功状态
                            this.Close();
                        }
                        else
                        {
                            loading.CloseWaitForm();
                            MessageBox.Show("激活码已存在:" + json.message.ToString());
                            /*可选处理异常*/
                            LogHelper.WriteLine("RegisterFrm:" + json.message.ToString());
                            this.Close();
                            this.Dispose();
                        }
                    }
                    catch (Exception ex)
                    {
                        loading.CloseWaitForm();
                        MessageBox.Show("服务器出错:" + ex.Message.ToString());
                        /*可选处理异常*/
                        LogHelper.WriteLine("RegisterFrm:" + ex.Message.ToString());
                        this.Close();
                        this.Dispose();
                    }
                }
                else if (this.model.res == 1)//软件尚未注册
                {
                    try
                    {
                        if (this.txt_cdkey.Text.ToString().Trim().Length > 0)
                        {
                            this.model.sericalNumber = this.txt_cdkey.Text.ToString().Trim();
                            //date
                            string dateNow = RegeditTime.GetNowDate();
                            //生成序列号
                            this.model.registerCode = RegeditTime.CreatSerialNumber(this.model.sericalNumber, dateNow);

                            string url    = EnConfigHelper.GetConfigValue("request", "url");
                            string apistr = url + "/app/allInOneClient/startRegister";
                            //向java端进行注册请求

                            StringBuilder postData = new StringBuilder();
                            postData.Append("{");
                            postData.Append("licence_code:\"" + this.model.sericalNumber + "\",");
                            postData.Append("mac_code:\"" + this.model.registerCode + "\"");
                            postData.Append("}");
                            //接口调用

                            string strJSON = HttpHelper.PostUrl(apistr, postData.ToString());
                            //返回结果
                            json = HttpHelper.Deserialize <ResultJSON>(strJSON);
                            if (json.result == "true")
                            {
                                string        url1      = EnConfigHelper.GetConfigValue("request", "url");
                                string        apistr1   = url1 + "/app/allInOneClient/getClientStatus";
                                StringBuilder postData1 = new StringBuilder();
                                postData1.Append("{");
                                postData1.Append("licence_code:\"" + this.model.sericalNumber + "\",");
                                postData1.Append("mac_code:\"" + this.model.registerCode + "\"");
                                postData1.Append("}");
                                //接口调用
                                string strJSON1 = HttpHelper.PostUrl(apistr1, postData1.ToString());
                                //返回结果
                                json = HttpHelper.Deserialize <ResultJSON>(strJSON1);
                                if (json.result == "true")
                                {
                                    //写入到注册表
                                    RegeditTime.WriteSetting(this.model.path, this.model.registerCodeName, this.model.registerCode);

                                    this.model.res = 0;
                                    loading.CloseWaitForm();

                                    this.json.data.checkItemList.Insert(0, new CheckModel {
                                        tempPropID = 0, propName = "全部"
                                    });

                                    DialogResult dr = MessageBox.Show("注册成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                                    if (dr == DialogResult.OK)
                                    {
                                        loading.CloseWaitForm();
                                        this.DialogResult = DialogResult.OK;//关键:设置登陆成功状态
                                        this.Close();
                                    }
                                }
                                else
                                {
                                    loading.CloseWaitForm();
                                    lbl_note.Text = "错误:" + json.message.ToString() + "";
                                }
                            }
                            else
                            {
                                loading.CloseWaitForm();
                                lbl_note.Text = "注册失败:" + json.message.ToString() + "";
                            }
                        }
                        else
                        {
                            loading.CloseWaitForm();
                            lbl_note.Text = "请输入激活码";
                        }
                    }
                    catch (Exception ex)
                    {
                        loading.CloseWaitForm();
                        MessageBox.Show("服务器出错:" + ex.Message.ToString());
                        /*可选处理异常*/
                        LogHelper.WriteLine("RegisterFrm:" + ex.Message.ToString());
                        this.Close();
                        this.Dispose();
                    }
                }
                else if (this.model.res == 2)//注册机器与本机不一致
                {
                    loading.CloseWaitForm();
                    MessageBox.Show("注册机器与本机不一致!");
                    this.Close();
                    this.Dispose();
                }
                else if (this.model.res == 3)//软件试用已到期
                {
                    loading.CloseWaitForm();
                    MessageBox.Show("软件试用已到期!");
                    this.Close();
                    this.Dispose();
                }
                else if (this.model.res == 4)//激活码与注册码不匹配
                {
                    loading.CloseWaitForm();
                    MessageBox.Show("激活码与注册码不匹配!");
                    this.Close();
                    this.Dispose();
                }
                else//软件运行已到期
                {
                    loading.CloseWaitForm();
                    MessageBox.Show("软件运行已到期!");
                    this.Close();
                    this.Dispose();
                }
            }
            catch (Exception e)
            {
                loading.CloseWaitForm();
                MessageBox.Show("服务器出错:" + e.Message.ToString());
                this.Close();
                this.Dispose();
            }
        }
Пример #14
0
        /// <summary>
        /// 移动图片
        /// </summary>
        private void TitleImgCopy()
        {
            using (var context = new DataModelEntities())
            {
                string message = "开始获取数据,请等待…";

                if (this.InvokeRequired)
                {
                    this.Invoke(new DelegateWriteMessage(WriteMessage), new object[] { message });
                }
                else
                {
                    this.WriteMessage(message);
                }

                SimpleLoading loadingfrm = new SimpleLoading(this);
                //将Loaing窗口,注入到 SplashScreenManager 来管理
                SplashScreenManager loading = new SplashScreenManager(loadingfrm);
                loading.ShowLoading();

                var data = context.Web_ItemLibrary
                           .Where(o => o.IsDelete.ToString().Equals("0"))
                           .OrderByDescending(o => o.CreateDate)
                           .ToList();



                int iExists = 1, iUnExists = 1;


                for (int i = 0; i < data.Count; i++)
                {
                    string filePath = data[i].ItemTitleImg.Replace(_domain, _G).Replace('/', '\\');

                    if (!File.Exists(filePath))
                    {
                        iUnExists++;
                        message = $"路径:{filePath} 状态:< > 文件不存在";
                    }
                    else
                    {
                        iExists++;
                        message = $"路径:{filePath} 状态:< > 待复制";
                        //没有就创建一个基本文件夹

                        string filePathCopy = filePath.Replace(_itemfiles, _itemfilescopy);
                        try
                        {
                            //没有文件夹还需要创建
                            //拷贝原始文件
                            string fileName = filePathCopy.Split('\\').LastOrDefault();
                            string basePath = filePathCopy.Replace(fileName, "");
                            if (!Directory.Exists(basePath))
                            {
                                Directory.CreateDirectory(basePath);
                            }

                            //判断文件是否存在
                            if (File.Exists(filePathCopy))
                            {
                                message = $"拷贝(新路径原图)文件:{filePath} 到 {filePathCopy} 状态:》文件以存在《";
                            }
                            else
                            {
                                File.Copy(filePath, filePathCopy);
                                message = $"拷贝(压缩图片)文件:{filePath} 到 {filePathCopy} 状态:》成功《";
                            }

                            if (filePath.Contains(_samll))
                            {
                                if (filePath.Contains(_nS))
                                {
                                    string nSPath     = filePath.Replace(_nS, @"\").Replace(_samll, "");
                                    string nSfilePath = filePathCopy.Replace(_nS, @"\").Replace(_samll, "");

                                    //判断文件是否存在
                                    if (File.Exists(nSfilePath))
                                    {
                                        message = $"拷贝(新路径原图)文件:{nSPath} 到 {nSfilePath} 状态:》文件以存在《";
                                    }
                                    else
                                    {
                                        File.Copy(nSPath, nSfilePath);
                                        message = $"拷贝(新路径原图)文件:{nSPath} 到 {nSfilePath} 状态:》成功《";
                                    }
                                }
                                else
                                {
                                    string nSPath     = filePath.Replace(_samll, "");
                                    string nSfilePath = filePathCopy.Replace(_samll, "");
                                    //判断文件是否存在
                                    if (File.Exists(nSfilePath))
                                    {
                                        message = $"拷贝(老路径原图)文件:{nSPath} 到 {nSfilePath} 状态:》文件以存在《";
                                    }
                                    else
                                    {
                                        File.Copy(nSPath, nSfilePath);
                                        message = $"拷贝(老路径原图)文件:{nSPath} 到 {nSfilePath} 状态:》成功《";
                                    }
                                }
                            }
                            else
                            {
                                message = $"封面路径:{filePath} 不包含_small 状态:》未知《";
                            }
                        }
                        catch (Exception ex)
                        {
                            message = $"拷贝文件:{filePath} 状态:》失败{ex}";
                        }
                    }
                    if (this.InvokeRequired)
                    {
                        this.Invoke(new DelegateWriteMessage(WriteMessage), new object[] { message });
                    }
                    else
                    {
                        this.WriteMessage(message);
                    }
                }


                message = $"共计{data.Count}条,本地存在{iExists}条,不存在{iUnExists}条";


                if (this.InvokeRequired)
                {
                    this.Invoke(new DelegateWriteMessage(WriteMessage), new object[] { message });
                }
                else
                {
                    this.WriteMessage(message);
                }
            }
        }