Beispiel #1
0
 /// <summary>
 /// 添加常坐座位
 /// </summary>
 public void AddOften()
 {
     try
     {
         List <Seat> seats = T_SM_Seat.GetReaderOftenUsedSeat(ClientObject.EnterOutLogData.EnterOutlog.CardNo, ClientObject.ClientSetting.DeviceSetting.UsingOftenUsedSeat.LengthDays, ClientObject.ClientSetting.DeviceSetting.Rooms);
         for (int i = 0; i < 12; i++)
         {
             if (i > seats.Count - 1)
             {
                 OftenUsedSeats[i].SeatNo          = "";
                 OftenUsedSeats[i].ShortSeatNo     = "";
                 OftenUsedSeats[i].ReadingRoomName = "";
                 OftenUsedSeats[i].ReadingRoomNo   = "";
                 OftenUsedSeats[i].UCVisible       = "Collapsed";
             }
             else
             {
                 OftenUsedSeats[i].SeatNo          = seats[i].SeatNo;
                 OftenUsedSeats[i].ShortSeatNo     = SeatComm.SeatNoToShortSeatNo(ClientObject.ReadingRoomList[seats[i].ReadingRoomNum].Setting.SeatNumAmount, seats[i].SeatNo);
                 OftenUsedSeats[i].ReadingRoomName = ClientObject.ReadingRoomList[seats[i].ReadingRoomNum].Name;
                 OftenUsedSeats[i].ReadingRoomNo   = seats[i].ReadingRoomNum;
                 OftenUsedSeats[i].UCVisible       = "Visible";
             }
         }
     }
     catch (Exception ex)
     {
         WriteLog.Write("加载阅览室遇到异常" + ex.Message);
         PopupWindowsObject.GetInstance().Window.ShowMessage(TipType.Exception);
     }
 }
Beispiel #2
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);
            }
        }
        /// <summary>
        /// 等待座位
        /// </summary>
        public void WaitingSeat()
        {
            WaitSeatLogInfo waitLog = Clientobject.EnterOutLogData.Student.WaitSeatLog;

            //ReadingRoomInfo roomInfo = Clientobject.EnterOutLogData.Student.AtReadingRoom;
            //string shortSeatNo = SeatComm.SeatNoToShortSeatNo(roomInfo.Setting.SeatNumAmount, waitLog.SeatNo);
            PopupWindowsObject.GetInstance().Window.ShowMessage(TipType.WaitSeatCancelWarn);
            if (PopupWindowsObject.GetInstance().Window.ViewModel.OperateResule != HandleResult.Successed)
            {
                return;
            }
            //处理等待记录的Id
            Clientobject.EnterOutLogData.WaitSeatLogModel              = waitLog;
            Clientobject.EnterOutLogData.WaitSeatLogModel.OperateType  = Operation.Reader;
            Clientobject.EnterOutLogData.WaitSeatLogModel.WaitingState = EnterOutLogType.WaitingCancel;
            Clientobject.EnterOutLogData.WaitSeatLogModel.NowState     = LogStatus.Valid;
            if (!T_SM_SeatWaiting.UpdateWaitLog(Clientobject.EnterOutLogData.WaitSeatLogModel))
            {
                PopupWindowsObject.GetInstance().Window.ShowMessage(TipType.Exception);
                return; //恢复读者的在座状态
            }

            Clientobject.EnterOutLogData.EnterOutlog = T_SM_EnterOutLog.GetEnterOutLogInfoById(Clientobject.EnterOutLogData.WaitSeatLogModel.EnterOutLogID);
            TimeSpan shortleavetimelong = ServiceDateTime.Now - Clientobject.EnterOutLogData.EnterOutlog.EnterOutTime;

            Clientobject.EnterOutLogData.EnterOutlog.EnterOutState = EnterOutLogType.ComeBack;
            Clientobject.EnterOutLogData.EnterOutlog.EnterOutType  = LogStatus.Valid;
            Clientobject.EnterOutLogData.EnterOutlog.Flag          = Operation.OtherReader;
            Clientobject.EnterOutLogData.EnterOutlog.TerminalNum   = Clientobject.ClientSetting.ClientNo;
            Clientobject.EnterOutLogData.EnterOutlog.Remark        = string.Format("读者{0}在{1}终端取消等待{2} {3}号座位,您暂离{4}分钟后恢复为在座状态", Clientobject.EnterOutLogData.WaitSeatLogModel.CardNo, Clientobject.ClientSetting.ClientNo, Clientobject.EnterOutLogData.EnterOutlog.ReadingRoomName, Clientobject.EnterOutLogData.EnterOutlog.ShortSeatNo, shortleavetimelong.Minutes);
            int newId = -1;

            PopupWindowsObject.GetInstance().Window.ShowMessage(EnterOutOperate.AddEnterOutLog(Clientobject.EnterOutLogData.EnterOutlog, ref newId) == HandleResult.Successed ? TipType.WaitSeatCancel : TipType.Exception);
        }
Beispiel #4
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 #5
0
        /// <summary>
        /// 选座验证操作。
        /// </summary>
        /// <param name="student">学生信息</param>
        /// <param name="room">选择的阅览室</param>
        /// <param name="clientconfig">客户端设置</param>
        /// <returns></returns>
        public static bool ProvenReaderState(ReaderInfo student, ReadingRoomInfo room, BlacklistSetting blacklistSet, ClientConfigV2 clientconfig)
        {
            if (SeatManage.Bll.EnterOutOperate.CheckReaderChooseSeatTimes(student.CardNo, clientconfig.PosTimes))
            {
                PopupWindowsObject.GetInstance().Window.ShowMessage(TipType.SelectSeatFrequent);
                return(true);
            }
            if (SeatManage.Bll.EnterOutOperate.CheckReaderChooseSeatTimesByReadingRoom(student.CardNo, room.Setting.PosTimes, room.No))
            {
                PopupWindowsObject.GetInstance().Window.ShowMessage(TipType.SelectSeatFrequent);
                return(true);
            }
            if (!room.Setting.UsedBlacklistLimit)
            {
                return(false);
            }
            if (student.BlacklistLog.Count <= 0)
            {
                return(false);
            }
            if (!room.Setting.BlackListSetting.Used)
            {
                PopupWindowsObject.GetInstance().Window.ShowMessage(TipType.IsBlacklist);
                return(true);
            }
            bool isBlack = student.BlacklistLog.Any(blinfo => blinfo.ReadingRoomID == room.No);

            if (isBlack)
            {
                PopupWindowsObject.GetInstance().Window.ShowMessage(TipType.IsBlacklist);
                return(true);
            }
            return(false);
        }
        /// <summary>
        /// 释放座位
        /// </summary>
        public void ReleaseSeat()
        {
            int newLogId = -1;

            Clientobject.EnterOutLogData.EnterOutlog.TerminalNum = Clientobject.ClientSetting.ClientNo;
            Clientobject.EnterOutLogData.EnterOutlog.Remark      = string.Format("在终端{0}刷卡释放{1} {2}号座位", Clientobject.ClientSetting.ClientNo, Clientobject.EnterOutLogData.EnterOutlog.ReadingRoomName, Clientobject.EnterOutLogData.EnterOutlog.ShortSeatNo);
            PopupWindowsObject.GetInstance().Window.ShowMessage(EnterOutOperate.AddEnterOutLog(Clientobject.EnterOutLogData.EnterOutlog, ref newLogId) == HandleResult.Successed ? TipType.Leave : TipType.Exception);
        }
        /// <summary>
        /// 暂离
        /// </summary>
        public void ShortLeave()
        {
            Clientobject.EnterOutLogData.EnterOutlog.TerminalNum = Clientobject.ClientSetting.ClientNo;
            int newLogId = -1;

            Clientobject.EnterOutLogData.EnterOutlog.Remark = string.Format("在终端{0}刷卡暂时离开,保留{1} {2}号座位{3}分钟", Clientobject.ClientSetting.ClientNo, Clientobject.EnterOutLogData.Student.AtReadingRoom.Name, Clientobject.EnterOutLogData.Student.EnterOutLog.ShortSeatNo, NowReadingRoomState.GetSeatHoldTime(Clientobject.EnterOutLogData.Student.AtReadingRoom.Setting.SeatHoldTime, ServiceDateTime.Now));
            PopupWindowsObject.GetInstance().Window.ShowMessage(EnterOutOperate.AddEnterOutLog(Clientobject.EnterOutLogData.EnterOutlog, ref newLogId) == HandleResult.Successed ? TipType.ShortLeave : TipType.Exception);
        }
Beispiel #8
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);
            }
        }
        /// <summary>
        /// 暂离回来操作
        /// </summary>
        public void CometoBack()
        {
            Clientobject.EnterOutLogData.EnterOutlog.EnterOutState = EnterOutLogType.ComeBack;//设置读者状态为暂回来
            Clientobject.EnterOutLogData.EnterOutlog.TerminalNum   = Clientobject.ClientSetting.ClientNo;
            TimeSpan shortleavetimelong = ServiceDateTime.Now - Clientobject.EnterOutLogData.EnterOutlog.EnterOutTime;

            Clientobject.EnterOutLogData.EnterOutlog.Remark = string.Format("在终端{0}刷卡暂离回来,暂离时长{1}分钟,继续使用{2} {3}号座位", Clientobject.ClientSetting.ClientNo, shortleavetimelong.Minutes, Clientobject.EnterOutLogData.EnterOutlog.ReadingRoomName, Clientobject.EnterOutLogData.EnterOutlog.ShortSeatNo);
            int newLogId = -1;

            PopupWindowsObject.GetInstance().Window.ShowMessage(EnterOutOperate.AddEnterOutLog(Clientobject.EnterOutLogData.EnterOutlog, ref newLogId) == HandleResult.Failed ? TipType.Exception : TipType.ComeToBack);
            if (Clientobject.EnterOutLogData.Student.AtReadingRoom.Setting.NoManagement.Used)
            {
                List <WaitSeatLogInfo> waitSeatLogs = T_SM_SeatWaiting.GetWaitSeatList("", Clientobject.EnterOutLogData.EnterOutlog.EnterOutLogID, null, null, null);
                if (waitSeatLogs.Count > 0)
                {
                    WaitSeatLogInfo waitSeatLog = waitSeatLogs[0];
                    waitSeatLog.NowState     = LogStatus.Fail;
                    waitSeatLog.OperateType  = Operation.OtherReader;
                    waitSeatLog.WaitingState = EnterOutLogType.WaitingCancel;
                    T_SM_SeatWaiting.UpdateWaitLog(waitSeatLog);
                }
            }
            if (!Clientobject.EnterOutLogData.Student.AtReadingRoom.Setting.SeatUsedTimeLimit.Used)
            {
                return;
            }
            if (Clientobject.EnterOutLogData.Student.CanContinuedTime.AddMinutes(Clientobject.EnterOutLogData.Student.AtReadingRoom.Setting.SeatUsedTimeLimit.CanDelayTime) > ServiceDateTime.Now)
            {
                return;
            }

            if (Clientobject.EnterOutLogData.Student.AtReadingRoom.Setting.SeatUsedTimeLimit.ContinuedTimes == 0 || Clientobject.EnterOutLogData.Student.ContinuedTimeCount < Clientobject.EnterOutLogData.Student.AtReadingRoom.Setting.SeatUsedTimeLimit.ContinuedTimes)
            {
                Clientobject.EnterOutLogData.EnterOutlog.EnterOutState = EnterOutLogType.ContinuedTime;
                Clientobject.EnterOutLogData.EnterOutlog.Flag          = Operation.Service;
                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);

                PopupWindowsObject.GetInstance().Window.ShowMessage(EnterOutOperate.AddEnterOutLog(Clientobject.EnterOutLogData.EnterOutlog, ref newLogId) == HandleResult.Successed ? TipType.AutoContinuedTime : TipType.Exception);
            }
            else
            {
                Clientobject.EnterOutLogData.EnterOutlog.EnterOutState = EnterOutLogType.Leave;
                Clientobject.EnterOutLogData.EnterOutlog.Flag          = Operation.Service;
                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);

                PopupWindowsObject.GetInstance().Window.ShowMessage(EnterOutOperate.AddEnterOutLog(Clientobject.EnterOutLogData.EnterOutlog, ref newLogId) == HandleResult.Successed ? TipType.AutoContinuedTimeNoCount : TipType.Exception);
            }
        }
        /// <summary>
        /// 续时
        /// </summary>
        public void ContinuedTime()
        {
            int newLogId = -1;

            //if (Clientobject.EnterOutLogData.Student.AtReadingRoom.Setting.RoomOpenSet.UninterruptibleModel)
            //{
            //    PopupWindowsObject.GetInstance().Window.ShowMessage(TipType.ContinuedTime);

            //}
            //else
            //{
            //    if (Clientobject.EnterOutLogData.Student.CanContinuedTime.AddMinutes(Clientobject.EnterOutLogData.Student.AtReadingRoom.Setting.SeatUsedTimeLimit.CanDelayTime) >= DateTime.Parse(Clientobject.EnterOutLogData.Student.AtReadingRoom.Setting.RoomOpenSet.DefaultOpenTime.EndTime))
            //    {
            //        PopupWindowsObject.GetInstance().Window.ShowMessage(TipType.ContinuedTimeWithout);
            //        return;
            //    }
            //}
            if (Clientobject.EnterOutLogData.Student.AtReadingRoom.Setting.SeatUsedTimeLimit.CanNotContinuedWithBookNetFixed && Clientobject.EnterOutLogData.Student.AtReadingRoom.Setting.SeatBespeak.Used && Clientobject.EnterOutLogData.Student.AtReadingRoom.Setting.SeatBespeak.SpecifiedBespeak && Clientobject.EnterOutLogData.Student.AtReadingRoom.Setting.SeatBespeak.SpecifiedTime)
            {
                List <BespeakLogInfo> bookList = T_SM_SeatBespeak.GetBespeakLogInfoBySeatNo(Clientobject.EnterOutLogData.EnterOutlog.SeatNo, ServiceDateTime.Now);
                if (bookList.Any(log => Clientobject.EnterOutLogData.Student.CanContinuedTime.AddMinutes(Clientobject.EnterOutLogData.Student.AtReadingRoom.Setting.SeatUsedTimeLimit.CanDelayTime) == log.BsepeakTime))
                {
                    PopupWindowsObject.GetInstance().Window.ShowMessage(TipType.ContinueWithBookLog);
                    return;
                }
            }
            if (Clientobject.EnterOutLogData.Student.CanContinuedTime.AddMinutes(Clientobject.EnterOutLogData.Student.AtReadingRoom.Setting.SeatUsedTimeLimit.CanDelayTime) >= DateTime.Parse(Clientobject.EnterOutLogData.Student.AtReadingRoom.Setting.RoomOpenSet.DefaultOpenTime.EndTime))
            {
                PopupWindowsObject.GetInstance().Window.ShowMessage(TipType.ContinuedTimeWithout);
                return;
            }
            if (Clientobject.EnterOutLogData.Student.CanContinuedTime > ServiceDateTime.Now)
            {
                PopupWindowsObject.GetInstance().Window.ShowMessage(TipType.ContinuedTimeNotTime);
                return;
            }
            if (Clientobject.EnterOutLogData.Student.AtReadingRoom.Setting.SeatUsedTimeLimit.ContinuedTimes != 0 && (Clientobject.EnterOutLogData.Student.ContinuedTimeCount >= Clientobject.EnterOutLogData.Student.AtReadingRoom.Setting.SeatUsedTimeLimit.ContinuedTimes))
            {
                PopupWindowsObject.GetInstance().Window.ShowMessage(TipType.ContinuedTimeNoCount);
                return;
            }

            Clientobject.EnterOutLogData.EnterOutlog.Remark      = string.Format("在终端{0}刷卡延长{1} {2}号座位使用时间", Clientobject.ClientSetting.ClientNo, Clientobject.EnterOutLogData.Student.AtReadingRoom.Name, Clientobject.EnterOutLogData.EnterOutlog.ShortSeatNo);
            Clientobject.EnterOutLogData.EnterOutlog.TerminalNum = Clientobject.ClientSetting.ClientNo;
            HandleResult result = EnterOutOperate.AddEnterOutLog(Clientobject.EnterOutLogData.EnterOutlog, ref newLogId);//插入进出记录

            PopupWindowsObject.GetInstance().Window.ShowMessage(result == HandleResult.Successed ? TipType.ContinuedTime : TipType.Exception);
        }
Beispiel #11
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);
        }
Beispiel #12
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);
        }
 /// <summary>
 /// 分区域排列
 /// </summary>
 public void GetRoomArea()
 {
     try
     {
         //添加区域
         List <LibraryInfo> linList = T_SM_Library.GetLibraryInfoList(null, null, null);
         foreach (AreaInfo area in from lib in linList from area in lib.AreaList where !ReadingRoomUsage.ContainsKey(area.AreaName) select area)
         {
             ReadingRoomUsage.Add(area.AreaName, new List <ReadingRoomUC_ViewModel>());
         }
         if (!ReadingRoomUsage.ContainsKey("阅览室"))
         {
             ReadingRoomUsage.Add("阅览室", new List <ReadingRoomUC_ViewModel>());
         }
         foreach (KeyValuePair <string, ReadingRoomInfo> item in ClientObject.ReadingRoomList)
         {
             if (item.Value.Area.AreaName == "")
             {
                 item.Value.Area.AreaName = "阅览室";
             }
             ReadingRoomUC_ViewModel viewModel = new ReadingRoomUC_ViewModel();
             viewModel.ReadingRoomName = item.Value.Name;
             viewModel.ReadingRoomNo   = item.Value.No;
             viewModel.IsBook          = item.Value.Setting.SeatBespeak.Used;
             viewModel.AllSeatCount    = item.Value.SeatList.Seats.Count(u => u.Value.IsSuspended == false);
             StateList.Add(viewModel.ReadingRoomNo, viewModel);
             ReadingRoomUsage[item.Value.Area.AreaName].Add(StateList[viewModel.ReadingRoomNo]);
         }
         List <string> deleteArea = (from item in ReadingRoomUsage where item.Value.Count < 1 select item.Key).ToList();
         foreach (string a in deleteArea)
         {
             ReadingRoomUsage.Remove(a);
         }
     }
     catch (Exception ex)
     {
         WriteLog.Write("加载阅览室遇到异常" + ex.Message);
         PopupWindowsObject.GetInstance().Window.ShowMessage(TipType.Exception);
     }
 }
Beispiel #14
0
        /// <summary>
        /// 随机选择
        /// </summary>
        /// <returns></returns>
        public bool RandomSeat()
        {
            if (LastSeatCount == 0)
            {
                PopupWindowsObject.GetInstance().Window.ShowMessage(TipType.ReadingRoomFull);
                return(false);
            }
            string tempSeatNo = T_SM_Seat.RandomAllotSeat(ClientObject.EnterOutLogData.EnterOutlog.ReadingRoomNo);

            if (T_SM_Seat.LockSeat(tempSeatNo) != SeatLockState.Locked)//座位锁定失败,则提示
            {
                ClientObject.EnterOutLogData.EnterOutlog.SeatNo = "";
                PopupWindowsObject.GetInstance().Window.ShowMessage(TipType.SeatLocking);
                return(false);
            }
            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);
            ClientObject.EnterOutLogData.FlowControl             = ClientOperation.SelectSeat; //操作为选择座位
            return(true);
        }
Beispiel #15
0
 public void ActiveBook()
 {
     try
     {
         PopupWindowsObject.GetInstance().Window.ShowMessage(TipType.ActivationReadCard);
         if (PopupWindowsObject.GetInstance().Window.ViewModel.OperateResule == HandleResult.Successed)
         {
             ClientObject.EnterOutLogData         = new OperateResult.OperateResult();
             ClientObject.EnterOutLogData.Student = EnterOutOperate.GetReaderInfo(PopupWindowsObject.GetInstance().Window.ViewModel.CardNo);
             if (ClientObject.EnterOutLogData.Student == null)
             {
                 ClientObject.EnterOutLogData.Student = new SeatManage.ClassModel.ReaderInfo()
                 {
                     CardNo = PopupWindowsObject.GetInstance().Window.ViewModel.CardNo
                 };
             }
             SeatManage.ClassModel.UserInfo user = Users_ALL.GetUserInfo(PopupWindowsObject.GetInstance().Window.ViewModel.CardNo);
             if (user != null)
             {
                 if (user.IsUsing == LogStatus.Valid)//判断用户状态是否启用。
                 {
                     PopupWindowsObject.GetInstance().Window.ShowMessage(TipType.CancelActivationWarn);
                     if (PopupWindowsObject.GetInstance().Window.ViewModel.OperateResule == HandleResult.Successed)
                     {
                         user.IsUsing = LogStatus.Fail;//
                         user.Remark  = "终端刷卡注销";
                         Users_ALL.UpdateUserOnlyInfo(user);
                         PopupWindowsObject.GetInstance().Window.ShowMessage(TipType.CancelActivationSuccess);
                     }
                 }
                 else
                 {//如果读者用户状态是失效,则重新激活。
                     user.IsUsing  = LogStatus.Valid;
                     user.Password = MD5Algorithm.GetMD5Str32(PopupWindowsObject.GetInstance().Window.ViewModel.CardNo);
                     user.Remark   = "终端刷卡重新激活";
                     if (Users_ALL.UpdateUserOnlyInfo(user))
                     {
                         PopupWindowsObject.GetInstance().Window.ShowMessage(TipType.ActivationSuccess);
                     }
                 }
             }
             else
             {
                 SeatManage.ClassModel.UserInfo newUser = new SeatManage.ClassModel.UserInfo();
                 newUser.IsUsing  = LogStatus.Valid;
                 newUser.LoginId  = PopupWindowsObject.GetInstance().Window.ViewModel.CardNo;
                 newUser.Password = MD5Algorithm.GetMD5Str32(PopupWindowsObject.GetInstance().Window.ViewModel.CardNo);
                 newUser.UserType = UserType.Reader;
                 newUser.UserName = ClientObject.EnterOutLogData.Student == null ? "" : ClientObject.EnterOutLogData.Student.Name;
                 newUser.Remark   = "在终端刷卡激活";
                 if (Users_ALL.AddNewUser(newUser))
                 {
                     PopupWindowsObject.GetInstance().Window.ShowMessage(TipType.ActivationSuccess);
                 }
             }
             //预约激活处理
         }
     }
     catch (Exception ex)
     {
         WriteLog.Write("预约激活遇到异常" + ex.Message);
         PopupWindowsObject.GetInstance().Window.ShowMessage(TipType.Exception);
     }
     finally
     {
         ClientObject.EnterOutLogData = null;
     }
 }
Beispiel #16
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;
            }
        }
        /// <summary>
        /// 预约等待
        /// </summary>
        public void BespeakCheck()
        {
            if (Clientobject.EnterOutLogData.Student.BespeakLog.Count <= 0)
            {
                return;
            }
            BespeakLogInfo     bespeaklog = Clientobject.EnterOutLogData.Student.BespeakLog[0];
            ReadingRoomSetting set        = Clientobject.EnterOutLogData.Student.AtReadingRoom.Setting;
            DateTime           dtBegin    = bespeaklog.BsepeakTime.AddMinutes(-double.Parse(set.SeatBespeak.ConfirmTime.BeginTime));
            DateTime           dtEnd      = bespeaklog.BsepeakTime.AddMinutes(double.Parse(set.SeatBespeak.ConfirmTime.EndTime));
            DateTime           nowDate    = ServiceDateTime.Now;

            if (DateTimeOperate.DateAccord(dtBegin, dtEnd, nowDate) || (set.SeatBespeak.NowDayBespeak && bespeaklog.SubmitTime == bespeaklog.BsepeakTime))
            {
                //TODO:预约时间在开始时间和结束时间之间,执行预约确认操作
                //TODO:预约确认时,判断当前座位上是否有人。
                EnterOutLogInfo seatUsedInfo = T_SM_EnterOutLog.GetUsingEnterOutLogBySeatNo(bespeaklog.SeatNo);
                if (seatUsedInfo != null && seatUsedInfo.EnterOutState != EnterOutLogType.Leave)
                { //条件满足,说明座位正在使用。
                    seatUsedInfo.EnterOutState = EnterOutLogType.Leave;
                    seatUsedInfo.EnterOutType  = LogStatus.Valid;
                    seatUsedInfo.TerminalNum   = Clientobject.ClientSetting.ClientNo;
                    seatUsedInfo.Remark        = string.Format("预约该座位的读者在终端{0}刷卡确认入座,设置在座读者离开", Clientobject.ClientSetting.ClientNo);
                    seatUsedInfo.Flag          = Operation.OtherReader;
                    int newId = -1;
                    if (EnterOutOperate.AddEnterOutLog(seatUsedInfo, ref newId) == HandleResult.Successed)
                    {
                        List <WaitSeatLogInfo> waitInfoList = T_SM_SeatWaiting.GetWaitSeatList(null, seatUsedInfo.EnterOutLogID, null, null, null);
                        if (waitInfoList.Count > 0)
                        {
                            Clientobject.EnterOutLogData.WaitSeatLogModel              = waitInfoList[0];
                            Clientobject.EnterOutLogData.WaitSeatLogModel.OperateType  = Operation.Reader;
                            Clientobject.EnterOutLogData.WaitSeatLogModel.WaitingState = EnterOutLogType.WaitingCancel;
                            Clientobject.EnterOutLogData.WaitSeatLogModel.NowState     = LogStatus.Valid;
                            if (!T_SM_SeatWaiting.UpdateWaitLog(Clientobject.EnterOutLogData.WaitSeatLogModel))
                            {
                                PopupWindowsObject.GetInstance().Window.ShowMessage(TipType.Exception);
                                return;
                            }
                        }
                    }
                    else
                    {
                        PopupWindowsObject.GetInstance().Window.ShowMessage(TipType.Exception);
                        return;
                    }
                }
                EnterOutLogInfo newEnterOutLog = new EnterOutLogInfo();//构造
                newEnterOutLog.CardNo                    = bespeaklog.CardNo;
                newEnterOutLog.EnterOutLogNo             = SeatComm.RndNum();
                newEnterOutLog.EnterOutState             = EnterOutLogType.BookingConfirmation;
                newEnterOutLog.EnterOutType              = LogStatus.Valid;
                newEnterOutLog.Flag                      = Operation.Reader;
                newEnterOutLog.ReadingRoomNo             = bespeaklog.ReadingRoomNo;
                newEnterOutLog.ReadingRoomName           = bespeaklog.ReadingRoomName;
                newEnterOutLog.ShortSeatNo               = bespeaklog.ShortSeatNum;
                newEnterOutLog.SeatNo                    = bespeaklog.SeatNo;
                newEnterOutLog.TerminalNum               = Clientobject.ClientSetting.ClientNo;
                newEnterOutLog.Remark                    = string.Format("在终端{0}刷卡,入座预约的{1} {2}号座位", Clientobject.ClientSetting.ClientNo, bespeaklog.ReadingRoomName, bespeaklog.ShortSeatNum);
                Clientobject.EnterOutLogData.EnterOutlog = newEnterOutLog;
                int          logid  = -1;
                HandleResult result = EnterOutOperate.AddEnterOutLog(newEnterOutLog, ref logid); //添加入座记录
                if (result == HandleResult.Successed)
                {
                    bespeaklog.BsepeakState = BookingStatus.Confinmed;
                    bespeaklog.CancelPerson = Operation.Reader;
                    bespeaklog.CancelTime   = nowDate;
                    bespeaklog.Remark       = string.Format("在终端{0}刷卡,入座预约的{1} {2}号座位", Clientobject.ClientSetting.ClientNo,
                                                            bespeaklog.ReadingRoomName, bespeaklog.ShortSeatNum);
                    T_SM_SeatBespeak.UpdateBespeakList(bespeaklog);

                    PrintData data = new PrintData();
                    data.CardNo = bespeaklog.CardNo;
                    ;
                    data.EnterTime       = nowDate;
                    data.ReaderName      = Clientobject.EnterOutLogData.Student.Name;
                    data.ReadingRoomName = Clientobject.EnterOutLogData.Student.AtReadingRoom.Name;
                    data.SeatNo          = SeatComm.SeatNoToShortSeatNo(set.SeatNumAmount, bespeaklog.SeatNo);

                    switch (Clientobject.ClientSetting.DeviceSetting.UsingPrintSlip)
                    {
                    case PrintSlipMode.AutoPrint:
                        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)
                        {
                            printer.ThreadPrint(PrintStatus.General, data, Clientobject.ClientSetting.ClientNo);
                        }
                        break;

                    case PrintSlipMode.NotPrint:
                        break;
                    }

                    PopupWindowsObject.GetInstance().Window.ShowMessage(TipType.BespeatSeatConfirmSuccess);
                }
                else
                {
                    PopupWindowsObject.GetInstance().Window.ShowMessage(TipType.Exception);
                }
            }
            else if (nowDate.CompareTo(dtBegin) < 0)
            {
                //TODO:预约时间过早,请在dtBegin 到dtEnd刷卡确认。
                PopupWindowsObject.GetInstance().Window.ShowMessage(TipType.BookConfirmWarn);
                if (PopupWindowsObject.GetInstance().Window.ViewModel.OperateResule != HandleResult.Successed)
                {
                    return;
                }
                bespeaklog.BsepeakState = BookingStatus.Cencaled;
                bespeaklog.CancelPerson = Operation.Reader;
                bespeaklog.CancelTime   = ServiceDateTime.Now;
                bespeaklog.Remark       = string.Format("在终端{0}刷卡取消{1},{2}号座位的预约。", Clientobject.ClientSetting.ClientNo, bespeaklog.ReadingRoomName, bespeaklog.ShortSeatNum);
                int i = T_SM_SeatBespeak.UpdateBespeakList(bespeaklog);
                PopupWindowsObject.GetInstance().Window.ShowMessage(TipType.BookCancelSuccess);
            }
        }
        /// <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);
            }
        }
Beispiel #19
0
        void seatLayout()
        {
            canvas_Thumbnail.Children.Clear();
            canvas_Seat.Children.Clear();//座位图中移除所有子元素

            viewModel.AllSeatCount = viewModel.Layout.Seats.Count;

            int SeatWidth  = 24 * viewModel.Layout.SeatCol;
            int SeatHeight = 24 * viewModel.Layout.SeatRow;

            this.canvas_Seat.Width  = SeatWidth;
            this.canvas_Seat.Height = SeatHeight;
            //设置空间最小尺寸
            if (viewModel.WindowWidth <= 1080)
            {
                G_bg.Width = 1080;
            }
            else
            {
                G_bg.Width = viewModel.WindowWidth;
            }
            if (viewModel.WindowHeight <= 1000)
            {
                G_bg.Height = 1000;
            }
            else
            {
                G_bg.Height = viewModel.WindowHeight;
            }
            if (G_bg.Width == 1080 || G_bg.Height == 1000)
            {
                if (G_bg.Height <= G_bg.Width)
                {
                    G_bg.Width = viewModel.WindowWidth * (G_bg.Height / viewModel.WindowHeight);
                }
                else
                {
                    G_bg.Height = viewModel.WindowHeight * (G_bg.Width / viewModel.WindowWidth);
                }
            }

            float areaScaleX = (float)(SeatWidth / (G_bg.Width - SeatWindow.Margin.Left - SeatWindow.Margin.Right));
            float areaScaleY = (float)(SeatHeight / (G_bg.Height - SeatWindow.Margin.Top - SeatWindow.Margin.Bottom));

            if (SeatWidth >= SeatHeight)
            {
                scaleX = (float)(SeatWidth / canvas_Thumbnail.Width);
                scaleY = (float)(SeatWidth / canvas_Thumbnail.Height);
                moveY  = (SeatWidth - SeatHeight) / 2 / scaleY;
            }
            else
            {
                scaleX = (float)(SeatHeight / canvas_Thumbnail.Width);
                scaleY = (float)(SeatHeight / canvas_Thumbnail.Height);
                moveX  = (SeatHeight - SeatWidth) / 2 / scaleX;
            }

            try
            {
                Canvas.SetLeft(canvas_Seat, 0);
                Canvas.SetTop(canvas_Seat, 0);
            }
            catch
            {
                PopupWindowsObject.GetInstance().Window.ShowMessage(SeatManage.EnumType.TipType.Exception);
                WinClosing();
            }

            seatLayout_seat();
            seatLayout_note();

            areaSimle      = new Rectangle();
            areaSimle.Name = "areaSimle";
            if (areaScaleX != 0)
            {
                areaSimle.Width = (canvas_Thumbnail.Width - moveX * 2) / areaScaleX;//按比例缩小层的宽度
            }
            else
            {
                areaSimle.Width = canvas_Thumbnail.Width;
            }
            if (areaScaleY != 0)
            {
                areaSimle.Height = (canvas_Thumbnail.Height - moveY * 2) / areaScaleY; //按比例缩小层的高度
            }
            else
            {
                areaSimle.Height = canvas_Thumbnail.Height;
            }

            areaSimle.Fill    = new SolidColorBrush(Colors.White);
            areaSimle.Opacity = 0.5;

            canvas_Thumbnail.Children.Add(areaSimle);
            Panel.SetZIndex(areaSimle, 1000);
            Canvas.SetTop(areaSimle, moveY);
            Canvas.SetLeft(areaSimle, moveX);
            //小的范围层。最后创建,防止被遮盖
        }
Beispiel #20
0
        void seatLayout()
        {
            canvas_Thumbnail.Children.Clear();
            canvas_Seat.Children.Clear();//座位图中移除所有子元素

            viewModel.AllSeatCount = viewModel.Layout.Seats.Count;

            int SeatWidth  = 24 * viewModel.Layout.SeatCol;
            int SeatHeight = 24 * viewModel.Layout.SeatRow;

            this.canvas_Seat.Width  = SeatWidth;
            this.canvas_Seat.Height = SeatHeight;
            //设置空间最小尺寸
            if (viewModel.WindowWidth <= 1080)
            {
                G_bg.Width = 1080;
            }
            else
            {
                G_bg.Width = viewModel.WindowWidth;
            }
            if (viewModel.WindowHeight <= 1000)
            {
                G_bg.Height = 1000;
            }
            else
            {
                G_bg.Height = viewModel.WindowHeight;
            }
            if (G_bg.Width == 1080 || G_bg.Height == 1000)
            {
                if (G_bg.Height <= G_bg.Width)
                {
                    G_bg.Width = viewModel.WindowWidth * (G_bg.Height / viewModel.WindowHeight);
                }
                else
                {
                    G_bg.Height = viewModel.WindowHeight * (G_bg.Width / viewModel.WindowWidth);
                }
            }

            double areaScaleX = SeatWidth / (G_bg.Width - SeatWindow.Margin.Left - SeatWindow.Margin.Right);
            double areaScaleY = SeatHeight / (G_bg.Height - SeatWindow.Margin.Top - SeatWindow.Margin.Bottom);

            if (SeatWidth >= SeatHeight)
            {
                scaleX = SeatWidth / canvas_Thumbnail.Width;
                scaleY = SeatWidth / canvas_Thumbnail.Height;
                moveY  = (SeatWidth - SeatHeight) / 2 / scaleY;
            }
            else
            {
                scaleX = SeatHeight / canvas_Thumbnail.Width;
                scaleY = SeatHeight / canvas_Thumbnail.Height;
                moveX  = (SeatHeight - SeatWidth) / 2 / scaleX;
            }

            try
            {
                Canvas.SetLeft(canvas_Seat, 0);
                Canvas.SetTop(canvas_Seat, 0);
            }
            catch
            {
                PopupWindowsObject.GetInstance().Window.ShowMessage(SeatManage.EnumType.TipType.Exception);
                WinClosing();
            }

            #region 布局座位
            foreach (KeyValuePair <string, Seat> seat in viewModel.Layout.Seats)
            {
                #region 布局实际图,
                double  canLeft = 24 * seat.Value.PositionX;
                double  canTop  = 24 * seat.Value.PositionY;
                UC_Seat seatUC  = new UC_Seat(viewModel.SeatLayoutList[seat.Key]);
                seatUC.Width  = 48;
                seatUC.Height = 48;

                seatUC.LblSeatNo.RenderTransform       = new RotateTransform(-seat.Value.RotationAngle);
                seatUC.LblSeatNo.RenderTransformOrigin = new Point(0.5, 0.5);
                seatUC.RenderTransform       = new RotateTransform(seat.Value.RotationAngle);
                seatUC.RenderTransformOrigin = new Point(0.5, 0.5);
                canvas_Seat.Children.Add(seatUC);
                Canvas.SetLeft(seatUC, canLeft);
                Canvas.SetTop(seatUC, canTop);
                #endregion

                #region 布局缩略图
                Rectangle rec = new Rectangle();
                rec.Width  = 36 / scaleX;
                rec.Height = 36 / scaleY;
                double thumbLeft = (seat.Value.PositionX * 24 + 6) / scaleX;
                double thumbTop  = (seat.Value.PositionY * 24 + 6) / scaleY;
                if (viewModel.SeatLayoutList[seat.Key].IsStop || viewModel.SeatLayoutList[seat.Key].IsUsing)
                {
                    rec.Fill = new SolidColorBrush(Color.FromRgb(234, 38, 52));
                }
                else
                {
                    rec.Fill = new SolidColorBrush(Color.FromRgb(220, 220, 220));
                }
                rec.RenderTransformOrigin = new Point(0.5, 0.5);
                rec.RenderTransform       = new RotateTransform(seat.Value.RotationAngle);
                canvas_Thumbnail.Children.Add(rec);
                Panel.SetZIndex(rec, 0);
                Canvas.SetLeft(rec, thumbLeft + moveX);
                Canvas.SetTop(rec, thumbTop + moveY);
                #endregion
            }
            #endregion

            #region 布局备注
            foreach (Note note in viewModel.Layout.Notes)
            {
                #region 实际图

                ViewModel.NoteUC_ViewModel noteVM = new ViewModel.NoteUC_ViewModel();
                noteVM.Notes    = note.Remark;
                noteVM.NoteType = note.Type;
                UC_Note element = new UC_Note(noteVM);
                if (note.Type == SeatManage.EnumType.OrnamentType.Table)
                {
                    element.BorderThickness = new Thickness(1);
                    element.BorderBrush     = new SolidColorBrush(Colors.Black);
                }
                element.Width  = note.BaseWidth * 24;
                element.Height = note.BaseHeight * 24;
                element.RenderTransformOrigin = new Point(0.5, 0.5);
                element.RenderTransform       = new RotateTransform(note.RotationAngle);
                canvas_Seat.Children.Add(element);
                double canLeft = 24 * note.PositionX;
                double canTop  = 24 * note.PositionY;
                Canvas.SetLeft(element, canLeft);
                Canvas.SetTop(element, canTop);
                #endregion

                #region 缩略图

                switch (note.Type)
                {
                case SeatManage.EnumType.OrnamentType.Door:
                case SeatManage.EnumType.OrnamentType.Steps:
                    break;

                case SeatManage.EnumType.OrnamentType.Roundtable:
                case SeatManage.EnumType.OrnamentType.Plant:
                {
                    Border br = new Border();
                    br.CornerRadius    = new CornerRadius(note.BaseWidth * 12 / scaleX);
                    br.BorderThickness = new Thickness(note.BaseWidth * 12 / scaleX);
                    br.BorderBrush     = new SolidColorBrush(Color.FromRgb(231, 186, 100));
                    double thumbLeft = 24 / scaleX * note.PositionX;
                    double thumbTop  = 24 / scaleY * note.PositionY;
                    canvas_Thumbnail.Children.Add(br);
                    Canvas.SetLeft(br, thumbLeft + moveX);
                    Canvas.SetTop(br, thumbTop + moveY);
                }
                break;

                default:
                {
                    Rectangle rec = new Rectangle();
                    rec.Width  = 24 * note.BaseWidth / scaleX;
                    rec.Height = 24 * note.BaseHeight / scaleY;
                    double thumbLeft = 24 / scaleX * note.PositionX;
                    double thumbTop  = 24 / scaleY * note.PositionY;
                    rec.RenderTransformOrigin = new Point(0.5, 0.5);
                    rec.RenderTransform       = new RotateTransform(note.RotationAngle);
                    rec.Fill = new SolidColorBrush(Color.FromRgb(231, 186, 100));
                    canvas_Thumbnail.Children.Add(rec);
                    Canvas.SetLeft(rec, thumbLeft + moveX);
                    Canvas.SetTop(rec, thumbTop + moveY);
                }
                break;
                }
                #endregion
            }
            #endregion


            areaSimle      = new Rectangle();
            areaSimle.Name = "areaSimle";
            if (areaScaleX != 0)
            {
                areaSimle.Width = (canvas_Thumbnail.Width - moveX * 2) / areaScaleX;//按比例缩小层的宽度
            }
            else
            {
                areaSimle.Width = canvas_Thumbnail.Width;
            }
            if (areaScaleY != 0)
            {
                areaSimle.Height = (canvas_Thumbnail.Height - moveY * 2) / areaScaleY; //按比例缩小层的高度
            }
            else
            {
                areaSimle.Height = canvas_Thumbnail.Height;
            }

            areaSimle.Fill    = new SolidColorBrush(Colors.White);
            areaSimle.Opacity = 0.5;

            canvas_Thumbnail.Children.Add(areaSimle);
            Panel.SetZIndex(areaSimle, 1000);
            Canvas.SetTop(areaSimle, moveY);
            Canvas.SetLeft(areaSimle, moveX);
            //小的范围层。最后创建,防止被遮盖
        }
        /// <summary>
        /// 进入阅览室前判断
        /// </summary>
        /// <param name="roomNo"></param>
        public void EnterReadingRoom(ReadingRoomUC_ViewModel vm_Room)
        {
            try
            {
                //ClientObject.EnterOutLogData.FlowControl = ClientOperation.Back;
                ClientObject.EnterOutLogData.EnterOutlog.ReadingRoomNo = vm_Room.ReadingRoomNo;
                ReadingRoomInfo roomInfo = T_SM_ReadingRoom.GetSingleRoomInfo(vm_Room.ReadingRoomNo);
                if (vm_Room.Status == ReadingRoomStatus.Close || vm_Room.Status == ReadingRoomStatus.BeforeClose)
                {
                    ClientObject.EnterOutLogData.Student.AtReadingRoom = roomInfo;
                    PopupWindowsObject.GetInstance().Window.ShowMessage(TipType.ReadingRoomClosing);
                    ClientObject.EnterOutLogData.Student.AtReadingRoom = null;
                    return;
                }
                if (vm_Room.Usage == ReadingRoomUsingStatus.Full && (!roomInfo.Setting.NoManagement.Used))
                {
                    PopupWindowsObject.GetInstance().Window.ShowMessage(TipType.ReadingRoomFull);
                    return;
                }
                ClientObject.EnterOutLogData.Student.AtReadingRoom = roomInfo;//给读者所在的阅览室赋值。

                //验证读者身份是否允许选择该阅览室。
                if (!SelectSeatProven.ProvenReaderType(ClientObject.EnterOutLogData.Student, roomInfo.Setting))
                {
                    PopupWindowsObject.GetInstance().Window.ShowMessage(TipType.ReaderTypeInconformity);
                    return;
                }
                //验证读者黑名单,选座次数。
                if (SelectSeatProven.ProvenReaderState(ClientObject.EnterOutLogData.Student, roomInfo, ClientObject.RegulationRulesSet.BlacklistSet, ClientObject.ClientSetting.DeviceSetting))
                {
                    ClientObject.EnterOutLogData.EnterOutlog.ReadingRoomNo = "";
                    return;
                }
                //TODO:验证终端选座方式
                if (vm_Room.Usage == ReadingRoomUsingStatus.Full && roomInfo.Setting.NoManagement.Used)
                {
                    ClientObject.EnterOutLogData.FlowControl = ClientOperation.SelectSeat;
                    ClientObject.EnterOutLogData.EnterOutlog.ReadingRoomNo   = roomInfo.No;
                    ClientObject.EnterOutLogData.EnterOutlog.ReadingRoomName = roomInfo.Name;
                    //ReadingRoomWindowObject.GetInstance().Window.Hide();
                    RoomSeatWindowObject.GetInstance(roomInfo.No).Window[roomInfo.No].ShowMessage();
                }
                else
                {
                    SelectSeatMode selectSeatMethod = SelectSeatProven.ProvenSelectSeatMethod(ClientObject.ClientSetting.DeviceSetting, roomInfo.Setting.SeatChooseMethod);

                    if (selectSeatMethod == SelectSeatMode.OptionalMode || selectSeatMethod == SelectSeatMode.ManualMode)
                    {
                        ClientObject.EnterOutLogData.FlowControl = ClientOperation.SelectSeat;
                        ClientObject.EnterOutLogData.EnterOutlog.ReadingRoomNo   = roomInfo.No;
                        ClientObject.EnterOutLogData.EnterOutlog.ReadingRoomName = roomInfo.Name;
                        //ReadingRoomWindowObject.GetInstance().Window.Hide();
                        RoomSeatWindowObject.GetInstance(roomInfo.No).Window[roomInfo.No].ShowMessage();
                    }
                    else
                    {
                        ClientObject.EnterOutLogData.EnterOutlog.ReadingRoomNo   = roomInfo.No;
                        ClientObject.EnterOutLogData.EnterOutlog.ReadingRoomName = roomInfo.Name;
                        string tempSeatNo = T_SM_Seat.RandomAllotSeat(ClientObject.EnterOutLogData.EnterOutlog.ReadingRoomNo);
                        if (T_SM_Seat.LockSeat(tempSeatNo) != SeatLockState.Locked)//座位锁定失败,则提示
                        {
                            ClientObject.EnterOutLogData.EnterOutlog.SeatNo = "";
                            PopupWindowsObject.GetInstance().Window.ShowMessage(TipType.SeatLocking);
                            return;
                        }
                        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);
                        ClientObject.EnterOutLogData.FlowControl             = ClientOperation.SelectSeat; //操作为选择座位
                    }
                }
                //RoomSeatWindowObject.GetInstance(roomInfo.No).Window[roomInfo.No] = null;
            }
            catch (Exception ex)
            {
                WriteLog.Write("加载阅览室遇到异常" + ex.Message);
                PopupWindowsObject.GetInstance().Window.ShowMessage(TipType.Exception);
            }
        }
Beispiel #22
0
        /// <summary>
        /// 确认座位号
        /// </summary>
        /// <returns></returns>
        public bool CheckSeatNumber()
        {
            if (string.IsNullOrEmpty(SeatNo))
            {
                PopupWindowsObject.GetInstance().Window.ShowMessage(SeatManage.EnumType.TipType.SeatNotExists);
                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)
            {
                PopupWindowsObject.GetInstance().Window.ShowMessage(SeatManage.EnumType.TipType.SeatNotExists);
                return(false);
            }
            if (seat.IsSuspended)
            {
                PopupWindowsObject.GetInstance().Window.ShowMessage(SeatManage.EnumType.TipType.SeatStopping);
                return(false);
            }
            if (seat.ReadingRoomNum != roomInfo.No)
            {
                PopupWindowsObject.GetInstance().Window.ShowMessage(SeatManage.EnumType.TipType.SeatNotExists);
                return(false);
            }

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

            if (logType == SeatManage.EnumType.EnterOutLogType.None || logType == SeatManage.EnumType.EnterOutLogType.Leave)
            {
                //根据座位号获取进出记录的状态,如果为None或者为Leave,则锁定座位
                SeatManage.EnumType.SeatLockState lockResult = T_SM_Seat.LockSeat(_LongSeatNo);
                if (lockResult == SeatManage.EnumType.SeatLockState.NotExists)
                {
                    PopupWindowsObject.GetInstance().Window.ShowMessage(SeatManage.EnumType.TipType.SeatNotExists);
                    return(false);
                }
                if (lockResult == SeatManage.EnumType.SeatLockState.Locked)
                {
                    return(true);
                }
                PopupWindowsObject.GetInstance().Window.ShowMessage(SeatManage.EnumType.TipType.SeatUsing);
                return(false);
            }
            else if (logType == SeatManage.EnumType.EnterOutLogType.BespeakWaiting)
            {
                PopupWindowsObject.GetInstance().Window.ShowMessage(SeatManage.EnumType.TipType.SeatUsing);
                return(false);
            }
            else
            {
                PopupWindowsObject.GetInstance().Window.ShowMessage(SeatManage.EnumType.TipType.SeatUsing);
                return(false);
            }
        }