Beispiel #1
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);
        }
Beispiel #2
0
 /// <summary>
 /// 键盘选座
 /// </summary>
 /// <returns></returns>
 public bool KeyboardSelectSeat()
 {
     KeyboardWindowObject.GetInstance().Window.ShowMessage();
     if (string.IsNullOrEmpty(KeyboardWindowObject.GetInstance().Window.ViewModel.SeatNo))
     {
         return(false);
     }
     ClientObject.EnterOutLogData.EnterOutlog.ShortSeatNo     = KeyboardWindowObject.GetInstance().Window.ViewModel.SeatNo;
     ClientObject.EnterOutLogData.EnterOutlog.ReadingRoomName = _ReadingRoomName;
     ClientObject.EnterOutLogData.EnterOutlog.ReadingRoomNo   = _ReadingRoomNo;
     PopupWindowsObject.GetInstance().Window.ShowMessage(TipType.SelectSeatConfinmed);
     if (PopupWindowsObject.GetInstance().Window.ViewModel.OperateResule == HandleResult.Successed)
     {
         ClientObject.EnterOutLogData.EnterOutlog.SeatNo      = KeyboardWindowObject.GetInstance().Window.ViewModel.LongSeatNo;
         ClientObject.EnterOutLogData.EnterOutlog.TerminalNum = ClientObject.ClientSetting.ClientNo;
         ClientObject.EnterOutLogData.EnterOutlog.Remark      = string.Format("在终端{0}输入座位号选择,{1},{2}号座位", ClientObject.ClientSetting.ClientNo, ClientObject.EnterOutLogData.Student.AtReadingRoom.Name, ClientObject.EnterOutLogData.EnterOutlog.ShortSeatNo);
         ClientObject.EnterOutLogData.FlowControl             = ClientOperation.SelectSeat; //操作为选择座位
         return(true);
     }
     else
     {
         T_SM_Seat.UnLockSeat(KeyboardWindowObject.GetInstance().Window.ViewModel.LongSeatNo);//确认窗口点击取消或者自动关闭,则解锁。
         return(false);
     }
 }
Beispiel #3
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);
        }
Beispiel #4
0
        /// <summary>
        /// 选座座位
        /// </summary>
        /// <param name="seatBtn"></param>
        /// <returns></returns>
        public bool SelectSeat(SeatUC_ViewModel seatVM)
        {
            SeatLockState lockseat = T_SM_Seat.LockSeat(seatVM.LongSeatNo);

            if (lockseat != SeatLockState.Locked)
            {
                PopupWindowsObject.GetInstance().Window.ShowMessage(TipType.SeatLocking);
                return(false);
            }
            ClientObject.EnterOutLogData.EnterOutlog.ShortSeatNo     = seatVM.ShortSeatNo;
            ClientObject.EnterOutLogData.EnterOutlog.ReadingRoomName = _ReadingRoomName;
            ClientObject.EnterOutLogData.EnterOutlog.ReadingRoomNo   = _ReadingRoomNo;
            PopupWindowsObject.GetInstance().Window.ShowMessage(TipType.SelectSeatConfinmed);
            if (PopupWindowsObject.GetInstance().Window.ViewModel.OperateResule == HandleResult.Successed)
            {
                ClientObject.EnterOutLogData.EnterOutlog.SeatNo      = seatVM.LongSeatNo;
                ClientObject.EnterOutLogData.EnterOutlog.ShortSeatNo = seatVM.ShortSeatNo;
                ClientObject.EnterOutLogData.EnterOutlog.TerminalNum = ClientObject.ClientSetting.ClientNo;
                ClientObject.EnterOutLogData.FlowControl             = ClientOperation.SelectSeat; //操作为选择座位
                ClientObject.EnterOutLogData.EnterOutlog.Remark      = string.Format("在终端{0}手动选择,{1},{2}号座位", ClientObject.ClientSetting.ClientNo, ClientObject.EnterOutLogData.Student.AtReadingRoom.Name, seatVM.ShortSeatNo);
                ClientObject.EnterOutLogData.FlowControl             = ClientOperation.SelectSeat;
                return(true);
            }
            else
            {
                T_SM_Seat.UnLockSeat(seatVM.LongSeatNo); //确认窗口点击取消或者自动关闭,则解锁。
                return(false);
            }
        }
Beispiel #5
0
        private void btnKeyboard_Click(object sender, RoutedEventArgs e)
        {
            NoKeyboard kb = new NoKeyboard(frmResolution.ViewModel.CountDownSeconds);

            countDownSeconds.Pause();
            kb.ShowDialog();
            countDownSeconds.Start();
            if (!string.IsNullOrEmpty(kb.SeatNo))
            {
                string roomName = frmResolution.ViewModel.RoomName;
                string seatNo   = SeatComm.SeatNoToShortSeatNo(clientobject.EnterOutLogData.Student.AtReadingRoom.Setting.SeatNumAmount, kb.SeatNo);
                TipForm_SelectSeatConfinmed tip = new TipForm_SelectSeatConfinmed(roomName, seatNo, frmResolution.ViewModel.CountDownSeconds);//显示提示窗体
                countDownSeconds.Pause();
                tip.ShowDialog();
                countDownSeconds.Start();
                if (tip.IsTrue)
                {
                    clientobject.EnterOutLogData.EnterOutlog.SeatNo      = kb.SeatNo;
                    clientobject.EnterOutLogData.EnterOutlog.TerminalNum = clientobject.ClientSetting.ClientNo;
                    clientobject.EnterOutLogData.EnterOutlog.Remark      = string.Format("在终端{0}输入座位号选择,{1},{2}号座位", clientobject.ClientSetting.ClientNo, clientobject.EnterOutLogData.Student.AtReadingRoom.Name, seatNo);
                    clientobject.EnterOutLogData.FlowControl             = SeatManage.EnumType.ClientOperation.SelectSeat; //操作为选择座位
                    this.Hide();
                }
                else
                {
                    T_SM_Seat.UnLockSeat(kb.SeatNo);//确认窗口点击取消或者自动关闭,则解锁。
                }
            }
        }
Beispiel #6
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);
            }
        }
Beispiel #7
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);
 }
Beispiel #8
0
        /// <summary>
        /// 选择预约的座位
        /// </summary>
        /// <param name="seatBtn"></param>
        /// <returns></returns>
        public bool SelectBookingSeat(SeatUC_ViewModel seatVM)
        {
            DateTime datetimeNow = ServiceDateTime.Now;
            List <BespeakLogInfo> bespeakLogList = T_SM_SeatBespeak.GetBespeakLogInfoBySeatNo(seatVM.LongSeatNo, datetimeNow.Date);

            if (bespeakLogList.Count > 0)
            {
                if (bespeakLogList[0].BsepeakTime.AddMinutes(-double.Parse(ClientObject.EnterOutLogData.Student.AtReadingRoom.Setting.SeatBespeak.ConfirmTime.BeginTime)) <= datetimeNow)
                {
                    PopupWindowsObject.GetInstance().Window.ShowMessage(TipType.IsBookingSeat);
                    return(false);
                }
                ClientObject.EnterOutLogData.BespeakLogInfo = bespeakLogList[0];
                PopupWindowsObject.GetInstance().Window.ShowMessage(TipType.SelectBookingSeatWarn);
                if (PopupWindowsObject.GetInstance().Window.ViewModel.OperateResule == HandleResult.Failed)
                {
                    ClientObject.EnterOutLogData.BespeakLogInfo = null;
                    return(false);
                }
            }
            SeatLockState lockseat = T_SM_Seat.LockSeat(seatVM.LongSeatNo);

            if (lockseat != SeatLockState.Locked) //座位成功加锁
            {
                PopupWindowsObject.GetInstance().Window.ShowMessage(TipType.SeatLocking);
                return(false);
            }
            ClientObject.EnterOutLogData.EnterOutlog.ShortSeatNo     = seatVM.ShortSeatNo;
            ClientObject.EnterOutLogData.EnterOutlog.ReadingRoomName = _ReadingRoomName;
            ClientObject.EnterOutLogData.EnterOutlog.ReadingRoomNo   = _ReadingRoomNo;
            PopupWindowsObject.GetInstance().Window.ShowMessage(TipType.SelectSeatConfinmed);
            if (PopupWindowsObject.GetInstance().Window.ViewModel.OperateResule == HandleResult.Failed)
            {
                T_SM_Seat.UnLockSeat(seatVM.LongSeatNo);//确认窗口点击取消或者自动关闭,则解锁。
                return(false);
            }
            ClientObject.EnterOutLogData.EnterOutlog.SeatNo      = seatVM.LongSeatNo;
            ClientObject.EnterOutLogData.EnterOutlog.ShortSeatNo = seatVM.ShortSeatNo;
            ClientObject.EnterOutLogData.EnterOutlog.TerminalNum = ClientObject.ClientSetting.ClientNo;
            ClientObject.EnterOutLogData.EnterOutlog.Remark      = string.Format("在终端{0}手动选择,{1},{2}号座位", ClientObject.ClientSetting.ClientNo, ClientObject.EnterOutLogData.Student.AtReadingRoom.Name, seatVM.ShortSeatNo);
            ClientObject.EnterOutLogData.FlowControl             = ClientOperation.SelectSeat; //操作为选择座位
            return(true);
        }
Beispiel #9
0
        /// <summary>
        /// 选座座位
        /// </summary>
        /// <param name="seatBtn"></param>
        /// <returns></returns>
        public bool SelectSeat(UsuallySeatUC_ViewModel seatBtn)
        {
            ReadingRoomInfo roomInfo = T_SM_ReadingRoom.GetSingleRoomInfo(seatBtn.ReadingRoomNo);

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

            //验证读者身份是否允许选择该阅览室。
            if (!SelectSeatProven.ProvenReaderType(ClientObject.EnterOutLogData.Student, roomInfo.Setting))
            {
                PopupWindowsObject.GetInstance().Window.ShowMessage(TipType.ReaderTypeInconformity);
                return(false);
            }
            //验证读者黑名单,选座次数。
            if (SelectSeatProven.ProvenReaderState(ClientObject.EnterOutLogData.Student, roomInfo, ClientObject.RegulationRulesSet.BlacklistSet, ClientObject.ClientSetting.DeviceSetting))
            {
                //ClientObject.EnterOutLogData.EnterOutlog.ReadingRoomNo = "";
                return(false);
            }
            SeatLockState lockseat = T_SM_Seat.LockSeat(seatBtn.SeatNo);

            if (lockseat != SeatLockState.Locked) //座位成功加锁
            {
                PopupWindowsObject.GetInstance().Window.ShowMessage(TipType.SeatLocking);
                return(false);
            }

            ClientObject.EnterOutLogData.EnterOutlog.ShortSeatNo     = seatBtn.ShortSeatNo;
            ClientObject.EnterOutLogData.EnterOutlog.ReadingRoomName = seatBtn.ReadingRoomName;
            PopupWindowsObject.GetInstance().Window.ShowMessage(TipType.SelectSeatConfinmed);
            if (PopupWindowsObject.GetInstance().Window.ViewModel.OperateResule != HandleResult.Successed)
            {
                T_SM_Seat.UnLockSeat(seatBtn.SeatNo); //确认窗口点击取消或者自动关闭,则解锁。
                return(false);
            }
            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        = ClientOperation.SelectSeat; //操作为选择座位
            ClientObject.EnterOutLogData.EnterOutlog.Remark = string.Format("在终端{0}选择常坐座位,{1},{2}号座位", ClientObject.ClientSetting.ClientNo, ClientObject.EnterOutLogData.Student.AtReadingRoom.Name, seatBtn.ShortSeatNo);
            return(true);
        }
 /// <summary>
 /// 处理锁定超时
 /// </summary>
 public void LockOverTime()
 {
     try
     {
         DateTime nowDateTime = ServiceDateTime.Now;
         //获取全部的锁定座位
         List <Seat> SeatList = T_SM_Seat.GetSeatListByRoomNum(null, true);
         if (SeatList != null)
         {
             foreach (Seat s in SeatList)
             {
                 if (s.LockedTime.AddMinutes(1.0) < nowDateTime)
                 {
                     T_SM_Seat.UnLockSeat(s.SeatNo);
                 }
             }
         }
     }
     catch (Exception e)
     {
         WriteLog.Write(e.Message);
     }
 }
Beispiel #11
0
        void seatBtn_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
        {
            SeatButton seatBtn = sender as SeatButton;

            SeatManage.EnumType.SeatLockState lockseat = T_SM_Seat.LockSeat(seatBtn.SeatNo);
            if (lockseat == SeatManage.EnumType.SeatLockState.Locked)//座位成功加锁
            {
                string roomName = frmResolution.ViewModel.RoomName;
                string seatNo   = seatBtn.ShortSeatNo;
                TipForm_SelectSeatConfinmed tip = new TipForm_SelectSeatConfinmed(roomName, seatNo, frmResolution.ViewModel.CountDownSeconds);//显示提示窗体
                countDownSeconds.Pause();
                tip.ShowDialog();
                countDownSeconds.Start();
                if (tip.IsTrue)
                {
                    clientobject.EnterOutLogData.EnterOutlog.SeatNo      = seatBtn.SeatNo;
                    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);
                    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();
            }
            else if (lockseat == SeatManage.EnumType.SeatLockState.NotExists)
            {
            }
        }
Beispiel #12
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();
            }
        }
Beispiel #13
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>
        public void ChooseSeat()
        {
            //进出记录相关属性赋值。
            clientobject.EnterOutLogData.EnterOutlog.EnterOutLogNo = SeatManage.SeatManageComm.SeatComm.RndNum();
            clientobject.EnterOutLogData.EnterOutlog.EnterOutState = SeatManage.EnumType.EnterOutLogType.SelectSeat;
            clientobject.EnterOutLogData.EnterOutlog.Flag          = SeatManage.EnumType.Operation.Reader;
            clientobject.EnterOutLogData.EnterOutlog.EnterOutType  = SeatManage.EnumType.LogStatus.Valid;

            ReadingRoom frmReadingRoom = new ReadingRoom();

            WPF_Seat.SeatForm seat = WPF_Seat.SeatForm.GetInstance();
            //while (true)
            //{
            frmReadingRoom.ShowDialog();

            if (clientobject.EnterOutLogData.FlowControl == SeatManage.EnumType.ClientOperation.Exit)//阅览室选座操作为退出,结束选座流程
            {
                frmReadingRoom.Close();
                return;
            }
            switch (frmReadingRoom.RoomSelectSeatMethod)
            {
            case SelectSeatMode.AutomaticMode:
                string tempSeatNo = T_SM_Seat.RandomAllotSeat(clientobject.EnterOutLogData.EnterOutlog.ReadingRoomNo);
                SeatManage.EnumType.SeatLockState lockseat = T_SM_Seat.LockSeat(tempSeatNo);
                if (lockseat == SeatLockState.Locked)    //座位锁定失败,则提示
                {
                    clientobject.EnterOutLogData.EnterOutlog.Remark      = string.Format("在终端{0}刷卡,自动选择{1} {2}号座位", clientobject.ClientSetting.ClientNo, clientobject.EnterOutLogData.Student.AtReadingRoom.Name, tempSeatNo.Substring(tempSeatNo.Length - clientobject.EnterOutLogData.Student.AtReadingRoom.Setting.SeatNumAmount));
                    clientobject.EnterOutLogData.EnterOutlog.SeatNo      = tempSeatNo;
                    clientobject.EnterOutLogData.EnterOutlog.TerminalNum = clientobject.ClientSetting.ClientNo;
                }
                else
                {
                    clientobject.EnterOutLogData.EnterOutlog.SeatNo = "";
                    SeatManage.SeatClient.Tip.Tip_Framework tip = new SeatManage.SeatClient.Tip.Tip_Framework(SeatManage.EnumType.TipType.SeatLocking, 8);    //显示提示窗体
                    tip.ShowDialog();
                }
                break;

            case SelectSeatMode.ManualMode:
                seat.DrowSeatUsedInfo();
                seat.ShowDialog();
                //座位选择的操作为退出,结束选座流程;操作为选座,跳出循环;否则操作为back,继续执行循环操作
                break;
                //}

                if (clientobject.EnterOutLogData.FlowControl == SeatManage.EnumType.ClientOperation.Exit)
                {
                    frmReadingRoom.Close();
                    return;
                }
                else if (clientobject.EnterOutLogData.FlowControl == SeatManage.EnumType.ClientOperation.SelectSeat)
                {
                    frmReadingRoom.Close();
                    break;
                }
            }
            if (string.IsNullOrEmpty(clientobject.EnterOutLogData.EnterOutlog.ReadingRoomNo) || string.IsNullOrEmpty(clientobject.EnterOutLogData.EnterOutlog.SeatNo))
            {
                //如果阅览室编号或者座位号为空,则不执行插入操作。
                frmReadingRoom.Close();
                return;
            }
            int          newLogId = -1;
            HandleResult result   = EnterOutOperate.AddEnterOutLog(clientobject.EnterOutLogData.EnterOutlog, ref newLogId);//插入进出记录

            frmReadingRoom.Dispose();
            if (result == HandleResult.Successed)
            {
                T_SM_Seat.UnLockSeat(clientobject.EnterOutLogData.EnterOutlog.SeatNo);//记录插入成功,解锁座位
                if (clientobject.EnterOutLogData.WaitSeatLogModel != null)
                {
                    //等待记录的实体不为空,说明当前读者操作为等待座位。
                    //TODO:添加等待记录
                    clientobject.EnterOutLogData.WaitSeatLogModel.EnterOutLogID = newLogId;
                    T_SM_SeatWaiting.AddWaitSeatLog(clientobject.EnterOutLogData.WaitSeatLogModel);
                    PrintData data = new PrintData();
                    data.CardNo          = clientobject.EnterOutLogData.WaitSeatLogModel.CardNo;
                    data.EnterTime       = ServiceDateTime.Now;
                    data.ReaderName      = clientobject.EnterOutLogData.Student.Name;
                    data.ReadingRoomName = clientobject.EnterOutLogData.Student.AtReadingRoom.Name;
                    data.SeatNo          = SeatComm.SeatNoToShortSeatNo(clientobject.EnterOutLogData.Student.AtReadingRoom.Setting.SeatNumAmount, clientobject.EnterOutLogData.EnterOutlog.SeatNo);
                    data.SecCardNo       = clientobject.EnterOutLogData.EnterOutlog.CardNo;
                    double timelength = NowReadingRoomState.GetSeatHoldTime(clientobject.EnterOutLogData.Student.AtReadingRoom.Setting.SeatHoldTime, data.EnterTime);
                    data.WaitEndDateTime = data.EnterTime.AddMinutes(timelength);
                    printer.Print(PrintStatus.Wait, data, clientobject.ClientSetting.ClientNo);

                    Tip_Framework topform = new Tip_Framework(TipType.WaitSeatSuccess, 9);
                    topform.OperateResule = result;
                    topform.ShowDialog();
                }
                else
                {
                    PrintData data = new PrintData();
                    data.CardNo          = clientobject.EnterOutLogData.EnterOutlog.CardNo;
                    data.EnterTime       = ServiceDateTime.Now;
                    data.ReaderName      = clientobject.EnterOutLogData.Student.Name;
                    data.ReadingRoomName = clientobject.EnterOutLogData.Student.AtReadingRoom.Name;
                    data.SeatNo          = SeatComm.SeatNoToShortSeatNo(clientobject.EnterOutLogData.Student.AtReadingRoom.Setting.SeatNumAmount, clientobject.EnterOutLogData.EnterOutlog.SeatNo);
                    if (clientobject.ClientSetting.DeviceSetting.UsingPrintSlip)
                    {
                        printer.Print(PrintStatus.General, data, clientobject.ClientSetting.ClientNo);
                    }
                    //提示选座成功
                    Tip_Framework topform = new Tip_Framework(TipType.SelectSeatResult, 9);
                    topform.OperateResule = result;
                    topform.ShowDialog();
                }
            }
        }
Beispiel #15
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);
        }
        /// <summary>
        /// 选座操作
        /// </summary>
        public void ChooseSeat()
        {
            //进出记录相关属性赋值。
            clientobject.EnterOutLogData.EnterOutlog.EnterOutLogNo = SeatManage.SeatManageComm.SeatComm.RndNum();
            clientobject.EnterOutLogData.EnterOutlog.EnterOutState = SeatManage.EnumType.EnterOutLogType.SelectSeat;
            clientobject.EnterOutLogData.EnterOutlog.Flag          = SeatManage.EnumType.Operation.Reader;
            clientobject.EnterOutLogData.EnterOutlog.EnterOutType  = SeatManage.EnumType.LogStatus.Valid;

            ReadingRoomWindow readingRoomWindow = new ReadingRoomWindow();

            readingRoomWindow.ShowDialog();
            if (clientobject.EnterOutLogData.FlowControl == SeatManage.EnumType.ClientOperation.Exit)//阅览室选座操作为退出,结束选座流程
            {
                return;
            }
            switch (readingRoomWindow.viewModel.RoomSelectSeatMethod)
            {
            case SelectSeatMode.AutomaticMode:
                string tempSeatNo = T_SM_Seat.RandomAllotSeat(clientobject.EnterOutLogData.EnterOutlog.ReadingRoomNo);
                SeatManage.EnumType.SeatLockState lockseat = T_SM_Seat.LockSeat(tempSeatNo);
                if (lockseat == SeatLockState.Locked)    //座位锁定失败,则提示
                {
                    clientobject.EnterOutLogData.EnterOutlog.Remark      = string.Format("在终端{0}刷卡,自动选择{1} {2}号座位", clientobject.ClientSetting.ClientNo, clientobject.EnterOutLogData.Student.AtReadingRoom.Name, tempSeatNo.Substring(tempSeatNo.Length - clientobject.EnterOutLogData.Student.AtReadingRoom.Setting.SeatNumAmount));
                    clientobject.EnterOutLogData.EnterOutlog.SeatNo      = tempSeatNo;
                    clientobject.EnterOutLogData.EnterOutlog.TerminalNum = clientobject.ClientSetting.ClientNo;
                    clientobject.EnterOutLogData.EnterOutlog.ShortSeatNo = SeatComm.SeatNoToShortSeatNo(clientobject.EnterOutLogData.Student.AtReadingRoom.Setting.SeatNumAmount, clientobject.EnterOutLogData.EnterOutlog.SeatNo);
                }
                else
                {
                    clientobject.EnterOutLogData.EnterOutlog.SeatNo = "";
                    PopupWindow popWindow = new PopupWindow(TipType.SeatLocking);
                    popWindow.ShowDialog();
                }
                break;

            case SelectSeatMode.ManualMode:
                //座位选择的操作为退出,结束选座流程;操作为选座,跳出循环;否则操作为back,继续执行循环操作
                break;
            }
            if (string.IsNullOrEmpty(clientobject.EnterOutLogData.EnterOutlog.ReadingRoomNo) || string.IsNullOrEmpty(clientobject.EnterOutLogData.EnterOutlog.SeatNo))
            {
                //如果阅览室编号或者座位号为空,则不执行插入操作。
                return;
            }
            int          newLogId = -1;
            HandleResult result   = EnterOutOperate.AddEnterOutLog(clientobject.EnterOutLogData.EnterOutlog, ref newLogId);//插入进出记录

            if (result == HandleResult.Successed)
            {
                T_SM_Seat.UnLockSeat(clientobject.EnterOutLogData.EnterOutlog.SeatNo);//记录插入成功,解锁座位
                if (clientobject.EnterOutLogData.WaitSeatLogModel != null)
                {
                    //等待记录的实体不为空,说明当前读者操作为等待座位。
                    //TODO:添加等待记录
                    clientobject.EnterOutLogData.WaitSeatLogModel.EnterOutLogID = newLogId;
                    T_SM_SeatWaiting.AddWaitSeatLog(clientobject.EnterOutLogData.WaitSeatLogModel);
                    PrintData data = new PrintData();
                    data.CardNo          = clientobject.EnterOutLogData.WaitSeatLogModel.CardNo;
                    data.EnterTime       = ServiceDateTime.Now;
                    data.ReaderName      = clientobject.EnterOutLogData.Student.Name;
                    data.ReadingRoomName = clientobject.EnterOutLogData.Student.AtReadingRoom.Name;
                    data.SeatNo          = SeatComm.SeatNoToShortSeatNo(clientobject.EnterOutLogData.Student.AtReadingRoom.Setting.SeatNumAmount, clientobject.EnterOutLogData.EnterOutlog.SeatNo);
                    data.SecCardNo       = clientobject.EnterOutLogData.EnterOutlog.CardNo;
                    double timelength = NowReadingRoomState.GetSeatHoldTime(clientobject.EnterOutLogData.Student.AtReadingRoom.Setting.SeatHoldTime, data.EnterTime);
                    data.WaitEndDateTime = data.EnterTime.AddMinutes(timelength);
                    printer.ThreadPrint(PrintStatus.Wait, data, clientobject.ClientSetting.ClientNo);

                    PopupWindow popWindow = new PopupWindow(TipType.WaitSeatSuccess);
                    popWindow.ShowDialog();
                }
                else
                {
                    PrintData data = new PrintData();
                    data.CardNo          = clientobject.EnterOutLogData.EnterOutlog.CardNo;
                    data.EnterTime       = ServiceDateTime.Now;
                    data.ReaderName      = clientobject.EnterOutLogData.Student.Name;
                    data.ReadingRoomName = clientobject.EnterOutLogData.Student.AtReadingRoom.Name;
                    data.SeatNo          = SeatComm.SeatNoToShortSeatNo(clientobject.EnterOutLogData.Student.AtReadingRoom.Setting.SeatNumAmount, clientobject.EnterOutLogData.EnterOutlog.SeatNo);
                    if (clientobject.ClientSetting.DeviceSetting.UsingPrintSlip == PrintSlipMode.AutoPrint)
                    {
                        printer.ThreadPrint(PrintStatus.General, data, clientobject.ClientSetting.ClientNo);
                    }
                    if (clientobject.ClientSetting.DeviceSetting.UsingPrintSlip == PrintSlipMode.UserChoose)
                    {
                        PopupWindow printWindow = new PopupWindow(TipType.PrintConfIrm);
                        printWindow.ShowDialog();
                        if (printWindow.viewModel.OperateResule == HandleResult.Successed)
                        {
                            printer.ThreadPrint(PrintStatus.General, data, clientobject.ClientSetting.ClientNo);
                        }
                    }
                    //提示选座成功
                    PopupWindow popWindow = new PopupWindow(TipType.SelectSeatResult);
                    popWindow.ShowDialog();
                }
            }
        }
        /// <summary>
        /// 选座操作
        /// </summary>
        public void ChooseSeat()
        {
            //进出记录相关属性赋值。
            Clientobject.EnterOutLogData.EnterOutlog.EnterOutLogNo = SeatComm.RndNum();
            Clientobject.EnterOutLogData.EnterOutlog.EnterOutState = EnterOutLogType.SelectSeat;
            Clientobject.EnterOutLogData.EnterOutlog.Flag          = Operation.Reader;
            Clientobject.EnterOutLogData.EnterOutlog.EnterOutType  = LogStatus.Valid;
            ReadingRoomWindowObject.GetInstance().Window.ShowMessage();
            //阅览室选座操作为退出,结束选座流程
            if (Clientobject.EnterOutLogData.FlowControl == ClientOperation.Exit)
            {
                return;
            }
            //返回为自动选座
            if (string.IsNullOrEmpty(Clientobject.EnterOutLogData.EnterOutlog.ReadingRoomNo) || string.IsNullOrEmpty(Clientobject.EnterOutLogData.EnterOutlog.SeatNo))
            {
                //如果阅览室编号或者座位号为空,则不执行插入操作。
                if (!string.IsNullOrEmpty(Clientobject.EnterOutLogData.EnterOutlog.SeatNo))
                {
                    T_SM_Seat.UnLockSeat(Clientobject.EnterOutLogData.EnterOutlog.SeatNo);
                }
                PopupWindowsObject.GetInstance().Window.ShowMessage(TipType.Exception);
                return;
            }
            int newLogId = -1;

            if (EnterOutOperate.AddEnterOutLog(Clientobject.EnterOutLogData.EnterOutlog, ref newLogId) == HandleResult.Failed)
            {
                PopupWindowsObject.GetInstance().Window.ShowMessage(TipType.Exception);
                return;
            }
            T_SM_Seat.UnLockSeat(Clientobject.EnterOutLogData.EnterOutlog.SeatNo);//记录插入成功,解锁座位

            if (Clientobject.EnterOutLogData.FlowControl == ClientOperation.WaitSeat)
            {
                //SeatManage.ClassModel.ReaderNoticeInfo rni = new SeatManage.ClassModel.ReaderNoticeInfo();
                //rni.CardNo = Clientobject.EnterOutLogData.EnterOutlog.CardNo;
                //rni.Type = NoticeType.OtherSetShortLeaveWarning;
                //rni.Note = Clientobject.EnterOutLogData.EnterOutlog.Remark;
                //SeatManage.Bll.T_SM_ReaderNotice.AddReaderNotice(rni);

                //PushMsgInfo msg = new PushMsgInfo();
                //msg.Title = "您好,您已被设置为暂离";
                //msg.MsgType = MsgPushType.OtherUser;
                //msg.StudentNum = Clientobject.EnterOutLogData.EnterOutlog.CardNo;
                //msg.Message = Clientobject.EnterOutLogData.EnterOutlog.Remark;
                //SeatManage.Bll.T_SM_ReaderNotice.SendPushMsg(msg);

                //TODO:添加等待记录
                Clientobject.EnterOutLogData.WaitSeatLogModel.EnterOutLogID = newLogId;
                if (T_SM_SeatWaiting.AddWaitSeatLog(Clientobject.EnterOutLogData.WaitSeatLogModel) > 0)
                {
                    PrintData data;
                    switch (Clientobject.ClientSetting.DeviceSetting.UsingPrintSlip)
                    {
                    case PrintSlipMode.AutoPrint:
                        data                 = new PrintData();
                        data.CardNo          = Clientobject.EnterOutLogData.WaitSeatLogModel.CardNo;
                        data.EnterTime       = ServiceDateTime.Now;
                        data.ReaderName      = Clientobject.EnterOutLogData.Student.Name;
                        data.ReadingRoomName = Clientobject.EnterOutLogData.Student.AtReadingRoom.Name;
                        data.SeatNo          = SeatComm.SeatNoToShortSeatNo(Clientobject.EnterOutLogData.Student.AtReadingRoom.Setting.SeatNumAmount, Clientobject.EnterOutLogData.EnterOutlog.SeatNo);
                        data.SecCardNo       = Clientobject.EnterOutLogData.EnterOutlog.CardNo;
                        data.WaitEndDateTime = data.EnterTime.AddMinutes(Clientobject.EnterOutLogData.Student.AtReadingRoom.Setting.GetSeatHoldTime(data.EnterTime));

                        printer.ThreadPrint(PrintStatus.General, data, Clientobject.ClientSetting.ClientNo);
                        break;

                    case PrintSlipMode.UserChoose:
                        PopupWindowsObject.GetInstance().Window.ShowMessage(TipType.PrintConfIrm);
                        if (PopupWindowsObject.GetInstance().Window.ViewModel.OperateResule == HandleResult.Successed)
                        {
                            data                 = new PrintData();
                            data.CardNo          = Clientobject.EnterOutLogData.WaitSeatLogModel.CardNo;
                            data.EnterTime       = ServiceDateTime.Now;
                            data.ReaderName      = Clientobject.EnterOutLogData.Student.Name;
                            data.ReadingRoomName = Clientobject.EnterOutLogData.Student.AtReadingRoom.Name;
                            data.SeatNo          = SeatComm.SeatNoToShortSeatNo(Clientobject.EnterOutLogData.Student.AtReadingRoom.Setting.SeatNumAmount, Clientobject.EnterOutLogData.EnterOutlog.SeatNo);
                            data.SecCardNo       = Clientobject.EnterOutLogData.EnterOutlog.CardNo;
                            data.WaitEndDateTime = data.EnterTime.AddMinutes(Clientobject.EnterOutLogData.Student.AtReadingRoom.Setting.GetSeatHoldTime(data.EnterTime));

                            printer.ThreadPrint(PrintStatus.General, data, Clientobject.ClientSetting.ClientNo);
                        }
                        break;

                    case PrintSlipMode.NotPrint:
                        break;
                    }
                    PopupWindowsObject.GetInstance().Window.ShowMessage(TipType.WaitSeatSuccess);
                }
                else
                {
                    PopupWindowsObject.GetInstance().Window.ShowMessage(TipType.Exception);
                }
            }
            else
            {
                PrintData data;
                switch (Clientobject.ClientSetting.DeviceSetting.UsingPrintSlip)
                {
                case PrintSlipMode.AutoPrint:
                    data                 = new PrintData();
                    data.CardNo          = Clientobject.EnterOutLogData.EnterOutlog.CardNo;
                    data.EnterTime       = ServiceDateTime.Now;
                    data.ReaderName      = Clientobject.EnterOutLogData.Student.Name;
                    data.ReadingRoomName = Clientobject.EnterOutLogData.Student.AtReadingRoom.Name;
                    data.SeatNo          = SeatComm.SeatNoToShortSeatNo(Clientobject.EnterOutLogData.Student.AtReadingRoom.Setting.SeatNumAmount, Clientobject.EnterOutLogData.EnterOutlog.SeatNo);

                    printer.ThreadPrint(PrintStatus.General, data, Clientobject.ClientSetting.ClientNo);
                    break;

                case PrintSlipMode.UserChoose:
                    PopupWindowsObject.GetInstance().Window.ShowMessage(TipType.PrintConfIrm);
                    if (PopupWindowsObject.GetInstance().Window.ViewModel.OperateResule == HandleResult.Successed)
                    {
                        data                 = new PrintData();
                        data.CardNo          = Clientobject.EnterOutLogData.EnterOutlog.CardNo;
                        data.EnterTime       = ServiceDateTime.Now;
                        data.ReaderName      = Clientobject.EnterOutLogData.Student.Name;
                        data.ReadingRoomName = Clientobject.EnterOutLogData.Student.AtReadingRoom.Name;
                        data.SeatNo          = SeatComm.SeatNoToShortSeatNo(Clientobject.EnterOutLogData.Student.AtReadingRoom.Setting.SeatNumAmount, Clientobject.EnterOutLogData.EnterOutlog.SeatNo);

                        printer.ThreadPrint(PrintStatus.General, data, Clientobject.ClientSetting.ClientNo);
                    }
                    break;

                case PrintSlipMode.NotPrint:
                    break;
                }
                //提示选座成功
                PopupWindowsObject.GetInstance().Window.ShowMessage(TipType.SelectSeatResult);
            }
        }