Esempio n. 1
0
        /// <summary>
        /// 等待座位
        /// </summary>
        /// <returns></returns>
        public bool WaitSeat(SeatUC_ViewModel seatVM)
        {
            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))
            {
                PopupWindowsObject.GetInstance().Window.ShowMessage(TipType.WaitSeatWithSeat);
                return(false);
            }

            if (lastWaitInfo != null && lastWaitInfo.SeatWaitTime.AddMinutes(roomInfo.Setting.NoManagement.OperatingInterval).CompareTo(ServiceDateTime.Now) >= 0)
            {
                PopupWindowsObject.GetInstance().Window.ShowMessage(TipType.WaitSeatFrequent);
                return(false);
            }
            SeatLockState lockseat = T_SM_Seat.LockSeat(seatVM.LongSeatNo);

            if (lockseat != SeatLockState.Locked) //座位成功加锁
            {
                PopupWindowsObject.GetInstance().Window.ShowMessage(TipType.SeatLocking);
                return(false);
            }
            ClientObject.EnterOutLogData.WaitSeatLogModel = new WaitSeatLogInfo()
            {
                SeatNo = seatVM.ShortSeatNo
            };
            PopupWindowsObject.GetInstance().Window.ShowMessage(TipType.SetShortWarning);
            ClientObject.EnterOutLogData.WaitSeatLogModel = null;
            if (PopupWindowsObject.GetInstance().Window.ViewModel.OperateResule == HandleResult.Successed)
            {
                //初始化等待记录 记录ID需要待执行之后添加。
                WaitSeatLogInfo waitInfo = new WaitSeatLogInfo();
                waitInfo.CardNo       = ClientObject.EnterOutLogData.EnterOutlog.CardNo;
                waitInfo.NowState     = LogStatus.Valid;
                waitInfo.OperateType  = Operation.Reader;
                waitInfo.WaitingState = EnterOutLogType.Waiting;

                EnterOutLogInfo seatUsingEnterOutInfo = T_SM_EnterOutLog.GetUsingEnterOutLogBySeatNo(seatVM.LongSeatNo);
                seatUsingEnterOutInfo.EnterOutState = EnterOutLogType.ShortLeave;
                seatUsingEnterOutInfo.EnterOutType  = LogStatus.Valid;
                seatUsingEnterOutInfo.Flag          = 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;              //等待记录
                ClientObject.EnterOutLogData.FlowControl      = ClientOperation.WaitSeat;
                return(true);
            }
            else
            {
                T_SM_Seat.UnLockSeat(seatVM.LongSeatNo);//确认窗口点击取消或者自动关闭,则解锁。
                return(false);
            }
        }
Esempio n. 2
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);
        }
Esempio n. 3
0
        /// <summary>
        /// 读者等待座位
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void seatBtn_WaitSeat(object sender, MouseButtonEventArgs e)
        {
            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))
            {
                SeatManage.SeatClient.Tip.Tip_Framework tipForm = new SeatManage.SeatClient.Tip.Tip_Framework(SeatManage.EnumType.TipType.WaitSeatWithSeat, 7);
                countDownSeconds.Pause();
                tipForm.ShowDialog();
                countDownSeconds.Start();
                return;
            }

            if (lastWaitInfo != null && lastWaitInfo.SeatWaitTime.AddMinutes(roomInfo.Setting.NoManagement.OperatingInterval).CompareTo(ServiceDateTime.Now) >= 0)
            {
                SeatManage.SeatClient.Tip.Tip_Framework tipForm = new SeatManage.SeatClient.Tip.Tip_Framework(SeatManage.EnumType.TipType.WaitSeatFrequent, 7);
                countDownSeconds.Pause();
                tipForm.ShowDialog();
                countDownSeconds.Start();
                return;
            }
            SeatButton seatBtn = sender as SeatButton;

            SeatManage.EnumType.SeatLockState lockseat = T_SM_Seat.LockSeat(seatBtn.SeatNo);
            if (lockseat == SeatManage.EnumType.SeatLockState.Locked)//座位成功加锁
            {
                SetShortWarning warnForm = new SetShortWarning(seatBtn.ShortSeatNo);
                countDownSeconds.Pause();
                warnForm.ShowDialog();
                countDownSeconds.Start();
                if (warnForm.IsTrue)
                {
                    //初始化等待记录 记录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;              //等待记录
                    this.Hide();
                }
                else
                {
                    T_SM_Seat.UnLockSeat(seatBtn.SeatNo);//确认窗口点击取消或者自动关闭,则解锁。
                }
            }
            else if (lockseat == SeatManage.EnumType.SeatLockState.UnLock)                                                                                                                    //没有成功加锁
            {
                SeatManage.SeatClient.Tip.Tip_Framework tip = new SeatManage.SeatClient.Tip.Tip_Framework(SeatManage.EnumType.TipType.SeatLocking, frmResolution.ViewModel.CountDownSeconds); //显示提示窗体
                tip.ShowDialog();

                drowSeatLayout();
            }
        }