예제 #1
0
        /// <summary>
        /// 定时刷新
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Timer_DownloadInfo_Tick(object sender, EventArgs e)
        {
            this.Timer_DownloadInfo.Stop();
            try
            {
                //下载信息
                DownloadInfo di = new DownloadInfo(this);
                //               this.Label_DownloadWaitObject.Text = "正在下载更新数据\n请稍后.....";
                Thread.Sleep(1000);
                //              this.Label_DownloadWaitObject.Refresh();
                this.BeforeDownload();
                Application.DoEvents();
                Thread.Sleep(1000);
                di.download();
                //               this.Label_DownloadWaitObject.Text = "正在同步数据\n请稍后.....";
                this.Label_DownloadWaitObject.Refresh();
                Thread.Sleep(1000);
                //               this.Label_DownloadWaitObject.Refresh();
                di.SynParam();
                //同步数据
                this.InitData();
                this.Timer_DownloadInfo.Interval = GlobalVariables.IntRefreshSec * 1000;
                //上传消费记录
                //              this.Label_DownloadWaitObject.Text = "正在上传消费数据\n请稍后.....";
                this.Label_DownloadWaitObject.Refresh();
                Thread.Sleep(1000);
                UploadInfo ui = new UploadInfo();
                ui.CouponPrint();
                this.AfterDownload();

            }
            catch (Exception ep)
            {
                ErrorLog.log(ep);
            }
            this.Timer_DownloadInfo.Start();
        }