Ejemplo n.º 1
0
 void srv_GetCurrenIssuNoCompleted(object sender, GetCurrenIssuNoCompletedEventArgs e)
 {
     if (e.Result == null)
     {
         return;
     }
     srv.GetOddsAsync(playtype, playTypeRadioId, e.Result.IssueNo);
 }
 void _srv_GetCurrenIssuNoCompleted(object sender, GetCurrenIssuNoCompletedEventArgs e)
 {
     LastRefreshTime = DateTime.Now;
     if (e.Result == null)
         return;
     this.tb_current_IssueNo.Text = e.Result.IssueNo.Length > 7 ? e.Result.IssueNo.Substring(2, e.Result.IssueNo.Length - 2) : e.Result.IssueNo;
     currentIssueNo = e.Result.IssueNo;
     //if (MainPage.TouzhuControl != null)
     //    MainPage.TouzhuControl.btBet.IsEnabled = true;
     if (MainPage.lotteryTypeAll == LotteryType.NSSC//绑定逆向赔率
         || MainPage.lotteryTypeAll == LotteryType.N3D
         || MainPage.lotteryTypeAll == LotteryType.NSSQ)
         _srv.GetOddsAsync(MainPage.playType, MainPage.playTypeRadio, currentIssueNo);
     App.Session[Constant.CURRENTISSUENO_SESSION] = e.Result;
     LotteryServiceClient srv = WcfProxy.GetProxy;
     //if (MainPage.TouzhuControl != null)
     //    MainPage.TouzhuControl.btBet.IsEnabled = false;
     srv.GetServerCurrentTimeAsync();
     srv.GetServerCurrentTimeCompleted += (s, er) =>
     {
         CurrentDateTime = er.Result.AddSeconds(-40);
         LotteryNumsInfo currentNums = App.Session[Constant.CURRENTISSUENO_SESSION] as LotteryNumsInfo;
         TimeSpan ts = (currentNums.LotteryDate - CurrentDateTime);
         if (ts.TotalSeconds <= 0)
         {
             MainPage.IsFengDan = true;
             timer_kaijiang.Interval = TimeSpan.FromSeconds(5);
             tb_kaijiang.Text = "正在开奖";
             tb_Last_IssueNo.Text = currentNums.IssueNo.Length > 7 ? currentNums.IssueNo.Substring(2, currentNums.IssueNo.Length - 2) : currentNums.IssueNo;
             gridLoading.Visibility = Visibility.Visible;
             border_Time.Visibility = Visibility.Collapsed;
             border_Nums.Visibility = Visibility.Collapsed;
         }
         else
         {
             MainPage.IsFengDan = false;
             timer_kaijiang.Interval = TimeSpan.FromSeconds(1);
             KaijiangBalls.size = BallSize;
             KaijiangBalls.LotteryNum = lotteryNums;//加载开奖结果(大球)
             //gridLoading.Visibility = Visibility.Collapsed;
             //border_Time.Visibility = Visibility.Visible;
             //border_Nums.Visibility = Visibility.Visible;
         }
         if (timer_kaijiang.IsEnabled == false)
         {
             timer_kaijiang_Tick(null, null);
             timer_kaijiang.Start();
         }
         SetLotteryTypeStatus(true);
     };
 }