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)) { 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); //} }
/// <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); } }