private void btnOftenSeat_Click(object sender, System.EventArgs e)
        {
            FrmOftenSeat frm = new FrmOftenSeat();

            formClose.Pause();
            frm.ShowDialog();
            formClose.Start();
            if (!string.IsNullOrEmpty(clientObject.EnterOutLogData.EnterOutlog.SeatNo))
            {
                this.Close();
            }
        }
示例#2
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();
            }
        }