private void Btn_UploadCenter_Click(object sender, RoutedEventArgs e)
        {
            MatchInfo?matchInfo = this.cmb_game.SelectedItem as MatchInfo?;

            if (matchInfo != null)
            {
                SubBaseForm sb = new SubBaseForm("正在同步比赛数据,请稍候...");
                SubBaseForm.DelegateHasParmAndNonReturn my = new SubBaseForm.DelegateHasParmAndNonReturn(UploadData);
                sb.HasParmAndNonReturnMethod(my, matchInfo.Value.SessionId);
            }
            else
            {
                MessageBox.Show("请选择比赛场次");
            }
        }
示例#2
0
 private void SelectMatch_OnClick(object sender, MatchInfo e)
 {
     if (Mode == 8)
     {
         SubBaseForm sb = new SubBaseForm("正在加载白名单人员数据,请稍候...");
         SubBaseForm.DelegateHasParmAndNonReturn my = new SubBaseForm.DelegateHasParmAndNonReturn(searchData);
         sb.HasParmAndNonReturnMethod(my, e.SessionId);
     }
     if (_faceModel != null)
     {
         _faceModel.MyMatch = e;
         MyGrid.Children.Add(_faceModel);
         _faceModel.Init();
     }
     SelectControl.Visibility = Visibility.Hidden;
 }
        /// <summary>窗体加载</summary>
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            try
            {
                VerText.Text = string.Format("版本号:{0}", Assembly.GetExecutingAssembly().GetName().Version);
                if (IrAdvanced.CheckRegisterState) //必须注册,否则IrControlLibrary中可能有部分方法无法使用
                {
                    WelcomeText.Text = "程序加载中...\n设备号:" + IrAdvanced.StrDeviceId;
                    TurnToMainWindows();

                    MessageBoxResult result = MessageBox.Show("是否同步比赛数据", "提示", MessageBoxButton.YesNo);
                    if (result == MessageBoxResult.Yes)
                    {
                        SubBaseForm sb = new SubBaseForm("正在同步比赛数据,请稍候...");
                        SubBaseForm.DelegateNonParmAndNonReturn my = new SubBaseForm.DelegateNonParmAndNonReturn(synchronizeData);
                        sb.NonParmAndNonReturnMethod(my);
                    }

                    result = MessageBox.Show("是否开启数据上传至公安服务", "提示", MessageBoxButton.YesNo);
                    if (result == MessageBoxResult.Yes)
                    {
                        bool is_AutoUpload = ConfigurationManager.AppSettings["Is_AutoUpload"].ToBool();
                        if (is_AutoUpload)
                        {
                            Thread thread = new Thread(Upload)
                            {
                                IsBackground = true
                            };
                            thread.Start();
                        }
                    }
                }
                else
                {
                    WelcomeText.Text = string.Format("程序未注册,请与供应商联系!\n设备号:{0}", IrAdvanced.StrDeviceId);
                }
            }
            catch (Exception ex)
            {
                IrAdvanced.WriteError("FrmMain.Window_Loaded:" + ex.Message);
            }
        }