/// <summary> /// ÉèÖð´Å¥Ñùʽ /// </summary> /// <param name="btn">°´Å¥</param> /// <param name="btnType">ÀàÐÍ</param> /// <param name="ReadRoonNo">ÔÄÀÀÊÒ±àºÅ</param> private ReadingRoomButton InitDrawRoom(ReadingRoomInfo room, ReadingRoomStatus roomStatus) { SeatManage.MyUserControl.ReadingRoomButton roomButton = new SeatManage.MyUserControl.ReadingRoomButton(); try { roomButton.RoomNum = room.No; roomButton.Text = room.Name; int stopSeatCount = 0; foreach (KeyValuePair <string, Seat> item in room.SeatList.Seats) { if (item.Value.IsSuspended) { stopSeatCount++; } } roomButton.RoomUsedTip = roomSeatUsingState[room.No].SeatAmountUsed + "/" + (roomSeatUsingState[room.No].SeatAmountAll - stopSeatCount); roomButton.SeatUsingStatus = roomSeatUsingState[room.No].RoomSeatUsingState; //×ùλʹÓÃ״̬¸³Öµ roomButton.RoomStatus = roomStatus; //ÔÄÀÀÊÒ״̬¸³Öµ if (roomStatus != ReadingRoomStatus.Close && roomStatus != ReadingRoomStatus.BeforeClose) { roomButton.Click += new EventHandler(roomButton_Click); } return(roomButton); } catch (Exception ex) { throw ex; } }
/// <summary> /// Ñ¡Ôñ×ùλ /// </summary> /// <param name="sender"></param> /// <param name="e"></param> void roomButton_Click(object sender, EventArgs e) { SeatManage.MyUserControl.ReadingRoomButton room = sender as ReadingRoomButton; this.clientObject.EnterOutLogData.EnterOutlog.ReadingRoomNo = room.RoomNum; ReadingRoomInfo roomInfo = T_SM_ReadingRoom.GetSingleRoomInfo(room.RoomNum); if (room.SeatUsingStatus == ReadingRoomUsingStatus.Full && (!roomInfo.Setting.NoManagement.Used)) { Tip_Framework tipForm = new Tip_Framework(TipType.ReadingRoomFull, 9); formClose.Pause(); tipForm.ShowDialog(); formClose.Start(); return; } clientObject.EnterOutLogData.Student.AtReadingRoom = roomInfo;//¸ø¶ÁÕßËùÔÚµÄÔÄÀÀÊÒ¸³Öµ¡£ //ÑéÖ¤¶ÁÕßÉí·ÝÊÇ·ñÔÊÐíÑ¡Ôñ¸ÃÔÄÀÀÊÒ¡£ if (!SelectSeatProven.ProvenReaderType(clientObject.EnterOutLogData.Student, roomInfo.Setting)) { Tip_Framework tipForm = new Tip_Framework(TipType.ReaderTypeInconformity, 9); formClose.Pause(); tipForm.ShowDialog(); formClose.Start(); return; } //ÑéÖ¤¶ÁÕߺÚÃûµ¥£¬Ñ¡×ù´ÎÊý¡£ if (SelectSeatProven.ProvenReaderState(clientObject.EnterOutLogData.Student, roomInfo, clientObject.RegulationRulesSet.BlacklistSet, clientObject.ClientSetting.DeviceSetting)) { this.clientObject.EnterOutLogData.EnterOutlog.ReadingRoomNo = ""; return; } //TODO:ÑéÖ¤ÖÕ¶ËÑ¡×ù·½Ê½ if (room.SeatUsingStatus == ReadingRoomUsingStatus.Full && roomInfo.Setting.NoManagement.Used) { this._RoomSelectSeatMethod = SelectSeatMode.ManualMode; this.clientObject.EnterOutLogData.FlowControl = ClientOperation.SelectSeat; this.clientObject.EnterOutLogData.EnterOutlog.ReadingRoomNo = room.RoomNum; this.Close(); } else { SelectSeatMode selectSeatMethod = SelectSeatProven.ProvenSelectSeatMethod(clientObject.ClientSetting.DeviceSetting, roomInfo.Setting.SeatChooseMethod); if (selectSeatMethod == SelectSeatMode.OptionalMode) { ChooseSeatState frmChooseSeatState = new ChooseSeatState(); frmChooseSeatState.ShowDialog(); _RoomSelectSeatMethod = frmChooseSeatState.RoomSelectSeatMethod; if (frmChooseSeatState.RoomSelectSeatMethod != SelectSeatMode.None) { this.clientObject.EnterOutLogData.FlowControl = ClientOperation.SelectSeat; this.clientObject.EnterOutLogData.EnterOutlog.ReadingRoomNo = room.RoomNum; this.Close(); } else { this.clientObject.EnterOutLogData.FlowControl = ClientOperation.None; this.clientObject.EnterOutLogData.EnterOutlog.ReadingRoomNo = ""; } } else { this._RoomSelectSeatMethod = selectSeatMethod; this.clientObject.EnterOutLogData.FlowControl = ClientOperation.SelectSeat; this.clientObject.EnterOutLogData.EnterOutlog.ReadingRoomNo = room.RoomNum; this.Close(); } } }