Ejemplo n.º 1
0
 /// <summary>
 /// 定时器
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void Timer_MouseMove_Tick(object sender, EventArgs e)
 {
     try
     {
         if (!MouseMonitorHelper.HaveUsedTo())
         {
             MouseMonitorHelper.CheckCount++;
             if (MouseMonitorHelper.CheckCount == 3)
             {
                 this.Timer_MouseMove.Stop();
                 this.PageView.Visibility  = Visibility.Hidden;
                 this.FrameView.Visibility = Visibility.Visible;
                 this.FramePage.Visibility = Visibility.Visible;
                 LicensePlateControl lp = GetLastUnDeleteLicensePlateControl();
                 if (lp != null)
                 {
                     lp.ColseLicensePlate();
                 }
                 IndexPage indexPage = new IndexPage();
                 this.NavigationService.Navigate(indexPage, dic);
                 this.NavigationService.LoadCompleted += indexPage.NavigationService_LoadCompleted;
                 this.FramePage.Content = indexPage;
             }
         }
         else
         {
             MouseMonitorHelper.CheckCount = 0;
         }
     }
     catch
     {
         throw new NotImplementedException();
     }
 }
Ejemplo n.º 2
0
        /// <summary>
        /// 继续添加车牌
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void CardAddBtn_PreviewMouseDown(object sender, MouseButtonEventArgs e)
        {
            //获取当前添加的车牌
            LicensePlateControl lp = GetLastUnDeleteLicensePlateControl();

            if (lp == null)//删没了
            {
                AddNewLicensePlateControl();
                return;
            }
            else
            {
                bool isCheckSucceed = CheckLicensePlate(lp); //检测是否可绑定

                if (isCheckSucceed)
                {
                    lp.LicensePlateInput.IsEnabled = false;
                    lp.SucceedMsg.Visibility       = Visibility.Visible;

                    AddNewLicensePlateControl();
                    lp.ColseLicensePlate();
                    return;
                }
                else
                {
                    lp.ErrMsg.Visibility = Visibility.Visible;
                    return;
                }
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 返回首页
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void BackBtn_PreviewMouseDown(object sender, MouseButtonEventArgs e)
        {
            this.Timer_MouseMove.Stop();
            this.PageView.Visibility  = Visibility.Hidden;
            this.FrameView.Visibility = Visibility.Visible;
            this.FramePage.Visibility = Visibility.Visible;
            LicensePlateControl lp = GetLastUnDeleteLicensePlateControl();

            if (lp != null)
            {
                lp.ColseLicensePlate();
            }
            IndexPage indexPage = new IndexPage();

            this.NavigationService.Navigate(indexPage, dic);
            this.NavigationService.LoadCompleted += indexPage.NavigationService_LoadCompleted;
            this.FramePage.Content = indexPage;
        }
Ejemplo n.º 4
0
        /// <summary>
        /// 车牌绑定
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void CardBindBtn_PreviewMouseDown(object sender, MouseButtonEventArgs e)
        {
            //获取当前添加的车牌
            LicensePlateControl lp = GetLastUnDeleteLicensePlateControl();

            if (lp != null)
            {
                bool   isCheckSucceed   = CheckLicensePlate(lp);
                string lastLicensePlate = lp.GetLicensePlate();
                if (isCheckSucceed)
                {
                    lp.IsEnabled             = false;
                    lp.SucceedMsg.Visibility = Visibility.Visible;
                    var unDel = LicensePlateControlList.Where(it => it.isDelete == false);
                    foreach (var item in unDel)
                    {
                        LicensePlateList.Add(item.GetLicensePlate());
                    }
                    BackEnd.ParkBackEnd parkBackEnd = new BackEnd.ParkBackEnd();
                    //调用批量绑定接口进行绑定操作
                    string bingResult = parkBackEnd.AddCardNosBind(LicensePlateList, cardBindInfo.MerchantToken);
                    if (bingResult.StartsWith("SUCCESS"))  //全部绑定成功
                    {
                        lp.ColseLicensePlate();
                        string[] time = bingResult.Split(new char[] { ',' });
                        CheckSucceed(time[1], time[2]);
                    }
                    else if (bingResult == "") //未知错误
                    {
                        TbErrorMsg.Text = "网络异常,10秒后返回首页";
                    }
                    else //有失败的车牌,暂时不处理
                    {
                    }
                }
                else
                {
                    lp.ErrMsg.Visibility = Visibility.Visible;
                    return;
                }
            }
        }