Exemple #1
0
        /// <summary>
        /// 初始化常坐座位按钮
        /// </summary>
        public void InitiallizeOftenSeat(List <Seat> seats)
        {
            try
            {
                int seatBtnX = 4;
                int seatBtnY = 53;
                if (seats.Count == 0)
                {
                    OftenUsedSeatButton seatBtn = new OftenUsedSeatButton();
                    seatBtn.Text     = "暂无常坐座位";
                    seatBtn.Location = new Point(seatBtnX, seatBtnY);
                    this.Controls.Add(seatBtn);
                }
                else
                {
                    for (int i = 0; i < seats.Count; i++)
                    {
                        ReadingRoomInfo roomInfo = clientobject.ReadingRoomList[seats[i].ReadingRoomNum];
                        seats[i].ShortSeatNo = SeatComm.SeatNoToShortSeatNo(roomInfo.Setting.SeatNumAmount, seats[i].SeatNo);
                        OftenUsedSeatButton seatBtn = new OftenUsedSeatButton();
                        seatBtn.ReadingRoomNo   = seats[i].ReadingRoomNum;
                        seatBtn.ReadingRoomName = roomInfo.Name;
                        seatBtn.SeatNo          = seats[i].SeatNo;
                        seatBtn.ShortSeatNo     = seats[i].ShortSeatNo;
                        seatBtn.Location        = new Point(seatBtnX, seatBtnY);
                        seatBtn.Click          += new EventHandler(seatBtn_Click);
                        this.Controls.Add(seatBtn);

                        seatBtnX += 165;
                        if ((i + 1) % 3 == 0)
                        {
                            seatBtnX  = 4;
                            seatBtnY += 53;
                        }
                        if ((i + 1) > clientobject.ClientSetting.DeviceSetting.UsingOftenUsedSeat.SeatCount)
                        {
                            break;
                        }
                    }
                }
            }
            catch
            {
                SeatManage.SeatClient.Tip.Tip_Framework tip = new SeatManage.SeatClient.Tip.Tip_Framework(SeatManage.EnumType.TipType.Exception, 7);//显示提示窗体
                tip.ShowDialog();
                clientobject.EnterOutLogData.EnterOutlog.SeatNo = "";
            }
        }
Exemple #2
0
 private void FrmOftenSeat_Load(object sender, EventArgs e)
 {
     try
     {
         string        cardNo   = clientobject.EnterOutLogData.EnterOutlog.CardNo;
         int           days     = clientobject.ClientSetting.DeviceSetting.UsingOftenUsedSeat.LengthDays;
         List <string> roomNums = clientobject.ClientSetting.DeviceSetting.Rooms;
         List <Seat>   seats    = T_SM_Seat.GetReaderOftenUsedSeat(cardNo, days, roomNums);
         InitiallizeOftenSeat(seats);
     }
     catch (Exception ex)
     {
         WriteLog.Write(string.Format("常坐座位窗体初始化遇到异常:{0}", ex.Message));
         SeatManage.SeatClient.Tip.Tip_Framework tip = new SeatManage.SeatClient.Tip.Tip_Framework(SeatManage.EnumType.TipType.Exception, 7);//显示提示窗体
         tip.ShowDialog();
     }
 }
Exemple #3
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)
            {
            }
        }
Exemple #4
0
        void seatBtn_Click(object sender, EventArgs e)
        {
            try
            {
                OftenUsedSeatButton seatBtn = sender as OftenUsedSeatButton;
                if (string.IsNullOrEmpty(seatBtn.SeatNo))
                {
                    return;
                }
                ReadingRoomInfo roomInfo = clientobject.ReadingRoomList[seatBtn.ReadingRoomNo];
                if (seatBtn != null)
                {
                    #region 验证黑名单
                    if (SelectSeatProven.ProvenReaderState(clientobject.EnterOutLogData.Student, roomInfo, clientobject.RegulationRulesSet.BlacklistSet, clientobject.ClientSetting.DeviceSetting))
                    {
                        clientobject.EnterOutLogData.EnterOutlog.SeatNo = "";
                        return;
                    }
                    #endregion

                    #region 检查阅览室当前状态
                    ReadingRoomStatus roomState = NowReadingRoomState.ReadingRoomOpenState(roomInfo.Setting.RoomOpenSet, ServiceDateTime.Now);
                    if (roomState == ReadingRoomStatus.Close || roomState == ReadingRoomStatus.BeforeClose)
                    {
                        SeatManage.SeatClient.Tip.Tip_Framework tip = new SeatManage.SeatClient.Tip.Tip_Framework(SeatManage.EnumType.TipType.ReadingRoomClosing, 7);//显示提示窗体
                        tip.ShowDialog();
                        clientobject.EnterOutLogData.EnterOutlog.SeatNo = "";
                        return;
                    }
                    #endregion


                    #region 锁定座位。
                    SeatManage.EnumType.SeatLockState lockseat = T_SM_Seat.LockSeat(seatBtn.SeatNo);
                    if (lockseat == SeatManage.EnumType.SeatLockState.Locked)//座位成功加锁
                    {
                        string roomName = seatBtn.ReadingRoomName;
                        string seatNo   = seatBtn.ShortSeatNo;
                        clientobject.EnterOutLogData.Student.AtReadingRoom     = roomInfo;
                        clientobject.EnterOutLogData.EnterOutlog.SeatNo        = seatBtn.SeatNo;
                        clientobject.EnterOutLogData.EnterOutlog.TerminalNum   = clientobject.ClientSetting.ClientNo;
                        clientobject.EnterOutLogData.FlowControl               = SeatManage.EnumType.ClientOperation.SelectSeat; //操作为选择座位
                        clientobject.EnterOutLogData.EnterOutlog.ReadingRoomNo = seatBtn.ReadingRoomNo;
                        clientobject.EnterOutLogData.EnterOutlog.Remark        = string.Format("在终端{0}选择常坐座位,{1},{2}号座位", clientobject.ClientSetting.ClientNo, roomName, seatNo);
                        this.Close();
                        this.Dispose();
                    }
                    else if (lockseat == SeatManage.EnumType.SeatLockState.UnLock)                                                                             //没有成功加锁
                    {
                        SeatManage.SeatClient.Tip.Tip_Framework tip = new SeatManage.SeatClient.Tip.Tip_Framework(SeatManage.EnumType.TipType.SeatLocking, 7); //显示提示窗体
                        tip.ShowDialog();
                        clientobject.EnterOutLogData.EnterOutlog.SeatNo = "";
                    }
                    #endregion
                }
            }
            catch (Exception ex)
            {
                WriteLog.Write(string.Format("选择常坐座位遇到异常:{0}", ex.Message));
                SeatManage.SeatClient.Tip.Tip_Framework tip = new SeatManage.SeatClient.Tip.Tip_Framework(SeatManage.EnumType.TipType.Exception, 7);//显示提示窗体
                tip.ShowDialog();
                clientobject.EnterOutLogData.EnterOutlog.SeatNo = "";
            }
        }
Exemple #5
0
        private void InitializeComponentPart2()
        {
            try
            {
                if (clientObject.ClientSetting == null)
                {
                    SeatManage.SeatClient.Tip.Tip_Framework tip = new SeatManage.SeatClient.Tip.Tip_Framework(SeatManage.EnumType.TipType.Exception, 7);//显示提示窗体
                    tip.ShowDialog();
                    return;
                }
                clientObject.UpdateConfigError += new EventHandler(clientObject_UpdateConfigError);
                clientObject.UpdateForm        += new EventHandler(clientObject_UpdateForm);

                #region 初始化窗体大小、位置和背景
                this.BackgroundImage = clientObject.BackgroundImagesResource["EnterOutForm"]; //背景图片
                this.Location        = new Point(clientObject.ClientSetting.DeviceSetting.SystemResoultion.WindowSize.Location.X, clientObject.ClientSetting.DeviceSetting.SystemResoultion.WindowSize.Location.Y);
                this.Size            = new System.Drawing.Size(clientObject.ClientSetting.DeviceSetting.SystemResoultion.WindowSize.Size.X, clientObject.ClientSetting.DeviceSetting.SystemResoultion.WindowSize.Size.Y);
                if (clientObject.ClientSetting.DeviceSetting.SystemResoultion.WindowSize.Size.X == 1080)
                {
                    if (clientObject.HardAdvert != null && clientObject.HardAdvert.AdvertImage != null)
                    {
                        picBoxPartnersLogo.BackgroundImage = ImageStream.StreamToImage(clientObject.HardAdvert.AdvertImage);
                    }
                    labnotice.Location = new System.Drawing.Point(720, 860);

                    picBoxPartnersLogo.Size     = new Size(1080, 520);
                    picBoxPartnersLogo.Location = new Point(0, 225);

                    BookActivation.Location        = new Point(390, 850);
                    BookActivation.Size            = new Size(137, 54);
                    BookActivation.BackgroundImage = clientObject.BackgroundImagesResource["BookActivation"];
                    BookActivation.Visible         = clientObject.ClientSetting.DeviceSetting.UsingActiveBespeakSeat;
                    if (clientObject.ClientSetting.DeviceSetting.UsingActiveBespeakSeat)
                    {
                        btnQureyLog.Location = new Point(550, 850);
                    }
                    else
                    {
                        btnQureyLog.Location = new Point(470, 850);
                    }
                    btnQureyLog.Size            = new Size(137, 54);
                    btnQureyLog.BackgroundImage = clientObject.BackgroundImagesResource["btnQureyLog"];
                }
                else if (clientObject.ClientSetting.DeviceSetting.SystemResoultion.WindowSize.Size.X == 1024)
                {
                    if (clientObject.HardAdvert != null && clientObject.HardAdvert.AdvertImage != null)
                    {
                        picBoxPartnersLogo.BackgroundImage = ImageStream.StreamToImage(clientObject.HardAdvert.AdvertImage);
                    }
                    labnotice.Location = new System.Drawing.Point(719, 627);

                    picBoxPartnersLogo.Size     = new Size(1024, 406);
                    picBoxPartnersLogo.Location = new Point(0, 170);

                    BookActivation.Location        = new Point(360, 650);
                    BookActivation.Size            = new Size(137, 54);
                    BookActivation.BackgroundImage = clientObject.BackgroundImagesResource["BookActivation"];
                    BookActivation.Visible         = clientObject.ClientSetting.DeviceSetting.UsingActiveBespeakSeat;
                    if (clientObject.ClientSetting.DeviceSetting.UsingActiveBespeakSeat)
                    {
                        btnQureyLog.Location = new Point(525, 650);
                    }
                    else
                    {
                        btnQureyLog.Location = new Point(445, 650);
                    }
                    btnQureyLog.Size            = new Size(137, 54);
                    btnQureyLog.BackgroundImage = clientObject.BackgroundImagesResource["btnQureyLog"];
                    lblDate.Location            = new Point(350, 8);
                    lblTime.Location            = new Point(595, 8);
                }

                BookActivation.Visible = clientObject.ClientSetting.DeviceSetting.UsingActiveBespeakSeat;
                btnResetPOS.Visible    = clientObject.ClientSetting.DeviceSetting.IsShowInitPOS;
                #endregion
                #region 初始化读卡器接口对象

                try
                {
                    // ApplicationInitialize.CheckCardReader();
                    if (clientObject.ObjCardReader != null)
                    {
                        clientObject.ObjCardReader.CardNoGeted += new EventPosCardNo(ObjCardReader_CardNoGeted);
                        clientObject.ObjCardReader.Start();
                        btnResetPOS.Visible = clientObject.ClientSetting.DeviceSetting.IsShowInitPOS;
                        textBox1.Visible    = false;
                        button3.Visible     = false;
                    }
                    else
                    {
                        textBox1.Visible = true;
                        button3.Visible  = true;
                    }
                }
                catch
                (Exception ex)
                {
                    MessageBox.Show("读卡器初始化失败");
                }

                #endregion
            }
            catch (KeyNotFoundException ex)
            {
                SeatManage.SeatManageComm.WriteLog.Write("系统初始化错误:背景图片出现异常," + ex.Message);
                return;
            }
            catch (Exception ex)
            {
                SeatManage.SeatManageComm.WriteLog.Write("系统初始化错误:" + ex.Message);
                //TODO:系统执行错误提示
                SeatManage.SeatClient.Tip.Tip_Framework tip = new SeatManage.SeatClient.Tip.Tip_Framework(SeatManage.EnumType.TipType.Exception, 7);//显示提示窗体
                tip.ShowDialog();
                return;
            }
        }
Exemple #6
0
        /// <summary>
        /// 刷卡结果处理
        /// </summary>
        private void PosCardHandle(string cardNo)
        {
            WPF_ReaderInfo.MainWindow read = new WPF_ReaderInfo.MainWindow();


            try
            {
                clientObject.EnterOutLogData.Student = 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

                posCardHandle.ShowNotice();
                read.reader.ReaderInfo = clientObject.EnterOutLogData.Student;
                if (clientObject.ClientSetting.DeviceSetting.SystemResoultion.WindowSize.Size.X == 1080)
                {
                    read.Left = 0;
                    read.Top  = 720;
                }
                else
                {
                    read.Left = 1024;
                    read.Top  = 0;
                }
                read.Width  = 350;
                read.Height = 200;
                read.Show();

                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)
            {
                WriteLog.Write(string.Format("执行遇到错误:{0}", ex.Message));
                SeatManage.SeatClient.Tip.Tip_Framework tip = new SeatManage.SeatClient.Tip.Tip_Framework(SeatManage.EnumType.TipType.Exception, 7);//显示提示窗体
                tip.ShowDialog();
            }
            finally
            {
                read.Close();
                posCardHandle.Resetting();//执行初始化操作
            }
        }
Exemple #7
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();
            }
        }