Start() public method

public Start ( ) : void
return void
Example #1
0
        private async void SetCountDown()
        {
            await Task.Delay(330);

            countDownForFiveSeconds = new CountDown(5000, 50, this, true);
            countDownForFiveSeconds.Start();
        }
Example #2
0
        /// <summary>
        /// 键盘选座
        /// </summary>
        /// <returns></returns>
        public bool KeyboardSelectSeat()
        {
            KeyboardWindow keyboardWindow = new KeyboardWindow();

            CountDown.Pause();
            keyboardWindow.ShowDialog();
            CountDown.Start();
            if (!string.IsNullOrEmpty(keyboardWindow.viewModel.SeatNo))
            {
                clientObject.EnterOutLogData.EnterOutlog.ShortSeatNo     = keyboardWindow.viewModel.SeatNo;
                clientObject.EnterOutLogData.EnterOutlog.ReadingRoomName = _ReadingRoomName;
                clientObject.EnterOutLogData.EnterOutlog.ReadingRoomNo   = _ReadingRoomNo;
                MessageWindow popWindow = new MessageWindow(SeatManage.EnumType.MessageType.SelectSeatConfirm);
                CountDown.Pause();
                popWindow.ShowDialog();
                CountDown.Start();
                if (popWindow.viewModel.OperateResule == SeatManage.EnumType.HandleResult.Successed)
                {
                    clientObject.EnterOutLogData.EnterOutlog.ReadingRoomName = _ReadingRoomName;
                    clientObject.EnterOutLogData.EnterOutlog.ReadingRoomNo   = _ReadingRoomNo;
                    clientObject.EnterOutLogData.EnterOutlog.SeatNo          = keyboardWindow.viewModel.LongSeatNo;
                    clientObject.EnterOutLogData.EnterOutlog.TerminalNum     = clientObject.ClientSetting.ClientNo;
                    clientObject.EnterOutLogData.FlowControl        = SeatManage.EnumType.ClientOperation.SelectSeat; //操作为选择座位
                    clientObject.EnterOutLogData.EnterOutlog.Remark = string.Format("在终端{0}输入座位号选择,{1},{2}号座位", clientObject.ClientSetting.ClientNo, clientObject.EnterOutLogData.Student.AtReadingRoom.Name, clientObject.EnterOutLogData.EnterOutlog.ShortSeatNo);
                    return(true);
                }
                else
                {
                    T_SM_Seat.UnLockSeat(keyboardWindow.viewModel.LongSeatNo);//确认窗口点击取消或者自动关闭,则解锁。
                }
            }
            return(false);
        }
Example #3
0
        private void SetGameItem()
        {
            _txtNumber.Text = string.Format("{0}/{1}", _cpt, _images.Count);
            _timer          = new CountDown(11000, 1000);
            _timer.Tick    += Timer_Tick;
            _timer.Finish  += _timer_Finish;
            _timer.Start();
            var names = DataEntryPoint.Instance.Images.GetOtherNames(_images[_cpt]);

            _image.SetImageURI(Android.Net.Uri.FromFile(new Java.IO.File(_images[_cpt].Path)));

            _currentItem = new GameItem();
            _currentItem.AddAnswer(_images[_cpt].Name, true);
            foreach (var item in names)
            {
                _currentItem.AddAnswer(item, false);
            }

            _currentItem.Shuffle();

            for (int i = 0; i < _currentItem.Answers.Count; i++)
            {
                _buttons[i].Text = _currentItem.Answers[i].Value;
            }
        }
Example #4
0
 public void IsStopped_ShouldReturnFalse_AfterDecreasedLessTimeThanFirstStarted()
 {
     var countDown = new CountDown();
     countDown.Start(5);
     countDown.Decrease(4);
     Assert.False(countDown.IsStopped);
 }
Example #5
0
        /// <summary>
        /// 选座座位
        /// </summary>
        /// <param name="seatBtn"></param>
        /// <returns></returns>
        public bool SelectSeat(UsuallySeatUC_ViewModel seatBtn)
        {
            ReadingRoomInfo roomInfo = SeatManage.Bll.T_SM_ReadingRoom.GetSingleRoomInfo(seatBtn.ReadingRoomNo);

            clientObject.EnterOutLogData.Student.AtReadingRoom = roomInfo;//给读者所在的阅览室赋值。

            //验证读者身份是否允许选择该阅览室。
            if (!Code.SelectSeatProven.ProvenReaderType(clientObject.EnterOutLogData.Student, roomInfo.Setting))
            {
                MessageWindow mesgWindow = new MessageWindow(MessageType.RoomNotReaderType);
                mesgWindow.ShowDialog();
                return(false);
            }
            //验证读者黑名单,选座次数。
            if (Code.SelectSeatProven.ProvenReaderState(clientObject.EnterOutLogData.Student, roomInfo, clientObject.RegulationRulesSet.BlacklistSet, clientObject.ClientSetting.DeviceSetting))
            {
                this.clientObject.EnterOutLogData.EnterOutlog.ReadingRoomNo = "";
                return(false);
            }
            SeatManage.EnumType.SeatLockState lockseat = T_SM_Seat.LockSeat(seatBtn.SeatNo);
            if (lockseat == SeatManage.EnumType.SeatLockState.Locked)//座位成功加锁
            {
                clientObject.EnterOutLogData.EnterOutlog.ShortSeatNo     = seatBtn.ShortSeatNo;
                clientObject.EnterOutLogData.EnterOutlog.ReadingRoomName = seatBtn.ReadingRoomName;
                MessageWindow mesgWindow = new MessageWindow(MessageType.SelectSeatConfirm);
                CountDown.Pause();
                mesgWindow.ShowDialog();
                CountDown.Start();
                if (mesgWindow.viewModel.OperateResule == SeatManage.EnumType.HandleResult.Successed)
                {
                    clientObject.EnterOutLogData.EnterOutlog.ReadingRoomName = seatBtn.ReadingRoomName;
                    clientObject.EnterOutLogData.EnterOutlog.ReadingRoomNo   = seatBtn.ReadingRoomNo;
                    clientObject.EnterOutLogData.EnterOutlog.SeatNo          = seatBtn.SeatNo;
                    clientObject.EnterOutLogData.EnterOutlog.ShortSeatNo     = seatBtn.ShortSeatNo;
                    clientObject.EnterOutLogData.EnterOutlog.TerminalNum     = clientObject.ClientSetting.ClientNo;
                    clientObject.EnterOutLogData.FlowControl        = SeatManage.EnumType.ClientOperation.SelectSeat; //操作为选择座位
                    clientObject.EnterOutLogData.EnterOutlog.Remark = string.Format("在终端{0}选择常坐座位,{1},{2}号座位", clientObject.ClientSetting.ClientNo, clientObject.EnterOutLogData.Student.AtReadingRoom.Name, seatBtn.ShortSeatNo);
                    return(true);
                }
                else
                {
                    T_SM_Seat.UnLockSeat(seatBtn.SeatNo);//确认窗口点击取消或者自动关闭,则解锁。
                }
            }
            else if (lockseat == SeatManage.EnumType.SeatLockState.UnLock)//没有成功加锁
            {
                MessageWindow mesgWindow = new MessageWindow(MessageType.SeatIsLocked);
                CountDown.Pause();
                mesgWindow.ShowDialog();
                CountDown.Start();
            }
            else if (lockseat == SeatManage.EnumType.SeatLockState.NotExists)
            {
                MessageWindow mesgWindow = new MessageWindow(MessageType.SeatNotExist);
                CountDown.Pause();
                mesgWindow.ShowDialog();
                CountDown.Start();
            }
            return(false);
        }
Example #6
0
        private void ValidateBeforeStartCountdown(Tuple <String, DateTime> data)
        {
            if (data.Item1 == "")
            {
                if (!Tommorow)
                {
                    Tommorow = true;
                }

                //parsing waktu
                var end = timeController.BuildDate($"{TimeHelper.GetTommorowDateWithUSFormat()} {waktuShalat.subuh}");

                LblNamaShalat.Text = "subuh";
                LblJam.Text        = waktuShalat.subuh;

                timeController.StartCountdown(end);

                CountDown.Start();
            }
            else
            {
                LblNamaShalat.Text = data.Item1;
                LblJam.Text        = data.Item2.ToString("HH:mm");

                DateTime EndTime = data.Item2;

                timeController.StartCountdown(EndTime);

                CountDown.Start();
            }
        }
Example #7
0
 public void IsStopped_ShouldReturnFalse_AfterStarted()
 {
     var countDown = new CountDown();
     countDown.Start(5);
     Assert.IsFalse(countDown.IsStopped);
     
 }
        public void ShowQuestion(int v)
        {
            if (index < totalQuestion)
            {
                thisQuestion++;
                txtQuestionNo.Text = $"{thisQuestion} / {totalQuestion}";

                btnA.Text = questions[index].AnswerA;
                btnB.Text = questions[index].AnswerB;
                btnC.Text = questions[index].AnswerC;
                btnD.Text = questions[index].AnswerD;

                mCountDown.Start();
            }

            else
            {
                Intent intent   = new Intent(this, typeof(FinishQuiz));
                Bundle dataSend = new Bundle();
                dataSend.PutInt("Score", score);
                dataSend.PutInt("Total", totalQuestion);
                dataSend.PutInt("Correct", correctAnswer);

                intent.PutExtras(dataSend);
                StartActivity(intent);
            }
        }
Example #9
0
        private void bntStart_Click(object sender, EventArgs e)
        {
            CountDown.Start();

            bntStart.Enabled = false;
            bntGate.Enabled  = false;

            lbStripStatus.Text = "COUNT DOWN";
        }
Example #10
0
        public void Start(IsInCountdownPeriodResult countdownPeriodResult)
        {
            CountDown.Start(countdownPeriodResult.SecondsOffset);

            var model = (CountdownTimerViewModel)DataContext;

            model.Congregation       = countdownPeriodResult.MeetingStartTime.Congregation;
            model.MeetingDescription = countdownPeriodResult.MeetingStartTime.MeetingDescription;
        }
Example #11
0
        static void Main(string[] args)
        {
            CountDown countdown = new CountDown(600);

            countdown.Start();
            Console.WriteLine("time : " + countdown.RemainingTime);
            System.Threading.Thread.Sleep(5000);
            Console.WriteLine("time2 : " + countdown.RemainingTime);
        }
		protected override void OnCreate (Bundle bundle)
		{
			base.OnCreate (bundle);
			SetContentView (Resource.Layout.Splash);

			MainScreen actMain = new MainScreen ();

			CountDown tik= new CountDown (5000,5000,this,actMain);
			tik.Start ();
			StartAnimation();

		}
Example #13
0
 private void RoomSeatWindow_SelectSeat(object sender, EventArgs e)
 {
     CountDown.Pause();
     if (SelectSeat(sender as SeatUC_ViewModel))
     {
         if (RoomWindowClose != null)
         {
             RoomWindowClose(this, new EventArgs());
         }
     }
     else
     {
         CountDown.Start();
     }
 }
Example #14
0
 private void SetTextSub()
 {
     if (Visibility == Android.Views.ViewStates.Visible && counterTextViewModel.future > 0)
     {
         CloseTimer();
         counterTextViewModel.CounterEnd = false;
         CountDownTimer       = new CountDown(counterTextViewModel.future, counterTextViewModel.interval);
         CountDownTimer.Tick += (long millisUntilFinished) => {
             try
             {
                 MillisUntilFinished = millisUntilFinished;
                 lastnumber          = lastnumber + counterTextViewModel.progression;
                 Text = lastnumber.ToString();
                 if (lastnumber == counterTextViewModel.stop)
                 {
                     SendEvent();
                     StopCountDown();
                     Text = !string.IsNullOrEmpty(counterTextViewModel.StopText) ? counterTextViewModel.StopText : counterTextViewModel.stop == fixedStop?lastnumber.ToString() : counterTextViewModel.stop.ToString();
                 }
             }
             catch (Exception ex)
             {
                 Console.WriteLine("CounterTextView:TextViewCounter:SetText:" + ex.Message);
             }
         };
         CountDownTimer.Finish += () => {
             try
             {
                 SendEvent();
                 if (!counterTextViewModel.repeat)
                 {
                     Text = !string.IsNullOrEmpty(counterTextViewModel.StopText) ? counterTextViewModel.StopText : counterTextViewModel.stop == fixedStop?lastnumber.ToString() : counterTextViewModel.stop.ToString();
                 }
                 else
                 {
                     SetText();
                 }
             }
             catch (Exception ex)
             {
                 Console.WriteLine("CounterTextView:TextViewCounter:SetText:" + ex.Message);
             }
         };
         CountDownTimer.Start();
     }
 }
Example #15
0
 public void IsStopped_ShouldReturnTrue_AfterDecreasedMoreTimeThanFirstStarted()
 {
     {
         var countDown = new CountDown();
         countDown.Start(5);
         countDown.Decrease(5);
         Assert.IsTrue(countDown.IsStopped);
     }
     {
         var countDown = new CountDown();
         countDown.Start(5);
         countDown.Decrease(2);
         countDown.Decrease(2);
         countDown.Decrease(2);
         Assert.IsTrue(countDown.IsStopped);
     }
 }
Example #16
0
 /// <summary>
 /// 选座座位
 /// </summary>
 /// <param name="seatBtn"></param>
 /// <returns></returns>
 public bool SelectSeat(SeatButton seatBtn)
 {
     SeatManage.EnumType.SeatLockState lockseat = T_SM_Seat.LockSeat(seatBtn.SeatNo);
     if (lockseat == SeatManage.EnumType.SeatLockState.Locked)//座位成功加锁
     {
         clientObject.EnterOutLogData.EnterOutlog.ShortSeatNo     = seatBtn.ShortSeatNo;
         clientObject.EnterOutLogData.EnterOutlog.ReadingRoomName = _ReadingRoomName;
         clientObject.EnterOutLogData.EnterOutlog.ReadingRoomNo   = _ReadingRoomNo;
         MessageWindow popWindow = new MessageWindow(SeatManage.EnumType.MessageType.SelectSeatConfirm);
         CountDown.Pause();
         popWindow.ShowDialog();
         CountDown.Start();
         if (popWindow.viewModel.OperateResule == SeatManage.EnumType.HandleResult.Successed)
         {
             clientObject.EnterOutLogData.EnterOutlog.ReadingRoomName = _ReadingRoomName;
             clientObject.EnterOutLogData.EnterOutlog.ReadingRoomNo   = _ReadingRoomNo;
             clientObject.EnterOutLogData.EnterOutlog.SeatNo          = seatBtn.SeatNo;
             clientObject.EnterOutLogData.EnterOutlog.ShortSeatNo     = seatBtn.ShortSeatNo;
             clientObject.EnterOutLogData.EnterOutlog.TerminalNum     = clientObject.ClientSetting.ClientNo;
             clientObject.EnterOutLogData.FlowControl        = SeatManage.EnumType.ClientOperation.SelectSeat; //操作为选择座位
             clientObject.EnterOutLogData.EnterOutlog.Remark = string.Format("在终端{0}手动选择,{1},{2}号座位", clientObject.ClientSetting.ClientNo, clientObject.EnterOutLogData.Student.AtReadingRoom.Name, seatBtn.ShortSeatNo);
             RoomSelectSeatMethod = SeatManage.EnumType.SelectSeatMode.ManualMode;
             return(true);
         }
         else
         {
             T_SM_Seat.UnLockSeat(seatBtn.SeatNo);//确认窗口点击取消或者自动关闭,则解锁。
         }
     }
     else if (lockseat == SeatManage.EnumType.SeatLockState.UnLock)//没有成功加锁
     {
         MessageWindow popWindow = new MessageWindow(SeatManage.EnumType.MessageType.SeatIsLocked);
         CountDown.Pause();
         popWindow.ShowDialog();
         CountDown.Start();
     }
     else if (lockseat == SeatManage.EnumType.SeatLockState.NotExists)
     {
         MessageWindow popWindow = new MessageWindow(SeatManage.EnumType.MessageType.SeatNotExist);
         CountDown.Pause();
         popWindow.ShowDialog();
         CountDown.Start();
     }
     return(false);
 }
Example #17
0
    // Update is called once per frame
    void Update()
    {
        if (Input.GetMouseButtonDown(0))
        { // if left button pressed...
            Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
            RaycastHit hit;
            if (Physics.Raycast(ray, out hit))
            {
                var selecatbeObject = hit.collider.gameObject.GetComponent<Selectable>();

                if (hit.collider.gameObject.layer != Layers.SelectField)
                    return;

                if (selecatbeObject != null)
                {
                    selecatbeObject.Select();
                    _CountDown = CountDown.CreateCountDown(0.5f);
                    _CountDown.Start();
                    _CountDown.TimeElapsed += (sender, args) =>
                    {
                        if(selecatbeObject != null)
                            selecatbeObject.HighLight();
                        else
                        Selector.Instance.Unselect();

                        _CountDown = null;
                    };
                }
                else
                    Selector.Instance.Unselect();
            }
            else
                Selector.Instance.Unselect();
        }

        if (Input.GetMouseButtonUp(0))
        {
            if (_CountDown != null)
                _CountDown.Stop();
            _CountDown = null;
        }
    }
Example #18
0
 public void Start(int offsetSeconds)
 {
     CountDown.Start(offsetSeconds);
 }
Example #19
0
        /// <summary>
        /// 等待座位
        /// </summary>
        /// <returns></returns>
        public bool WaitSeat(SeatButton seatBtn)
        {
            WaitSeatLogInfo lastWaitInfo = T_SM_SeatWaiting.GetListWaitLogByCardNo(clientObject.EnterOutLogData.EnterOutlog.CardNo, clientObject.EnterOutLogData.EnterOutlog.ReadingRoomNo);
            ReadingRoomInfo roomInfo     = clientObject.EnterOutLogData.Student.AtReadingRoom;


            if (!string.IsNullOrEmpty(clientObject.EnterOutLogData.EnterOutlog.SeatNo))
            {
                MessageWindow popWindow = new MessageWindow(SeatManage.EnumType.MessageType.WaitSeatWithSeat);
                CountDown.Pause();
                popWindow.ShowDialog();
                CountDown.Start();
                return(false);
            }

            if (lastWaitInfo != null && lastWaitInfo.SeatWaitTime.AddMinutes(roomInfo.Setting.NoManagement.OperatingInterval).CompareTo(ServiceDateTime.Now) >= 0)
            {
                clientObject.EnterOutLogData.Student.WaitSeatLog = lastWaitInfo;
                MessageWindow popWindow = new MessageWindow(SeatManage.EnumType.MessageType.WaitSeatFrequent);
                CountDown.Pause();
                popWindow.ShowDialog();
                CountDown.Start();
                return(false);
            }
            SeatManage.EnumType.SeatLockState lockseat = T_SM_Seat.LockSeat(seatBtn.SeatNo);
            if (lockseat == SeatManage.EnumType.SeatLockState.Locked)//座位成功加锁
            {
                clientObject.EnterOutLogData.WaitSeatLogModel = new WaitSeatLogInfo()
                {
                    SeatNo = seatBtn.ShortSeatNo
                };
                MessageWindow popWindow = new MessageWindow(SeatManage.EnumType.MessageType.WaitSeatConfirm);
                CountDown.Pause();
                popWindow.ShowDialog();
                CountDown.Start();
                if (popWindow.viewModel.OperateResule == SeatManage.EnumType.HandleResult.Successed)
                {
                    //初始化等待记录 记录ID需要待执行之后添加。
                    WaitSeatLogInfo waitInfo = new WaitSeatLogInfo();
                    waitInfo.CardNo       = clientObject.EnterOutLogData.EnterOutlog.CardNo;
                    waitInfo.NowState     = SeatManage.EnumType.LogStatus.Valid;
                    waitInfo.OperateType  = SeatManage.EnumType.Operation.Reader;
                    waitInfo.WaitingState = SeatManage.EnumType.EnterOutLogType.Waiting;

                    EnterOutLogInfo seatUsingEnterOutInfo = SeatManage.Bll.T_SM_EnterOutLog.GetUsingEnterOutLogBySeatNo(seatBtn.SeatNo);
                    seatUsingEnterOutInfo.EnterOutState = SeatManage.EnumType.EnterOutLogType.ShortLeave;
                    seatUsingEnterOutInfo.EnterOutType  = SeatManage.EnumType.LogStatus.Valid;
                    seatUsingEnterOutInfo.Flag          = SeatManage.EnumType.Operation.OtherReader;
                    seatUsingEnterOutInfo.TerminalNum   = clientObject.ClientSetting.ClientNo;
                    seatUsingEnterOutInfo.Remark        = string.Format("在{0} {1}号座位,被读者{2}在终端{3}设置为暂离并等待该座位", seatUsingEnterOutInfo.ReadingRoomName, seatUsingEnterOutInfo.ShortSeatNo, waitInfo.CardNo, clientObject.ClientSetting.ClientNo);

                    clientObject.EnterOutLogData.EnterOutlog      = seatUsingEnterOutInfo; //要等待读者的暂离记录
                    clientObject.EnterOutLogData.WaitSeatLogModel = waitInfo;              //等待记录

                    return(true);
                }
                else
                {
                    T_SM_Seat.UnLockSeat(seatBtn.SeatNo);//确认窗口点击取消或者自动关闭,则解锁。
                }
            }
            else if (lockseat == SeatManage.EnumType.SeatLockState.UnLock)//没有成功加锁
            {
                MessageWindow popWindow = new MessageWindow(SeatManage.EnumType.MessageType.SeatIsLocked);
                CountDown.Pause();
                popWindow.ShowDialog();
                CountDown.Start();
            }
            return(false);
        }
        /// <summary>
        /// 确认座位号
        /// </summary>
        /// <returns></returns>
        public bool CheckSeatNumber()
        {
            if (string.IsNullOrEmpty(SeatNo))
            {
                MessageWindow popWindow = new MessageWindow(SeatManage.EnumType.MessageType.SeatNotExist);
                CountDown.Pause();
                popWindow.ShowDialog();
                CountDown.Start();
                return(false);
            }
            _LongSeatNo = "";
            ReadingRoomInfo roomInfo   = Clientobject.EnterOutLogData.Student.AtReadingRoom;
            string          roomNo     = roomInfo.No + "000";
            string          seatHeader = SeatComm.SeatNoToSeatNoHeader(roomInfo.Setting.SeatNumAmount, roomNo);

            _LongSeatNo = seatHeader + SeatNo;
            //获取座位信息,并判断座位在该阅览室是否存在。
            Seat seat = T_SM_Seat.GetSeatInfoBySeatNo(_LongSeatNo);

            if (seat == null)
            {
                MessageWindow popWindow = new MessageWindow(SeatManage.EnumType.MessageType.SeatNotExist);
                CountDown.Pause();
                popWindow.ShowDialog();
                CountDown.Start();
                return(false);
            }
            if (seat.IsSuspended)
            {
                MessageWindow popWindow = new MessageWindow(SeatManage.EnumType.MessageType.SeatIsStopping);
                CountDown.Pause();
                popWindow.ShowDialog();
                CountDown.Start();
                return(false);
            }
            if (seat.ReadingRoomNum != roomInfo.No)
            {
                MessageWindow popWindow = new MessageWindow(SeatManage.EnumType.MessageType.SeatNotExist);
                CountDown.Pause();
                popWindow.ShowDialog();
                CountDown.Start();
                return(false);
            }

            SeatManage.EnumType.EnterOutLogType logType = SeatManage.Bll.T_SM_EnterOutLog.GetSeatUsedState(_LongSeatNo);

            //TODO:还需检测座位是否被预约 SeatManage.Bll.T_SM_EnterOutLog
            if (logType == SeatManage.EnumType.EnterOutLogType.None || logType == SeatManage.EnumType.EnterOutLogType.Leave)
            {
                //根据座位号获取进出记录的状态,如果为None或者为Leave,则锁定座位
                SeatManage.EnumType.SeatLockState lockResult = SeatManage.Bll.T_SM_Seat.LockSeat(_LongSeatNo);
                if (lockResult == SeatManage.EnumType.SeatLockState.NotExists)
                {
                    MessageWindow popWindow = new MessageWindow(SeatManage.EnumType.MessageType.SeatNotExist);
                    CountDown.Pause();
                    popWindow.ShowDialog();
                    CountDown.Start();
                    return(false);
                }
                else if (lockResult == SeatManage.EnumType.SeatLockState.UnLock)
                {
                    MessageWindow popWindow = new MessageWindow(SeatManage.EnumType.MessageType.SeatIsUsing);
                    CountDown.Pause();
                    popWindow.ShowDialog();
                    CountDown.Start();
                    return(false);
                }
                else if (lockResult == SeatManage.EnumType.SeatLockState.Locked)
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            else if (logType == SeatManage.EnumType.EnterOutLogType.BespeakWaiting)
            {
                MessageWindow popWindow = new MessageWindow(SeatManage.EnumType.MessageType.SeatIsUsing);
                CountDown.Pause();
                popWindow.ShowDialog();
                CountDown.Start();
                return(false);
            }
            else
            {
                MessageWindow popWindow = new MessageWindow(SeatManage.EnumType.MessageType.SeatIsUsing);
                CountDown.Pause();
                popWindow.ShowDialog();
                CountDown.Start();
                return(false);
            }
            //}
            //else
            //{
            //    toolTip1.SetToolTip(txtSeatNo, "请输入最后四位座位号");
            //    toolTip1.Show("请输入座位号",txtSeatNo,5000);
            //}
        }
Example #21
0
 private void button1_Click_1(object sender, EventArgs e)
 {
     CountDown.Start();
 }
Example #22
0
        /// <summary>
        /// 选择预约的座位
        /// </summary>
        /// <param name="seatBtn"></param>
        /// <returns></returns>
        public bool SelectBookingSeat(SeatButton seatBtn)
        {
            DateTime datetimeNow = SeatManage.Bll.ServiceDateTime.Now;
            List <SeatManage.ClassModel.BespeakLogInfo> bespeakLogList = SeatManage.Bll.T_SM_SeatBespeak.GetBespeakLogInfoBySeatNo(seatBtn.SeatNo, datetimeNow.Date);

            if (bespeakLogList.Count > 0)
            {
                if (bespeakLogList[0].BsepeakTime.AddMinutes(-double.Parse(clientObject.EnterOutLogData.Student.AtReadingRoom.Setting.SeatBespeak.ConfirmTime.BeginTime)) <= datetimeNow)
                {
                    MessageWindow popWindow = new MessageWindow(SeatManage.EnumType.MessageType.SeatIsBespaeked);
                    CountDown.Pause();
                    popWindow.ShowDialog();
                    CountDown.Start();
                    return(false);
                }
                else
                {
                    clientObject.EnterOutLogData.BespeakLogInfo = bespeakLogList[0];
                    MessageWindow popWindow = new MessageWindow(SeatManage.EnumType.MessageType.SelectBespeakSeatConfrim);
                    CountDown.Pause();
                    popWindow.ShowDialog();
                    CountDown.Start();
                    if (popWindow.viewModel.OperateResule == SeatManage.EnumType.HandleResult.Failed)
                    {
                        clientObject.EnterOutLogData.BespeakLogInfo = null;
                        return(false);
                    }
                }
            }
            else
            {
                SeatManage.EnumType.SeatLockState lockseat = T_SM_Seat.LockSeat(seatBtn.SeatNo);
                if (lockseat == SeatManage.EnumType.SeatLockState.Locked)//座位成功加锁
                {
                    clientObject.EnterOutLogData.EnterOutlog.ShortSeatNo     = seatBtn.ShortSeatNo;
                    clientObject.EnterOutLogData.EnterOutlog.ReadingRoomName = _ReadingRoomName;
                    clientObject.EnterOutLogData.EnterOutlog.ReadingRoomNo   = _ReadingRoomNo;
                    MessageWindow popWindow = new MessageWindow(SeatManage.EnumType.MessageType.SelectBespeakSeatConfrim);
                    CountDown.Pause();
                    popWindow.ShowDialog();
                    CountDown.Start();

                    if (popWindow.viewModel.OperateResule == SeatManage.EnumType.HandleResult.Failed)
                    {
                        T_SM_Seat.UnLockSeat(seatBtn.SeatNo);//确认窗口点击取消或者自动关闭,则解锁。
                        return(false);
                    }
                }
                else if (lockseat == SeatManage.EnumType.SeatLockState.UnLock)//没有成功加锁
                {
                    MessageWindow popWindow = new MessageWindow(SeatManage.EnumType.MessageType.SeatIsLocked);
                    CountDown.Pause();
                    popWindow.ShowDialog();
                    CountDown.Start();
                    return(false);
                }
                else if (lockseat == SeatManage.EnumType.SeatLockState.NotExists)
                {
                    MessageWindow popWindow = new MessageWindow(SeatManage.EnumType.MessageType.SeatNotExist);
                    CountDown.Pause();
                    popWindow.ShowDialog();
                    CountDown.Start();
                    return(false);
                }
            }
            clientObject.EnterOutLogData.EnterOutlog.ReadingRoomName = _ReadingRoomName;
            clientObject.EnterOutLogData.EnterOutlog.ReadingRoomNo   = _ReadingRoomNo;
            clientObject.EnterOutLogData.EnterOutlog.SeatNo          = seatBtn.SeatNo;
            clientObject.EnterOutLogData.EnterOutlog.ShortSeatNo     = seatBtn.ShortSeatNo;
            clientObject.EnterOutLogData.EnterOutlog.TerminalNum     = clientObject.ClientSetting.ClientNo;
            clientObject.EnterOutLogData.FlowControl        = SeatManage.EnumType.ClientOperation.SelectSeat; //操作为选择座位
            clientObject.EnterOutLogData.EnterOutlog.Remark = string.Format("在终端{0}手动选择,{1},{2}号座位", clientObject.ClientSetting.ClientNo, clientObject.EnterOutLogData.Student.AtReadingRoom.Name, seatBtn.ShortSeatNo);
            return(true);
        }
Example #23
0
 private void CreateFailedCountDown()
 {
     countDownForFailed = new CountDown(60000, 1000, this, false);
     countDownForFailed.Start();
 }