예제 #1
0
        private void Btn_Rank_Click(object sender, EventArgs e)
        {
            ChangeExternThreeButtonForeColor(sender as Button);

            DownloadInfo di = new DownloadInfo(this);
            string[] aryStrCouponId = di.CouponTop();
            MyMsgBox mb = new MyMsgBox();

            if (aryStrCouponId.Length == 0)
            {
                mb.ShowMsg("排行榜暂时无数据!", 2);
                return;
            }

            LP_ctype[0] = FindCouponById(aryStrCouponId);
            curPage = 1;
            curType = 0;
            theCouponNum = 0;

            ShowCoupon();
        }
예제 #2
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();
        }
예제 #3
0
        private bool InitNearShopData()
        {
            if (LP_stype != null)
            {
                for (int i = 0; i < LP_stype.Length; i++)
                {
                    if (LP_stype[i] != null)
                    {
                        LP_stype[i].Clear();
                    }
                }
            }

            DownloadInfo di = new DownloadInfo(this);
            string[] aryStrShopId = di.ShopAround();
            MyMsgBox mb = new MyMsgBox();

            LP_stype = new List<PicInfo>[1];
            if (aryStrShopId.Length == 0)
            {
                LP_stype[0] = new List<PicInfo>();
                return false;
            }
            else
            {
                LP_stype[0] = FindShopById(aryStrShopId);
            }
            return true;
        }