/// <summary> /// 解锁座位 /// </summary> /// <param name="seatNo"></param> /// <returns></returns> public static SeatManage.EnumType.SeatLockState UnLockSeat(string seatNo) { IWCFService.ISeatManageService seatService = new WcfServiceForSeatManage.SeatManageDateService(); bool error = false; try { SeatManage.EnumType.SeatLockState seatLock = seatService.SeatUnLocked(seatNo); return(seatLock); } catch (Exception ex) { error = true; SeatManageComm.WriteLog.Write("座位解锁失败:" + ex.Message); return(EnumType.SeatLockState.None); } }
/// <summary> /// 选座座位 /// </summary> /// <param name="seatBtn"></param> /// <returns></returns> public bool SelectSeat(SeatButton seatBtn) { SeatManage.EnumType.SeatLockState lockseat = T_SM_Seat.LockSeat(seatBtn.SeatNo); if (lockseat == SeatManage.EnumType.SeatLockState.Locked)//座位成功加锁 { clientObject.EnterOutLogData.EnterOutlog.ShortSeatNo = seatBtn.ShortSeatNo; clientObject.EnterOutLogData.EnterOutlog.ReadingRoomName = _ReadingRoomName; clientObject.EnterOutLogData.EnterOutlog.ReadingRoomNo = _ReadingRoomNo; MessageWindow popWindow = new MessageWindow(SeatManage.EnumType.MessageType.SelectSeatConfirm); CountDown.Pause(); popWindow.ShowDialog(); CountDown.Start(); if (popWindow.viewModel.OperateResule == SeatManage.EnumType.HandleResult.Successed) { clientObject.EnterOutLogData.EnterOutlog.ReadingRoomName = _ReadingRoomName; clientObject.EnterOutLogData.EnterOutlog.ReadingRoomNo = _ReadingRoomNo; clientObject.EnterOutLogData.EnterOutlog.SeatNo = seatBtn.SeatNo; clientObject.EnterOutLogData.EnterOutlog.ShortSeatNo = seatBtn.ShortSeatNo; clientObject.EnterOutLogData.EnterOutlog.TerminalNum = clientObject.ClientSetting.ClientNo; clientObject.EnterOutLogData.FlowControl = SeatManage.EnumType.ClientOperation.SelectSeat; //操作为选择座位 clientObject.EnterOutLogData.EnterOutlog.Remark = string.Format("在终端{0}手动选择,{1},{2}号座位", clientObject.ClientSetting.ClientNo, clientObject.EnterOutLogData.Student.AtReadingRoom.Name, seatBtn.ShortSeatNo); RoomSelectSeatMethod = SeatManage.EnumType.SelectSeatMode.ManualMode; return(true); } else { T_SM_Seat.UnLockSeat(seatBtn.SeatNo);//确认窗口点击取消或者自动关闭,则解锁。 } } else if (lockseat == SeatManage.EnumType.SeatLockState.UnLock)//没有成功加锁 { MessageWindow popWindow = new MessageWindow(SeatManage.EnumType.MessageType.SeatIsLocked); CountDown.Pause(); popWindow.ShowDialog(); CountDown.Start(); } else if (lockseat == SeatManage.EnumType.SeatLockState.NotExists) { MessageWindow popWindow = new MessageWindow(SeatManage.EnumType.MessageType.SeatNotExist); CountDown.Pause(); popWindow.ShowDialog(); CountDown.Start(); } return(false); }
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) { } }
/// <summary> /// 解锁座位 /// </summary> /// <param name="seatNo"></param> /// <returns></returns> public static SeatManage.EnumType.SeatLockState UnLockSeat(string seatNo) { IWCFService.ISeatManageService seatService = WcfAccessProxy.ServiceProxy.CreateChannelSeatManageService(); bool error = false; try { SeatManage.EnumType.SeatLockState seatLock = seatService.SeatUnLocked(seatNo); return(seatLock); } catch (Exception ex) { error = true; SeatManageComm.WriteLog.Write("座位解锁失败:" + ex.Message); return(EnumType.SeatLockState.None); } finally { ICommunicationObject ICommObjectService = seatService as ICommunicationObject; try { if (ICommObjectService.State == CommunicationState.Faulted) { ICommObjectService.Abort(); } else { ICommObjectService.Close(); } } catch { ICommObjectService.Abort(); } } }
/// <summary> /// 确认座位号 /// </summary> /// <returns></returns> public bool CheckSeatNumber() { if (string.IsNullOrEmpty(SeatNo)) { MessageWindow popWindow = new MessageWindow(SeatManage.EnumType.MessageType.SeatNotExist); CountDown.Pause(); popWindow.ShowDialog(); CountDown.Start(); 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) { MessageWindow popWindow = new MessageWindow(SeatManage.EnumType.MessageType.SeatNotExist); CountDown.Pause(); popWindow.ShowDialog(); CountDown.Start(); return(false); } if (seat.IsSuspended) { MessageWindow popWindow = new MessageWindow(SeatManage.EnumType.MessageType.SeatIsStopping); CountDown.Pause(); popWindow.ShowDialog(); CountDown.Start(); return(false); } if (seat.ReadingRoomNum != roomInfo.No) { MessageWindow popWindow = new MessageWindow(SeatManage.EnumType.MessageType.SeatNotExist); CountDown.Pause(); popWindow.ShowDialog(); CountDown.Start(); return(false); } SeatManage.EnumType.EnterOutLogType logType = SeatManage.Bll.T_SM_EnterOutLog.GetSeatUsedState(_LongSeatNo); //TODO:还需检测座位是否被预约 SeatManage.Bll.T_SM_EnterOutLog if (logType == SeatManage.EnumType.EnterOutLogType.None || logType == SeatManage.EnumType.EnterOutLogType.Leave) { //根据座位号获取进出记录的状态,如果为None或者为Leave,则锁定座位 SeatManage.EnumType.SeatLockState lockResult = SeatManage.Bll.T_SM_Seat.LockSeat(_LongSeatNo); if (lockResult == SeatManage.EnumType.SeatLockState.NotExists) { MessageWindow popWindow = new MessageWindow(SeatManage.EnumType.MessageType.SeatNotExist); CountDown.Pause(); popWindow.ShowDialog(); CountDown.Start(); return(false); } else if (lockResult == SeatManage.EnumType.SeatLockState.UnLock) { MessageWindow popWindow = new MessageWindow(SeatManage.EnumType.MessageType.SeatIsUsing); CountDown.Pause(); popWindow.ShowDialog(); CountDown.Start(); return(false); } else if (lockResult == SeatManage.EnumType.SeatLockState.Locked) { return(true); } else { return(false); } } else if (logType == SeatManage.EnumType.EnterOutLogType.BespeakWaiting) { MessageWindow popWindow = new MessageWindow(SeatManage.EnumType.MessageType.SeatIsUsing); CountDown.Pause(); popWindow.ShowDialog(); CountDown.Start(); return(false); } else { MessageWindow popWindow = new MessageWindow(SeatManage.EnumType.MessageType.SeatIsUsing); CountDown.Pause(); popWindow.ShowDialog(); CountDown.Start(); return(false); } //} //else //{ // toolTip1.SetToolTip(txtSeatNo, "请输入最后四位座位号"); // toolTip1.Show("请输入座位号",txtSeatNo,5000); //} }
private void btnYes_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(txtSeatNo.Text.Trim())) { toolTip1.SetToolTip(txtSeatNo, "请输入座位号!"); toolTip1.Show("请输入座位号!", txtSeatNo, 5000); txtSeatNo.Text = ""; return; } string seatNo = ""; ReadingRoomInfo roomInfo = clientObject.EnterOutLogData.Student.AtReadingRoom; string roomNo = roomInfo.No + "000"; string seatHeader = SeatComm.SeatNoToSeatNoHeader(roomInfo.Setting.SeatNumAmount, roomNo); seatNo = seatHeader + txtSeatNo.Text; //获取座位信息,并判断座位在该阅览室是否存在。 Seat seat = T_SM_Seat.GetSeatInfoBySeatNo(seatNo); if (seat == null) { toolTip1.SetToolTip(txtSeatNo, "座位号输入有误,请输入正确的座位号!"); toolTip1.Show("座位号输入有误,请输入正确的座位号!", txtSeatNo, 5000); txtSeatNo.Text = ""; return; } if (seat.IsSuspended) { toolTip1.SetToolTip(txtSeatNo, "您选择的座位,已暂停使用,请重新选择!"); toolTip1.Show("您选择的座位,已暂停使用,请重新选择!", txtSeatNo, 5000); txtSeatNo.Text = ""; return; } if (seat.ReadingRoomNum != roomInfo.No) { toolTip1.SetToolTip(txtSeatNo, string.Format("座位{0}在该阅览室不存在", txtSeatNo.Text)); toolTip1.Show(string.Format("座位{0}在该阅览室不存在", txtSeatNo.Text), txtSeatNo, 5000); txtSeatNo.Text = ""; return; } SeatManage.EnumType.EnterOutLogType logType = SeatManage.Bll.T_SM_EnterOutLog.GetSeatUsedState(seatNo); //TODO:还需检测座位是否被预约 SeatManage.Bll.T_SM_EnterOutLog if (logType == SeatManage.EnumType.EnterOutLogType.None || logType == SeatManage.EnumType.EnterOutLogType.Leave) { //根据座位号获取进出记录的状态,如果为None或者为Leave,则锁定座位 SeatManage.EnumType.SeatLockState lockResult = SeatManage.Bll.T_SM_Seat.LockSeat(seatNo); if (lockResult == SeatManage.EnumType.SeatLockState.NotExists) { toolTip1.SetToolTip(txtSeatNo, "座位号不存在"); toolTip1.Show("座位号不存在", txtSeatNo, 5000); return; } else if (lockResult == SeatManage.EnumType.SeatLockState.UnLock) { toolTip1.SetToolTip(txtSeatNo, "座位正在被其他读者选择"); toolTip1.Show("座位正在被其他读者选择", txtSeatNo, 5000); txtSeatNo.Text = ""; return; } else if (lockResult == SeatManage.EnumType.SeatLockState.Locked) { this._seatNo = seatNo; this.Close(); this.Dispose(); } } else if (logType == SeatManage.EnumType.EnterOutLogType.BespeakWaiting) { toolTip1.SetToolTip(txtSeatNo, "已被其他读者预约"); toolTip1.Show("已被其他读者预约", txtSeatNo, 5000); txtSeatNo.Text = ""; return; } else { toolTip1.SetToolTip(txtSeatNo, "座位正在被使用"); toolTip1.Show("座位正在被使用", txtSeatNo, 5000); txtSeatNo.Text = ""; return; } //} //else //{ // toolTip1.SetToolTip(txtSeatNo, "请输入最后四位座位号"); // toolTip1.Show("请输入座位号",txtSeatNo,5000); //} }
/// <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); } }
/// <summary> /// 选择预约的座位 /// </summary> /// <param name="seatBtn"></param> /// <returns></returns> public bool SelectBookingSeat(SeatButton seatBtn) { DateTime datetimeNow = SeatManage.Bll.ServiceDateTime.Now; List <SeatManage.ClassModel.BespeakLogInfo> bespeakLogList = SeatManage.Bll.T_SM_SeatBespeak.GetBespeakLogInfoBySeatNo(seatBtn.SeatNo, datetimeNow.Date); if (bespeakLogList.Count > 0) { if (bespeakLogList[0].BsepeakTime.AddMinutes(-double.Parse(clientObject.EnterOutLogData.Student.AtReadingRoom.Setting.SeatBespeak.ConfirmTime.BeginTime)) <= datetimeNow) { MessageWindow popWindow = new MessageWindow(SeatManage.EnumType.MessageType.SeatIsBespaeked); CountDown.Pause(); popWindow.ShowDialog(); CountDown.Start(); return(false); } else { clientObject.EnterOutLogData.BespeakLogInfo = bespeakLogList[0]; MessageWindow popWindow = new MessageWindow(SeatManage.EnumType.MessageType.SelectBespeakSeatConfrim); CountDown.Pause(); popWindow.ShowDialog(); CountDown.Start(); if (popWindow.viewModel.OperateResule == SeatManage.EnumType.HandleResult.Failed) { clientObject.EnterOutLogData.BespeakLogInfo = null; return(false); } } } else { SeatManage.EnumType.SeatLockState lockseat = T_SM_Seat.LockSeat(seatBtn.SeatNo); if (lockseat == SeatManage.EnumType.SeatLockState.Locked)//座位成功加锁 { clientObject.EnterOutLogData.EnterOutlog.ShortSeatNo = seatBtn.ShortSeatNo; clientObject.EnterOutLogData.EnterOutlog.ReadingRoomName = _ReadingRoomName; clientObject.EnterOutLogData.EnterOutlog.ReadingRoomNo = _ReadingRoomNo; MessageWindow popWindow = new MessageWindow(SeatManage.EnumType.MessageType.SelectBespeakSeatConfrim); CountDown.Pause(); popWindow.ShowDialog(); CountDown.Start(); if (popWindow.viewModel.OperateResule == SeatManage.EnumType.HandleResult.Failed) { T_SM_Seat.UnLockSeat(seatBtn.SeatNo);//确认窗口点击取消或者自动关闭,则解锁。 return(false); } } else if (lockseat == SeatManage.EnumType.SeatLockState.UnLock)//没有成功加锁 { MessageWindow popWindow = new MessageWindow(SeatManage.EnumType.MessageType.SeatIsLocked); CountDown.Pause(); popWindow.ShowDialog(); CountDown.Start(); return(false); } else if (lockseat == SeatManage.EnumType.SeatLockState.NotExists) { MessageWindow popWindow = new MessageWindow(SeatManage.EnumType.MessageType.SeatNotExist); CountDown.Pause(); popWindow.ShowDialog(); CountDown.Start(); return(false); } } clientObject.EnterOutLogData.EnterOutlog.ReadingRoomName = _ReadingRoomName; clientObject.EnterOutLogData.EnterOutlog.ReadingRoomNo = _ReadingRoomNo; clientObject.EnterOutLogData.EnterOutlog.SeatNo = seatBtn.SeatNo; clientObject.EnterOutLogData.EnterOutlog.ShortSeatNo = seatBtn.ShortSeatNo; clientObject.EnterOutLogData.EnterOutlog.TerminalNum = clientObject.ClientSetting.ClientNo; clientObject.EnterOutLogData.FlowControl = SeatManage.EnumType.ClientOperation.SelectSeat; //操作为选择座位 clientObject.EnterOutLogData.EnterOutlog.Remark = string.Format("在终端{0}手动选择,{1},{2}号座位", clientObject.ClientSetting.ClientNo, clientObject.EnterOutLogData.Student.AtReadingRoom.Name, seatBtn.ShortSeatNo); return(true); }
/// <summary> /// 等待座位 /// </summary> /// <returns></returns> public bool WaitSeat(SeatButton seatBtn) { WaitSeatLogInfo lastWaitInfo = T_SM_SeatWaiting.GetListWaitLogByCardNo(clientObject.EnterOutLogData.EnterOutlog.CardNo, clientObject.EnterOutLogData.EnterOutlog.ReadingRoomNo); ReadingRoomInfo roomInfo = clientObject.EnterOutLogData.Student.AtReadingRoom; if (!string.IsNullOrEmpty(clientObject.EnterOutLogData.EnterOutlog.SeatNo)) { MessageWindow popWindow = new MessageWindow(SeatManage.EnumType.MessageType.WaitSeatWithSeat); CountDown.Pause(); popWindow.ShowDialog(); CountDown.Start(); return(false); } if (lastWaitInfo != null && lastWaitInfo.SeatWaitTime.AddMinutes(roomInfo.Setting.NoManagement.OperatingInterval).CompareTo(ServiceDateTime.Now) >= 0) { clientObject.EnterOutLogData.Student.WaitSeatLog = lastWaitInfo; MessageWindow popWindow = new MessageWindow(SeatManage.EnumType.MessageType.WaitSeatFrequent); CountDown.Pause(); popWindow.ShowDialog(); CountDown.Start(); return(false); } SeatManage.EnumType.SeatLockState lockseat = T_SM_Seat.LockSeat(seatBtn.SeatNo); if (lockseat == SeatManage.EnumType.SeatLockState.Locked)//座位成功加锁 { clientObject.EnterOutLogData.WaitSeatLogModel = new WaitSeatLogInfo() { SeatNo = seatBtn.ShortSeatNo }; MessageWindow popWindow = new MessageWindow(SeatManage.EnumType.MessageType.WaitSeatConfirm); CountDown.Pause(); popWindow.ShowDialog(); CountDown.Start(); if (popWindow.viewModel.OperateResule == SeatManage.EnumType.HandleResult.Successed) { //初始化等待记录 记录ID需要待执行之后添加。 WaitSeatLogInfo waitInfo = new WaitSeatLogInfo(); waitInfo.CardNo = clientObject.EnterOutLogData.EnterOutlog.CardNo; waitInfo.NowState = SeatManage.EnumType.LogStatus.Valid; waitInfo.OperateType = SeatManage.EnumType.Operation.Reader; waitInfo.WaitingState = SeatManage.EnumType.EnterOutLogType.Waiting; EnterOutLogInfo seatUsingEnterOutInfo = SeatManage.Bll.T_SM_EnterOutLog.GetUsingEnterOutLogBySeatNo(seatBtn.SeatNo); seatUsingEnterOutInfo.EnterOutState = SeatManage.EnumType.EnterOutLogType.ShortLeave; seatUsingEnterOutInfo.EnterOutType = SeatManage.EnumType.LogStatus.Valid; seatUsingEnterOutInfo.Flag = SeatManage.EnumType.Operation.OtherReader; seatUsingEnterOutInfo.TerminalNum = clientObject.ClientSetting.ClientNo; seatUsingEnterOutInfo.Remark = string.Format("在{0} {1}号座位,被读者{2}在终端{3}设置为暂离并等待该座位", seatUsingEnterOutInfo.ReadingRoomName, seatUsingEnterOutInfo.ShortSeatNo, waitInfo.CardNo, clientObject.ClientSetting.ClientNo); clientObject.EnterOutLogData.EnterOutlog = seatUsingEnterOutInfo; //要等待读者的暂离记录 clientObject.EnterOutLogData.WaitSeatLogModel = waitInfo; //等待记录 return(true); } else { T_SM_Seat.UnLockSeat(seatBtn.SeatNo);//确认窗口点击取消或者自动关闭,则解锁。 } } else if (lockseat == SeatManage.EnumType.SeatLockState.UnLock)//没有成功加锁 { MessageWindow popWindow = new MessageWindow(SeatManage.EnumType.MessageType.SeatIsLocked); CountDown.Pause(); popWindow.ShowDialog(); CountDown.Start(); } return(false); }
/// <summary> /// 读者等待座位 /// </summary> /// <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(); } }