示例#1
0
        public void PosCardHandle(string cardNo)
        {
            try
            {
                ClientObject.EnterOutLogData         = new OperateResult.OperateResult();
                ClientObject.EnterOutLogData.Student = EnterOutOperate.GetReaderSeatState(cardNo);
                #region 判断当前读者状态
                EnterOutLogType nowReaderStatus = EnterOutLogType.Leave;
                if (ClientObject.EnterOutLogData.Student.EnterOutLog != null && ClientObject.EnterOutLogData.Student.EnterOutLog.EnterOutState != EnterOutLogType.Leave)
                {
                    //如果记录不为空,设置为当前记录状态
                    nowReaderStatus = ClientObject.EnterOutLogData.Student.EnterOutLog.EnterOutState;
                }
                else if (ClientObject.EnterOutLogData.Student.BespeakLog.Count > 0)
                {
                    nowReaderStatus = EnterOutLogType.BespeakWaiting;
                }
                else if (ClientObject.EnterOutLogData.Student.WaitSeatLog != null)
                {
                    nowReaderStatus = EnterOutLogType.Waiting;
                }
                #endregion
                //如果有未读的消息则显示消息窗口
                if (ClientObject.EnterOutLogData.Student.NoticeInfo.Count > 0)
                {
                    ReaderNoteWindowObject.GetInstance().Window.ShowMessage();
                }
                //根据读者状态进入不同操作
                switch (nowReaderStatus)
                {
                case EnterOutLogType.Leave:
                    ClientObject.EnterOutLogData.EnterOutlog        = new SeatManage.ClassModel.EnterOutLogInfo();
                    ClientObject.EnterOutLogData.EnterOutlog.CardNo = cardNo;
                    posCardHandle.ChooseSeat();
                    break;

                case EnterOutLogType.BespeakWaiting:
                    posCardHandle.BespeakCheck();
                    break;

                case EnterOutLogType.BookingConfirmation:
                case EnterOutLogType.SelectSeat:
                case EnterOutLogType.ContinuedTime:
                case EnterOutLogType.ComeBack:
                case EnterOutLogType.ReselectSeat:
                case EnterOutLogType.WaitingSuccess:
                    ClientObject.EnterOutLogData.EnterOutlog = ClientObject.EnterOutLogData.Student.EnterOutLog;
                    posCardHandle.LeaveOperate();
                    break;

                case EnterOutLogType.ShortLeave:
                    ClientObject.EnterOutLogData.EnterOutlog = ClientObject.EnterOutLogData.Student.EnterOutLog;
                    posCardHandle.CometoBack();
                    break;

                case EnterOutLogType.Waiting:
                    posCardHandle.WaitingSeat();
                    break;
                }
            }
            catch (Exception ex)
            {
                WriteLog.Write(string.Format("执行遇到错误:{0}", ex.Message));
                PopupWindowsObject.GetInstance().Window.ShowMessage(TipType.Exception);
            }
            finally
            {
                ClientObject.EnterOutLogData = null;
            }
        }
        //#endregion


        #region 刷卡处理
        public void PosCardHandle(string cardNo)
        {
            try
            {
                clientObject.EnterOutLogData         = new OperateResult.OperateResult();
                clientObject.EnterOutLogData.Student = SeatManage.Bll.EnterOutOperate.GetReaderInfo(cardNo);
                #region 判断当前读者状态
                EnterOutLogType nowReaderStatus = EnterOutLogType.Leave;
                if (clientObject.EnterOutLogData.Student.EnterOutLog != null && clientObject.EnterOutLogData.Student.EnterOutLog.EnterOutState != EnterOutLogType.Leave)
                {
                    //如果记录不为空,设置为当前记录状态
                    nowReaderStatus = clientObject.EnterOutLogData.Student.EnterOutLog.EnterOutState;
                }
                else if (clientObject.EnterOutLogData.Student.BespeakLog.Count > 0)
                {
                    nowReaderStatus = EnterOutLogType.BespeakWaiting;
                }
                else if (clientObject.EnterOutLogData.Student.WaitSeatLog != null)
                {
                    nowReaderStatus = EnterOutLogType.Waiting;
                }
                #endregion
                //如果有未读的消息则显示消息窗口
                if (clientObject.EnterOutLogData.Student.NoticeInfo.Count > 0)
                {
                    ReaderNoticeWindow noteWindow = new ReaderNoticeWindow();
                    noteWindow.ShowDialog();
                }
                //根据读者状态进入不同操作
                switch (nowReaderStatus)
                {
                case EnterOutLogType.Leave:
                    clientObject.EnterOutLogData.EnterOutlog        = new SeatManage.ClassModel.EnterOutLogInfo();
                    clientObject.EnterOutLogData.EnterOutlog.CardNo = cardNo;
                    posCardHandle.ChooseSeat();
                    break;

                case EnterOutLogType.BespeakWaiting:
                    posCardHandle.BespeakSeatWait();
                    break;

                case EnterOutLogType.BookingConfirmation:
                case EnterOutLogType.SelectSeat:
                case EnterOutLogType.ContinuedTime:
                case EnterOutLogType.ComeBack:
                case EnterOutLogType.ReselectSeat:
                case EnterOutLogType.WaitingSuccess:
                    clientObject.EnterOutLogData.EnterOutlog = clientObject.EnterOutLogData.Student.EnterOutLog;
                    posCardHandle.LeaveOperate();
                    break;

                case EnterOutLogType.ShortLeave:
                    clientObject.EnterOutLogData.EnterOutlog = clientObject.EnterOutLogData.Student.EnterOutLog;
                    posCardHandle.CometoBack();
                    break;

                case EnterOutLogType.Waiting:
                    posCardHandle.WaitingSeat();
                    break;
                }
            }
            catch (Exception ex)
            {
                SeatManage.SeatManageComm.WriteLog.Write(string.Format("执行遇到错误:{0}", ex.Message));
                SeatClientV3.FunWindow.MessageWindow popWindow = new FunWindow.MessageWindow(SeatManage.EnumType.MessageType.Exception);
                popWindow.ShowDialog();
            }
            finally
            {
                clientObject.EnterOutLogData = null;
            }
        }