/// <summary> /// 删除阅览室,连通座位一起删除 /// </summary> /// <param name="model"></param> /// <returns></returns> public static bool DeleteReadingRoom(ReadingRoomInfo model) { IWCFService.ISeatManageService SeatService = WcfAccessProxy.ServiceProxy.CreateChannelSeatManageService(); bool error = false; try { return(SeatService.deleteReadingRoom(model)); } catch (Exception ex) { error = true; WriteLog.Write("删除阅览室失败:" + ex.Message); return(false); } 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 string GetSingleRoomOpenState(string roomNo, string datetime) { AJM_HandleResult result = new AJM_HandleResult(); try { if (string.IsNullOrEmpty(roomNo)) { result.Result = false; result.Msg = "阅览室编号不能为空!"; return(JSONSerializer.Serialize(result)); } AJM_ReadingRoomState ajmReadingRoomState = new AJM_ReadingRoomState(); List <string> listNum = new List <string>(); listNum.Add(roomNo); ReadingRoomInfo readingRoomInfo = SeatManageDateService.GetReadingRoomInfo(listNum)[0]; ajmReadingRoomState.OpenCloseState = readingRoomInfo.Setting.ReadingRoomOpenState(Convert.ToDateTime(datetime)).ToString(); ajmReadingRoomState.RoomName = readingRoomInfo.Name; ajmReadingRoomState.RoomNo = readingRoomInfo.No; result.Result = true; result.Msg = JSONSerializer.Serialize(ajmReadingRoomState); return(JSONSerializer.Serialize(result)); } catch (Exception ex) { WriteLog.Write(string.Format("获取阅览室开闭状态异常:{0}", ex.Message)); result.Result = false; result.Msg = "获取阅览室开闭状态执行遇到异常!"; return(JSONSerializer.Serialize(result)); } }
/// <summary> /// 选座座位 /// </summary> /// <param name="seatBtn"></param> /// <returns></returns> public bool SelectSeat(UsuallySeatUC_ViewModel seatBtn) { ReadingRoomInfo roomInfo = SeatManage.Bll.T_SM_ReadingRoom.GetSingleRoomInfo(seatBtn.ReadingRoomNo); clientObject.EnterOutLogData.Student.AtReadingRoom = roomInfo;//给读者所在的阅览室赋值。 //验证读者身份是否允许选择该阅览室。 if (!Code.SelectSeatProven.ProvenReaderType(clientObject.EnterOutLogData.Student, roomInfo.Setting)) { MessageWindow mesgWindow = new MessageWindow(MessageType.RoomNotReaderType); mesgWindow.ShowDialog(); return(false); } //验证读者黑名单,选座次数。 if (Code.SelectSeatProven.ProvenReaderState(clientObject.EnterOutLogData.Student, roomInfo, clientObject.RegulationRulesSet.BlacklistSet, clientObject.ClientSetting.DeviceSetting)) { this.clientObject.EnterOutLogData.EnterOutlog.ReadingRoomNo = ""; return(false); } 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 = seatBtn.ReadingRoomName; MessageWindow mesgWindow = new MessageWindow(MessageType.SelectSeatConfirm); CountDown.Pause(); mesgWindow.ShowDialog(); CountDown.Start(); if (mesgWindow.viewModel.OperateResule == SeatManage.EnumType.HandleResult.Successed) { clientObject.EnterOutLogData.EnterOutlog.ReadingRoomName = seatBtn.ReadingRoomName; clientObject.EnterOutLogData.EnterOutlog.ReadingRoomNo = seatBtn.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); } else { T_SM_Seat.UnLockSeat(seatBtn.SeatNo);//确认窗口点击取消或者自动关闭,则解锁。 } } else if (lockseat == SeatManage.EnumType.SeatLockState.UnLock)//没有成功加锁 { MessageWindow mesgWindow = new MessageWindow(MessageType.SeatIsLocked); CountDown.Pause(); mesgWindow.ShowDialog(); CountDown.Start(); } else if (lockseat == SeatManage.EnumType.SeatLockState.NotExists) { MessageWindow mesgWindow = new MessageWindow(MessageType.SeatNotExist); CountDown.Pause(); mesgWindow.ShowDialog(); CountDown.Start(); } return(false); }
/// <summary> /// 等待座位 /// </summary> public void WaitingSeat() { WaitSeatLogInfo waitLog = clientobject.EnterOutLogData.Student.WaitSeatLog; ReadingRoomInfo roomInfo = clientobject.EnterOutLogData.Student.AtReadingRoom; string shortSeatNo = SeatComm.SeatNoToShortSeatNo(roomInfo.Setting.SeatNumAmount, waitLog.SeatNo); WaitSeatCancel askForm = new WaitSeatCancel(roomInfo.Name, shortSeatNo); askForm.ShowDialog(); if (askForm.IsTrue) { //处理等待记录的Id this.clientobject.EnterOutLogData.WaitSeatLogModel = waitLog; this.clientobject.EnterOutLogData.WaitSeatLogModel.OperateType = Operation.Reader; this.clientobject.EnterOutLogData.WaitSeatLogModel.WaitingState = EnterOutLogType.WaitingCancel; this.clientobject.EnterOutLogData.WaitSeatLogModel.NowState = LogStatus.Valid; if (T_SM_SeatWaiting.UpdateWaitLog(this.clientobject.EnterOutLogData.WaitSeatLogModel)) { //恢复读者的在座状态 this.clientobject.EnterOutLogData.EnterOutlog = T_SM_EnterOutLog.GetEnterOutLogInfoById(this.clientobject.EnterOutLogData.WaitSeatLogModel.EnterOutLogID); System.TimeSpan shortleavetimelong = ServiceDateTime.Now - clientobject.EnterOutLogData.EnterOutlog.EnterOutTime; this.clientobject.EnterOutLogData.EnterOutlog.EnterOutState = EnterOutLogType.ComeBack; this.clientobject.EnterOutLogData.EnterOutlog.EnterOutType = LogStatus.Valid; this.clientobject.EnterOutLogData.EnterOutlog.Flag = Operation.OtherReader; clientobject.EnterOutLogData.EnterOutlog.TerminalNum = clientobject.ClientSetting.ClientNo; this.clientobject.EnterOutLogData.EnterOutlog.Remark = string.Format("读者{0}在{1}终端取消等待{2} {3}号座位,您暂离{4}分钟后恢复为在座状态", this.clientobject.EnterOutLogData.WaitSeatLogModel.CardNo, this.clientobject.ClientSetting.ClientNo, this.clientobject.EnterOutLogData.EnterOutlog.ReadingRoomName, this.clientobject.EnterOutLogData.EnterOutlog.ShortSeatNo, shortleavetimelong.Minutes); int newId = -1; EnterOutOperate.AddEnterOutLog(this.clientobject.EnterOutLogData.EnterOutlog, ref newId); } } }
/// <summary> /// 进出记录list转换为DataTable /// </summary> /// <param name="num"></param> /// <param name="queryMethod"></param> /// <param name="startDate"></param> /// <param name="endDate"></param> /// <returns></returns> public static DataTable GetEnterOutLogDataSet_ByFuzzySearch(string num, string roomNum, EnumEnterOutLogQueryMethod queryMethod, DateTime startDate, DateTime endDate) { List <EnterOutLogInfo> enterOutLogList = new List <EnterOutLogInfo>(); switch (queryMethod) { case EnumEnterOutLogQueryMethod.CardNo: enterOutLogList = SeatManage.Bll.T_SM_EnterOutLog.GetEnterOutLogs_ByFuzzySearch(num, roomNum, null, startDate, endDate); break; case EnumEnterOutLogQueryMethod.SeatNum: ReadingRoomInfo room = null; string seatNo = roomNum; if (!string.IsNullOrEmpty(roomNum)) { room = SeatManage.Bll.T_SM_ReadingRoom.GetSingleRoomInfo(roomNum); seatNo += "000"; seatNo = SeatManage.SeatManageComm.SeatComm.SeatNoToSeatNoHeader(room.Setting.SeatNumAmount, seatNo) + num; enterOutLogList = SeatManage.Bll.T_SM_EnterOutLog.GetEnterOutLogs(null, roomNum, seatNo, startDate, endDate); } else { FineUI.Alert.Show("请选择座位所在的阅览室"); // return null; } break; } return(enterOutLogListToDataTable(enterOutLogList)); }
public string SeatUsedInfo(string ReadingRoomNo) { try { if (!Verifylicensing()) { return("非法操作,此接口未进行授权!"); } if (!checkReadingRoomNo(ReadingRoomNo)) { return("阅览室编号错误"); } ReadingRoomInfo room = GetSingleRoomInfo(ReadingRoomNo); ReadingRoomSeatUsedState roomSeat = NowReadingRoomState.GetRoomSeatUsedState(ReadingRoomNo); int allSeat = roomSeat.SeatAmountAll; //总座位数 int NotSeatPeople = roomSeat.SeatAmountFree; //剩余座位数 int usedSeat = roomSeat.SeatAmountUsed; string result = string.Format("<SeatUsedInfo><RoomName No='{0}' SchoolName='{1}' LibraryName='{2}'>{3}</RoomName><Seat UsedSum='{4}' AllSum='{5}' freeSeat='{6}' /></SeatUsedInfo>", ReadingRoomNo, room.Libaray.School.Name, room.Libaray.Name, room.Name, usedSeat, allSeat, NotSeatPeople); return(result); } catch (Exception ex) { return(ex.Message); } }
/// <summary> /// 选座验证操作。 /// </summary> /// <param name="student">学生信息</param> /// <param name="room">选择的阅览室</param> /// <param name="clientconfig">客户端设置</param> /// <returns></returns> public static bool ProvenReaderState(ReaderInfo student, ReadingRoomInfo room, BlacklistSetting blacklistSet, ClientConfigV2 clientconfig) { if (SeatManage.Bll.EnterOutOperate.CheckReaderChooseSeatTimes(student.CardNo, clientconfig.PosTimes)) { PopupWindowsObject.GetInstance().Window.ShowMessage(TipType.SelectSeatFrequent); return(true); } if (SeatManage.Bll.EnterOutOperate.CheckReaderChooseSeatTimesByReadingRoom(student.CardNo, room.Setting.PosTimes, room.No)) { PopupWindowsObject.GetInstance().Window.ShowMessage(TipType.SelectSeatFrequent); return(true); } if (!room.Setting.UsedBlacklistLimit) { return(false); } if (student.BlacklistLog.Count <= 0) { return(false); } if (!room.Setting.BlackListSetting.Used) { PopupWindowsObject.GetInstance().Window.ShowMessage(TipType.IsBlacklist); return(true); } bool isBlack = student.BlacklistLog.Any(blinfo => blinfo.ReadingRoomID == room.No); if (isBlack) { PopupWindowsObject.GetInstance().Window.ShowMessage(TipType.IsBlacklist); return(true); } return(false); }
/// <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="student">学生信息</param> /// <param name="room">选择的阅览室</param> /// <param name="clientconfig">客户端设置</param> /// <returns></returns> public static bool ProvenReaderState(ReaderInfo student, ReadingRoomInfo room, BlacklistSetting blacklistSet, ClientConfigV2 clientconfig) { if (SeatManage.Bll.EnterOutOperate.CheckReaderChooseSeatTimes(student.CardNo, clientconfig.PosTimes)) { PopupWindow selectTooWindow = new PopupWindow(TipType.SelectSeatFrequent); selectTooWindow.ShowDialog(); return(true); } if (SeatManage.Bll.EnterOutOperate.CheckReaderChooseSeatTimesByReadingRoom(student.CardNo, room.Setting.PosTimes, room.No)) { PopupWindow selectTooWindow = new PopupWindow(TipType.SelectSeatFrequent); selectTooWindow.ShowDialog(); return(true); } if (room.Setting.UsedBlacklistLimit) { if (student.BlacklistLog.Count > 0) { if (room.Setting.BlackListSetting.Used) { bool isBlack = false; foreach (BlackListInfo blinfo in student.BlacklistLog) { if (blinfo.ReadingRoomID == room.No) { isBlack = true; break; } } if (isBlack) { PopupWindow blacklistWindow = new PopupWindow(TipType.IsBlacklist); blacklistWindow.ShowDialog(); return(true); } else { return(false); } } else { PopupWindow blacklistWindow = new PopupWindow(TipType.IsBlacklist); blacklistWindow.ShowDialog(); return(true); } } else { return(false); } } else { return(false); } }
/// <summary> /// 等待座位 /// </summary> /// <returns></returns> public bool WaitSeat(SeatUC_ViewModel seatVM) { 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)) { PopupWindowsObject.GetInstance().Window.ShowMessage(TipType.WaitSeatWithSeat); return(false); } if (lastWaitInfo != null && lastWaitInfo.SeatWaitTime.AddMinutes(roomInfo.Setting.NoManagement.OperatingInterval).CompareTo(ServiceDateTime.Now) >= 0) { PopupWindowsObject.GetInstance().Window.ShowMessage(TipType.WaitSeatFrequent); return(false); } SeatLockState lockseat = T_SM_Seat.LockSeat(seatVM.LongSeatNo); if (lockseat != SeatLockState.Locked) //座位成功加锁 { PopupWindowsObject.GetInstance().Window.ShowMessage(TipType.SeatLocking); return(false); } ClientObject.EnterOutLogData.WaitSeatLogModel = new WaitSeatLogInfo() { SeatNo = seatVM.ShortSeatNo }; PopupWindowsObject.GetInstance().Window.ShowMessage(TipType.SetShortWarning); ClientObject.EnterOutLogData.WaitSeatLogModel = null; if (PopupWindowsObject.GetInstance().Window.ViewModel.OperateResule == HandleResult.Successed) { //初始化等待记录 记录ID需要待执行之后添加。 WaitSeatLogInfo waitInfo = new WaitSeatLogInfo(); waitInfo.CardNo = ClientObject.EnterOutLogData.EnterOutlog.CardNo; waitInfo.NowState = LogStatus.Valid; waitInfo.OperateType = Operation.Reader; waitInfo.WaitingState = EnterOutLogType.Waiting; EnterOutLogInfo seatUsingEnterOutInfo = T_SM_EnterOutLog.GetUsingEnterOutLogBySeatNo(seatVM.LongSeatNo); seatUsingEnterOutInfo.EnterOutState = EnterOutLogType.ShortLeave; seatUsingEnterOutInfo.EnterOutType = LogStatus.Valid; seatUsingEnterOutInfo.Flag = 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; //等待记录 ClientObject.EnterOutLogData.FlowControl = ClientOperation.WaitSeat; return(true); } else { T_SM_Seat.UnLockSeat(seatVM.LongSeatNo);//确认窗口点击取消或者自动关闭,则解锁。 return(false); } }
private void ReadingRoomChooseForm_Load(object sender, EventArgs e) { #region ÏÔʾ´¥ÃþÆÁËù¹ÜÀíµÄÔÄÀÀÊÒ int roomCationX = 120; //ÔÄÀÀÊÒºáÏò×ø±ê int roomCationY = 140; //ÔÄÀÀÊÒÊúÖ±·½Ïò×ø±ê if (clientObject.ClientSetting.DeviceSetting.SystemResoultion.WindowSize.Size.X != 1080) { roomCationX = 80; roomCationY = 130; } int roomCount = 0; List <string> roomNums = new List <string>(); foreach (ReadingRoomInfo room in clientObject.ReadingRoomList.Values) { roomNums.Add(room.No); } //»ñÈ¡ÔÄÀÀÊÒ×ùλʹÓÃ״̬ roomSeatUsingState = NowReadingRoomState.GetRoomSeatUsedState(roomNums); foreach (string roomNum in clientObject.ClientSetting.DeviceSetting.Rooms) { ReadingRoomInfo room = clientObject.ReadingRoomList[roomNum]; ReadingRoomStatus roomStatus = NowReadingRoomState.ReadingRoomOpenState(room.Setting.RoomOpenSet, ServiceDateTime.Now); if (roomStatus == ReadingRoomStatus.Close && !clientObject.ClientSetting.DeviceSetting.IsShowClosedRoom) { continue; } ReadingRoomButton btnRoom = InitDrawRoom(room, roomStatus); btnRoom.Location = new Point(roomCationX, roomCationY); roomCount++; if (roomCount % 4 != 0) { roomCationX += 220; } else { if (clientObject.ClientSetting.DeviceSetting.SystemResoultion.WindowSize.Size.X != 1080) { roomCationX = 80; } else { roomCationX = 120; } roomCationY += 150; } this.Controls.Add(btnRoom); } #endregion #region ¹Ø±ÕÔÄÀÀÊÒ formClose = new FormCloseCountdown(int.Parse(lblCountdown.Text)); formClose.EventCountdown += new EventHandler(formClose_EventCountdown); #endregion }
/// <summary> /// 开馆处理 /// </summary> /// <param name="readingRooms"></param> private void OpenReadingRoom(ReadingRoomInfo room) { DateTime nowDateTime = ServiceDateTime.Now; try { //获取昨天的进出记录 List <EnterOutLogInfo> eolList = T_SM_EnterOutLog.GetEnterOutLogByStatus(null, room.No, null, enterOutLogTypeList, LogStatus.Valid, "1900-1-1", ServiceDateTime.Now.ToShortDateString()); foreach (EnterOutLogInfo eol in eolList) { if ((eol.EnterOutState == EnterOutLogType.ShortLeave) && (eol.Flag == Operation.Admin || eol.Flag == Operation.OtherReader)) { //获取昨天的等待记录 List <WaitSeatLogInfo> wsllist = T_SM_SeatWaiting.GetWaitSeatList(null, eol.EnterOutLogID, null, null, new List <EnterOutLogType> { EnterOutLogType.Waiting }); if (wsllist.Count > 0) { wsllist[0].WaitingState = EnterOutLogType.WaitingCancel; wsllist[0].StatsChangeTime = nowDateTime; T_SM_SeatWaiting.UpdateWaitLog(wsllist[0]); } } eol.EnterOutState = EnterOutLogType.Leave; eol.EnterOutTime = nowDateTime; eol.Flag = Operation.Service; eol.Remark = string.Format("在{0},{1}号座位,闭馆释放座位", eol.ReadingRoomName, eol.SeatNo.Substring(eol.SeatNo.Length - room.Setting.SeatNumAmount)); int logdi = 0; EnterOutOperate.AddEnterOutLog(eol, ref logdi); WriteLog.Write(string.Format("监控服务:读者{0},{1}", eol.CardNo, eol.Remark)); } //预约记录处理 TimeSpan span = nowDateTime - DateTime.Parse("2010-1-1"); List <BespeakLogInfo> blilist = T_SM_SeatBespeak.GetBespeakList(null, room.No, nowDateTime.AddDays(-1), span.Days, new List <BookingStatus> { BookingStatus.Waiting }); if (blilist.Count <= 0) { return; } foreach (BespeakLogInfo bli in blilist.Where(bli => bli.BsepeakTime.Date < nowDateTime.Date)) { bli.CancelTime = bli.BsepeakTime.AddMinutes(int.Parse(room.Setting.SeatBespeak.ConfirmTime.EndTime)); bli.CancelPerson = Operation.Service; bli.BsepeakState = BookingStatus.Cencaled; bli.Remark = string.Format("读者,在{0},{1}号座位,预约,闭馆取消预约", bli.ReadingRoomName, bli.SeatNo.Substring(bli.SeatNo.Length - room.Setting.SeatNumAmount)); T_SM_SeatBespeak.UpdateBespeakList(bli); WriteLog.Write(string.Format("监控服务:读者{0},{1}", bli.CardNo, bli.Remark)); } } catch (Exception ex) { WriteLog.Write(string.Format("监控服务:执行开馆处理遇到错误:{0}", ex.Message)); } }
/// <summary> /// 删除阅览室 /// </summary> /// <param name="room"></param> /// <returns></returns> public bool deleteReadingRoom(ReadingRoomInfo room) { try { return(t_sm_readingRoom_DAL.Delete(room)); } catch { throw; } }
/// <summary> /// 新增阅览室 /// </summary> /// <param name="room"></param> /// <returns></returns> public bool AddReadingRoom(ReadingRoomInfo room) { try { return(t_sm_readingRoom_DAL.Add(room)); } catch { throw; } }
public NowReadingRoomState(ReadingRoomInfo room, DateTime Time) { //根据设置判断当前阅览室的选座方式 _SeatChooseMode = RoomSelectSeatMode(room.Setting.SeatChooseMethod, Time); //判断阅览室的开放状态 roomState = ReadingRoomOpenState(room.Setting.RoomOpenSet, Time); //计算座位保留时长 _SeatSaveTime = GetSeatHoldTime(room.Setting.SeatHoldTime, Time); _CanBespeakSeat = IsCanBespeakSeat(room.Setting.SeatBespeak, Time); }
/// <summary> /// 选座验证操作。 /// </summary> /// <param name="student">学生信息</param> /// <param name="room">选择的阅览室</param> /// <param name="clientconfig">客户端设置</param> /// <returns></returns> public static bool ProvenReaderState(ReaderInfo student, ReadingRoomInfo room, BlacklistSetting blacklistSet, ClientConfig clientconfig) { if (EnterOutOperate.CheckReaderChooseSeatTimes(student.CardNo, clientconfig.PosTimes)) { SeatManage.SeatClient.Tip.Tip_Framework tipForm = new SeatManage.SeatClient.Tip.Tip_Framework(TipType.SelectSeatFrequent, 7); tipForm.ShowDialog(); return(true); } else { if (room.Setting.UsedBlacklistLimit) { if (student.BlacklistLog.Count > 0) { if (room.Setting.BlackListSetting.Used) { bool isBlack = false; foreach (BlackListInfo blinfo in student.BlacklistLog) { if (blinfo.ReadingRoomID == room.No) { isBlack = true; break; } } if (isBlack) { Tip_Framework tip = new Tip_Framework(TipType.IsBlacklist, 7); tip.ShowDialog(); return(true); } else { return(false); } } else { Tip_Framework tip = new Tip_Framework(TipType.IsBlacklist, 7); tip.ShowDialog(); return(true); } } else { return(false); } } else { return(false); } } }
/// <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 = ""; } }
public List <Seat> GetOftenUsedSeatByCardNo(string cardNo, int days, List <string> roomNums) { List <ReadingRoomInfo> rooms = GetReadingRoomInfo(roomNums); List <string> noList = rooms.FindAll(room => room.Setting.ReadingRoomOpenState(DateTime.Now) == ReadingRoomStatus.Open).Select(room => room.No).ToList(); DataSet ds = t_sm_seat.ReaderUsedSeat(cardNo, days, noList, GetServerDateTime()); List <Seat> seats = new List <Seat>(); for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { Seat s = new Seat(); s.SeatNo = ds.Tables[0].Rows[i]["SeatNo"].ToString(); s.ReadingRoomNum = ds.Tables[0].Rows[i]["ReadingRoomNo"].ToString(); //bool isstopUse = false; ReadingRoomInfo r = rooms.Find(u => u.No == s.ReadingRoomNum && u.SeatList.Seats.ContainsKey(s.SeatNo) && !u.SeatList.Seats[s.SeatNo].IsSuspended && u.Setting.ReadingRoomOpenState(DateTime.Now) == ReadingRoomStatus.Open); if (r == null) { continue; } else { s.ReadingRoom = r; } //foreach (ReadingRoomInfo r in rooms) //{ // if (r.No == s.ReadingRoomNum && r.SeatList.Seats.ContainsKey(s.SeatNo) && r.SeatList.Seats[s.SeatNo].IsSuspended) // { // s.ReadingRoom = r; // isstopUse = true; // break; // } //} //if (isstopUse) //{ // continue; //} EnterOutLogInfo enterOutLog = GetEnterOutLogInfoBySeatNum(s.SeatNo); if (enterOutLog == null || enterOutLog.EnterOutState == SeatManage.EnumType.EnterOutLogType.Leave) { seats.Add(s); } if (seats.Count >= 12) { break; } } return(seats); }
/// <summary> /// 修改阅览室信息 /// </summary> /// <param name="model"></param> /// <returns></returns> public static bool UpdateReadingRoom(ReadingRoomInfo model) { IWCFService.ISeatManageService SeatService = new WcfServiceForSeatManage.SeatManageDateService(); bool error = false; try { return(SeatService.UpdateReadingRoom(model)); } catch (Exception ex) { error = true; WriteLog.Write("修改阅览室失败:" + ex.Message); return(false); } }
/// <summary> /// 闭馆处理 /// </summary> /// <param name="readingRooms"></param> private void CloseReadingRoom(ReadingRoomInfo room) { DateTime nowDateTime = ServiceDateTime.Now; //添加记录状态 try { //获取今天的进出记录 List <EnterOutLogInfo> eolList = T_SM_EnterOutLog.GetEnterOutLogByStatus(null, room.No, null, enterOutLogTypeList, LogStatus.Valid, nowDateTime.ToShortDateString(), null); foreach (EnterOutLogInfo eol in eolList) { if ((eol.EnterOutState == EnterOutLogType.ShortLeave) && (eol.Flag == Operation.Admin || eol.Flag == Operation.OtherReader)) { //获取今天的的等待记录 List <WaitSeatLogInfo> wsllist = T_SM_SeatWaiting.GetWaitSeatList(null, eol.EnterOutLogID, null, null, new List <EnterOutLogType> { EnterOutLogType.Waiting }); if (wsllist.Count > 0) { wsllist[0].WaitingState = EnterOutLogType.WaitingCancel; wsllist[0].StatsChangeTime = nowDateTime; T_SM_SeatWaiting.UpdateWaitLog(wsllist[0]); } } eol.EnterOutState = EnterOutLogType.Leave; eol.EnterOutTime = nowDateTime; eol.Flag = Operation.Service; eol.Remark = string.Format("在{0},{1}号座位,闭馆释放座位", eol.ReadingRoomName, eol.SeatNo.Substring(eol.SeatNo.Length - room.Setting.SeatNumAmount)); int logdi = 0; EnterOutOperate.AddEnterOutLog(eol, ref logdi); //PushMsgInfo msg = new PushMsgInfo(); //msg.Title = "您好,您的座位已被释放"; //msg.MsgType = MsgPushType.ToTime; //msg.StudentNum = eol.CardNo; //msg.Message = eol.Remark; //SeatManage.Bll.T_SM_ReaderNotice.SendPushMsg(msg); WriteLog.Write(string.Format("监控服务:读者{0},{1}", eol.CardNo, eol.Remark)); } } catch (Exception ex) { WriteLog.Write(string.Format("监控服务:执行闭馆处理遇到错误:{0}", ex.Message)); } }
/// <summary> /// 等待座位 /// </summary> public void WaitingSeat() { WaitSeatLogInfo waitLog = clientobject.EnterOutLogData.Student.WaitSeatLog; ReadingRoomInfo roomInfo = clientobject.EnterOutLogData.Student.AtReadingRoom; string shortSeatNo = SeatComm.SeatNoToShortSeatNo(roomInfo.Setting.SeatNumAmount, waitLog.SeatNo); MessageWindow popWindowCancel = new MessageWindow(MessageType.CancelWaitConfirm); popWindowCancel.ShowDialog(); if (popWindowCancel.viewModel.OperateResule == HandleResult.Successed) { //处理等待记录的Id this.clientobject.EnterOutLogData.WaitSeatLogModel = waitLog; this.clientobject.EnterOutLogData.WaitSeatLogModel.OperateType = Operation.Reader; this.clientobject.EnterOutLogData.WaitSeatLogModel.WaitingState = EnterOutLogType.WaitingCancel; this.clientobject.EnterOutLogData.WaitSeatLogModel.NowState = LogStatus.Valid; if (T_SM_SeatWaiting.UpdateWaitLog(this.clientobject.EnterOutLogData.WaitSeatLogModel)) { //恢复读者的在座状态 this.clientobject.EnterOutLogData.EnterOutlog = T_SM_EnterOutLog.GetEnterOutLogInfoById(this.clientobject.EnterOutLogData.WaitSeatLogModel.EnterOutLogID); System.TimeSpan shortleavetimelong = ServiceDateTime.Now - clientobject.EnterOutLogData.EnterOutlog.EnterOutTime; this.clientobject.EnterOutLogData.EnterOutlog.EnterOutState = EnterOutLogType.ComeBack; this.clientobject.EnterOutLogData.EnterOutlog.EnterOutType = LogStatus.Valid; this.clientobject.EnterOutLogData.EnterOutlog.Flag = Operation.OtherReader; clientobject.EnterOutLogData.EnterOutlog.TerminalNum = clientobject.ClientSetting.ClientNo; this.clientobject.EnterOutLogData.EnterOutlog.Remark = string.Format("读者{0}在{1}终端取消等待{2} {3}号座位,您暂离{4}分钟后恢复为在座状态", this.clientobject.EnterOutLogData.WaitSeatLogModel.CardNo, this.clientobject.ClientSetting.ClientNo, this.clientobject.EnterOutLogData.EnterOutlog.ReadingRoomName, this.clientobject.EnterOutLogData.EnterOutlog.ShortSeatNo, shortleavetimelong.Minutes); int newId = -1; if (EnterOutOperate.AddEnterOutLog(this.clientobject.EnterOutLogData.EnterOutlog, ref newId) == HandleResult.Successed) { MessageWindow popWindow = new MessageWindow(MessageType.CancleWaitSuccess); popWindow.ShowDialog(); } else { MessageWindow popWindow = new MessageWindow(MessageType.Exception); popWindow.ShowDialog(); } } } }
/// <summary> /// 选座座位 /// </summary> /// <param name="seatBtn"></param> /// <returns></returns> public bool SelectSeat(UsuallySeatUC_ViewModel seatBtn) { ReadingRoomInfo roomInfo = T_SM_ReadingRoom.GetSingleRoomInfo(seatBtn.ReadingRoomNo); ClientObject.EnterOutLogData.Student.AtReadingRoom = roomInfo;//给读者所在的阅览室赋值。 //验证读者身份是否允许选择该阅览室。 if (!SelectSeatProven.ProvenReaderType(ClientObject.EnterOutLogData.Student, roomInfo.Setting)) { PopupWindowsObject.GetInstance().Window.ShowMessage(TipType.ReaderTypeInconformity); return(false); } //验证读者黑名单,选座次数。 if (SelectSeatProven.ProvenReaderState(ClientObject.EnterOutLogData.Student, roomInfo, ClientObject.RegulationRulesSet.BlacklistSet, ClientObject.ClientSetting.DeviceSetting)) { //ClientObject.EnterOutLogData.EnterOutlog.ReadingRoomNo = ""; return(false); } SeatLockState lockseat = T_SM_Seat.LockSeat(seatBtn.SeatNo); if (lockseat != SeatLockState.Locked) //座位成功加锁 { PopupWindowsObject.GetInstance().Window.ShowMessage(TipType.SeatLocking); return(false); } ClientObject.EnterOutLogData.EnterOutlog.ShortSeatNo = seatBtn.ShortSeatNo; ClientObject.EnterOutLogData.EnterOutlog.ReadingRoomName = seatBtn.ReadingRoomName; PopupWindowsObject.GetInstance().Window.ShowMessage(TipType.SelectSeatConfinmed); if (PopupWindowsObject.GetInstance().Window.ViewModel.OperateResule != HandleResult.Successed) { T_SM_Seat.UnLockSeat(seatBtn.SeatNo); //确认窗口点击取消或者自动关闭,则解锁。 return(false); } ClientObject.EnterOutLogData.EnterOutlog.ReadingRoomName = seatBtn.ReadingRoomName; ClientObject.EnterOutLogData.EnterOutlog.ReadingRoomNo = seatBtn.ReadingRoomNo; ClientObject.EnterOutLogData.EnterOutlog.SeatNo = seatBtn.SeatNo; ClientObject.EnterOutLogData.EnterOutlog.ShortSeatNo = seatBtn.ShortSeatNo; ClientObject.EnterOutLogData.EnterOutlog.TerminalNum = ClientObject.ClientSetting.ClientNo; ClientObject.EnterOutLogData.FlowControl = ClientOperation.SelectSeat; //操作为选择座位 ClientObject.EnterOutLogData.EnterOutlog.Remark = string.Format("在终端{0}选择常坐座位,{1},{2}号座位", ClientObject.ClientSetting.ClientNo, ClientObject.EnterOutLogData.Student.AtReadingRoom.Name, seatBtn.ShortSeatNo); return(true); }
public string ReadingRoomState(string ReadingRoomNo) { try { if (!Verifylicensing()) { return("非法操作,此接口未进行授权!"); } if (!checkReadingRoomNo(ReadingRoomNo)) { return("阅览室编号错误"); } string result = ""; ReadingRoomInfo room = GetSingleRoomInfo(ReadingRoomNo); SeatManage.EnumType.ReadingRoomStatus roomState = NowReadingRoomState.ReadingRoomOpenState(room.Setting.RoomOpenSet, DateTime.Now); string readingRoomState = ""; switch (roomState) { case SeatManage.EnumType.ReadingRoomStatus.Open: readingRoomState = "开放"; break; case SeatManage.EnumType.ReadingRoomStatus.BeforeOpen: readingRoomState = "即将开馆"; break; case SeatManage.EnumType.ReadingRoomStatus.Close: readingRoomState = "关闭"; break; case SeatManage.EnumType.ReadingRoomStatus.BeforeClose: readingRoomState = "即将关闭"; break; } result = string.Format("<ReadingRoomState><RoomName No='{0}' SchoolName='{1}' LibraryName='{2}'>{3}</RoomName><Status>{4}</Status></ReadingRoomState>", ReadingRoomNo, room.Libaray.School.Name, room.Libaray.Name, room.Name, readingRoomState); return(result); } catch (Exception ex) { return(ex.Message); } }
/// <summary> /// 座位等待处理 /// </summary> /// <param name="readingRoom">阅览室</param> /// <param name="enterOutLog">进出记录</param> /// <param name="waitSeatLoglist">等待记录列表</param> private void WaitSeatOperate(ReadingRoomInfo readingRoom, EnterOutLogInfo enterOutLog, List <WaitSeatLogInfo> waitSeatLoglist, DateTime nowDateTime) { try { waitSeatLoglist[0].WaitingState = EnterOutLogType.WaitingSuccess; waitSeatLoglist[0].StatsChangeTime = nowDateTime; seatManageService.UpdateWaitLog(waitSeatLoglist[0]); ReaderNoticeInfo notice = new ReaderNoticeInfo(); //释放原读者座位 int logid = 0; enterOutLog.Flag = Operation.Service; enterOutLog.EnterOutState = EnterOutLogType.Leave; enterOutLog.EnterOutTime = nowDateTime; enterOutLog.Remark = string.Format("在{0},{1}号座位,被其他读者设置暂离,暂离超时,被监控服务释放座位", enterOutLog.ReadingRoomName, enterOutLog.SeatNo.Substring(enterOutLog.SeatNo.Length - readingRoom.Setting.SeatNumAmount)); seatManageService.AddEnterOutLogInfo(enterOutLog, ref logid); WriteLog.Write(string.Format("监控服务:读者{0},{1}", enterOutLog.CardNo, enterOutLog.Remark)); //等待读者入座 EnterOutLogInfo new_eol = new EnterOutLogInfo(); new_eol.CardNo = waitSeatLoglist[0].CardNo; new_eol.EnterOutLogNo = SeatComm.RndNum(); new_eol.EnterOutState = EnterOutLogType.WaitingSuccess; new_eol.EnterOutType = LogStatus.Valid; new_eol.ReadingRoomNo = waitSeatLoglist[0].ReadingRoomNo; new_eol.Flag = Operation.Service; new_eol.SeatNo = enterOutLog.SeatNo; new_eol.Remark = string.Format("在{0},{1}号座位,等待成功,自动入座", enterOutLog.ReadingRoomName, enterOutLog.SeatNo.Substring(enterOutLog.SeatNo.Length - readingRoom.Setting.SeatNumAmount)); seatManageService.AddEnterOutLogInfo(new_eol, ref logid); WriteLog.Write(string.Format("监控服务:读者{0},{1}", new_eol.CardNo, new_eol.Remark)); if (readingRoom.Setting.IsRecordViolate) { AddViolationRecordByEnterOutLog(enterOutLog, ViolationRecordsType.ShortLeaveByReaderOutTime, string.Format("读者在{0},{1}号座位,被其他读者设置暂离,暂离超时", enterOutLog.ReadingRoomName, enterOutLog.SeatNo.Substring(enterOutLog.SeatNo.Length - readingRoom.Setting.SeatNumAmount)), readingRoom.Setting, nowDateTime); } } catch (Exception ex) { WriteLog.Write(string.Format("监控服务:处理等待读者发生错误:" + ex.Message)); } }
///// <summary> ///// 批量删除数据 ///// </summary> //public bool DeleteList(string ReadingRoomNolist ) //{ // StringBuilder strSql=new StringBuilder(); // strSql.Append("delete from T_SM_ReadingRoom "); // strSql.Append(" where ReadingRoomNo in ("+ReadingRoomNolist + ") "); // int rows=DbHelperSQL.ExecuteSql(strSql.ToString()); // if (rows > 0) // { // return true; // } // else // { // return false; // } //} ///// <summary> ///// 得到一个对象实体 ///// </summary> //public SeatManage.Model.T_SM_ReadingRoom GetModel(string ReadingRoomNo) //{ // StringBuilder strSql=new StringBuilder(); // strSql.Append("select top 1 ReadingRoomNo,ReadingRoomName,LibraryNo,ReadingSetting,RoomSeat from T_SM_ReadingRoom "); // strSql.Append(" where ReadingRoomNo=@ReadingRoomNo "); // SqlParameter[] parameters = { // new SqlParameter("@ReadingRoomNo", SqlDbType.NVarChar,50)}; // parameters[0].Value = ReadingRoomNo; // SeatManage.Model.T_SM_ReadingRoom model=new SeatManage.Model.T_SM_ReadingRoom(); // DataSet ds=DbHelperSQL.Query(strSql.ToString(),parameters); // if(ds.Tables[0].Rows.Count>0) // { // if(ds.Tables[0].Rows[0]["ReadingRoomNo"]!=null && ds.Tables[0].Rows[0]["ReadingRoomNo"].ToString()!="") // { // model.ReadingRoomNo=ds.Tables[0].Rows[0]["ReadingRoomNo"].ToString(); // } // if(ds.Tables[0].Rows[0]["ReadingRoomName"]!=null && ds.Tables[0].Rows[0]["ReadingRoomName"].ToString()!="") // { // model.ReadingRoomName=ds.Tables[0].Rows[0]["ReadingRoomName"].ToString(); // } // if(ds.Tables[0].Rows[0]["LibraryNo"]!=null && ds.Tables[0].Rows[0]["LibraryNo"].ToString()!="") // { // model.LibraryNo=int.Parse(ds.Tables[0].Rows[0]["LibraryNo"].ToString()); // } // if(ds.Tables[0].Rows[0]["ReadingSetting"]!=null && ds.Tables[0].Rows[0]["ReadingSetting"].ToString()!="") // { // model.ReadingSetting=ds.Tables[0].Rows[0]["ReadingSetting"].ToString(); // } // if(ds.Tables[0].Rows[0]["RoomSeat"]!=null && ds.Tables[0].Rows[0]["RoomSeat"].ToString()!="") // { // model.RoomSeat=ds.Tables[0].Rows[0]["RoomSeat"].ToString(); // } // return model; // } // else // { // return null; // } //} /* * /// <summary> * /// 分页获取数据列表 * /// </summary> * public DataSet GetList(int PageSize,int PageIndex,string strWhere) * { * SqlParameter[] parameters = { * new SqlParameter("@tblName", SqlDbType.VarChar, 255), * new SqlParameter("@fldName", SqlDbType.VarChar, 255), * new SqlParameter("@PageSize", SqlDbType.Int), * new SqlParameter("@PageIndex", SqlDbType.Int), * new SqlParameter("@IsReCount", SqlDbType.Bit), * new SqlParameter("@OrderType", SqlDbType.Bit), * new SqlParameter("@strWhere", SqlDbType.VarChar,1000), * }; * parameters[0].Value = "T_SM_ReadingRoom"; * parameters[1].Value = "ReadingRoomNo"; * parameters[2].Value = PageSize; * parameters[3].Value = PageIndex; * parameters[4].Value = 0; * parameters[5].Value = 0; * parameters[6].Value = strWhere; * return DbHelperSQL.RunProcedure("UP_GetRecordByPage",parameters,"ds"); * }*/ public ReadingRoomInfo DataRowToReadingRoomInfo(DataRow dr) { ReadingRoomInfo roomInfo = new ReadingRoomInfo(); roomInfo.No = dr["ReadingRoomNo"].ToString(); roomInfo.Name = dr["ReadingRoomName"].ToString(); if (!String.IsNullOrEmpty(dr["ReadingSetting"].ToString())) { roomInfo.Setting = new ReadingRoomSetting(dr["ReadingSetting"].ToString()); } else { roomInfo.Setting = new ReadingRoomSetting(); } if (!string.IsNullOrEmpty(dr["RoomSeat"].ToString())) { roomInfo.SeatList = SeatLayout.GetSeatLayout(dr["RoomSeat"].ToString()); } else { roomInfo.SeatList = new SeatLayout(); } roomInfo.Libaray.No = dr["LibraryNo"].ToString(); roomInfo.Libaray.Name = dr["LibraryName"].ToString(); roomInfo.Libaray.School.No = dr["SchoolNo"].ToString(); roomInfo.Libaray.School.Name = dr["SchoolName"].ToString(); roomInfo.Libaray.AreaList = roomInfo.Libaray.ToList(dr["AreaInfo"].ToString()); if (dr["AreaName"] != null && !string.IsNullOrEmpty(dr["AreaName"].ToString())) { foreach (AreaInfo item in roomInfo.Libaray.AreaList) { if (dr["AreaName"].ToString() == item.AreaName) { roomInfo.Area = item; break; } } } return(roomInfo); }
public JsonResult SaveNewViolate() { JsonResult result = null; SeatManage.ClassModel.RegulationRulesSetting regulationRulesSetting = T_SM_SystemSet.GetRegulationRulesSetting(); string CardNo = Request.Params["txtNum"].Trim(); string SeatNo = Request.Params["txtSeat"].Trim(); string seatnoremark = ""; if (!string.IsNullOrEmpty(SeatNo)) { seatnoremark = SeatNo + "号座位,"; } string Remark = Request.Params["txtRemark"].Trim(); // txtRemark.Text; ViolationRecordsType Type = (ViolationRecordsType)int.Parse(Request.Params["selectVrType"].Trim()); string ReadingRoomNo = Request.Params["selectRooms"].Trim(); //ddlroom.SelectedValue; ReadingRoomInfo room = SeatManage.Bll.T_SM_ReadingRoom.GetSingleRoomInfo(ReadingRoomNo); if (room.Setting.IsRecordViolate) { ViolationRecordsLogInfo vrli = new ViolationRecordsLogInfo(); vrli.CardNo = CardNo; vrli.SeatID = SeatNo; vrli.ReadingRoomID = ReadingRoomNo; vrli.EnterOutTime = ServiceDateTime.Now.ToString(); vrli.EnterFlag = Type; vrli.Remark = string.Format("在{0},{1}被管理员{2},手动记录违规,备注{3}", room.Name, seatnoremark, this.LoginId, Remark); if (T_SM_ViolateDiscipline.AddViolationRecords(vrli)) { result = Json(new { status = "yes", message = "添加成功" }, JsonRequestBehavior.AllowGet); } else { result = Json(new { status = "no", message = "添加失败" }, JsonRequestBehavior.AllowGet); // FineUI.Alert.Show("添加失败!"); } } return(result); }
private void Tip_ShortLeave_Load(object sender, EventArgs e) { string roomNum = clientobject.EnterOutLogData.EnterOutlog.ReadingRoomNo; ReadingRoomInfo room = clientobject.EnterOutLogData.Student.AtReadingRoom; if (room.Setting.SeatHoldTime.UsedAdvancedSet) { for (int i = 0; i < room.Setting.SeatHoldTime.AdvancedSeatHoldTime.Count; i++) { if (room.Setting.SeatHoldTime.AdvancedSeatHoldTime[i].Used) { DateTime startDate = DateTime.Parse(_NowDate.ToShortDateString() + " " + room.Setting.SeatHoldTime.AdvancedSeatHoldTime[i].UsedTime.BeginTime); DateTime endDate = DateTime.Parse(_NowDate.ToShortDateString() + " " + room.Setting.SeatHoldTime.AdvancedSeatHoldTime[i].UsedTime.EndTime); if (DateTimeOperate.DateAccord(startDate, endDate, _NowDate)) { lblMinutes.Text = room.Setting.SeatHoldTime.AdvancedSeatHoldTime[i].HoldTimeLength.ToString(); return; } } } } lblMinutes.Text = room.Setting.SeatHoldTime.DefaultHoldTimeLength.ToString(); }
/// <summary> /// 获取读者所在阅览室开闭状态 /// </summary> /// <returns></returns> public AJM_ReadingRoomState GetSingleRoomOpenState(string roomNo) { try { if (string.IsNullOrEmpty(roomNo)) { return(null); } AJM_ReadingRoomState ajmReadingRoomState = new AJM_ReadingRoomState(); List <string> listNum = new List <string>(); listNum.Add(roomNo); ReadingRoomInfo readingRoomInfo = SeatManageDateService.GetReadingRoomInfo(listNum)[0]; ajmReadingRoomState.OpenCloseState = readingRoomInfo.Setting.ReadingRoomOpenState(DateTime.Now).ToString(); ajmReadingRoomState.RoomName = readingRoomInfo.Name; ajmReadingRoomState.RoomNo = readingRoomInfo.No; return(ajmReadingRoomState); } catch (Exception ex) { WriteLog.Write(string.Format("获取读者所在阅览室开闭状态遇到异常:{0}", ex.Message)); return(null); } }
/// <summary> /// 保存设置 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnSubmit_Click(object sender, EventArgs e) { SeatManage.ClassModel.RegulationRulesSetting regulationRulesSetting = T_SM_SystemSet.GetRegulationRulesSetting(); string CardNo = txtCardno.Text; string SeatNo = txtseatno.Text; string seatnoremark = ""; if (!string.IsNullOrEmpty(SeatNo)) { seatnoremark = SeatNo + "号座位,"; } string Remark = txtRemark.Text; ViolationRecordsType Type = (ViolationRecordsType)int.Parse(ddltype.SelectedValue); string ReadingRoomNo = ddlroom.SelectedValue; ReadingRoomInfo room = SeatManage.Bll.T_SM_ReadingRoom.GetSingleRoomInfo(ReadingRoomNo); if (room.Setting.IsRecordViolate) { ViolationRecordsLogInfo vrli = new ViolationRecordsLogInfo(); vrli.CardNo = CardNo; vrli.SeatID = SeatNo; vrli.ReadingRoomID = ReadingRoomNo; vrli.EnterOutTime = ServiceDateTime.Now.ToString(); vrli.EnterFlag = Type; vrli.Remark = string.Format("在{0},{1}被管理员{2},手动记录违规,备注{3}", room.Name, seatnoremark, this.LoginId, Remark); if (T_SM_ViolateDiscipline.AddViolationRecords(vrli)) { PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference()); FineUI.Alert.Show("添加成功!"); } else { FineUI.Alert.Show("添加失败!"); } } }
/// <summary> /// 显示当前读者的详细进出记录 /// </summary> /// <param name="cardNo"></param> private void ShowEnterOutLogMessage(string cardNo) { if (!string.IsNullOrEmpty(cardNo)) { DateTime nowdt = ServiceDateTime.Now; List <EnterOutLogInfo> eollist = readerLogQuery.QueryEnterOugLogs(cardNo, nowdt); //List<BespeakLogInfo> blilist = readerLogQuery.QueryBespeakLogs(cardNo, nowdt); //List<WaitSeatLogInfo> wslilist = readerLogQuery.QueryWaitSeatLogs(cardNo, nowdt); lblCardNo.Text = cardNo; bool flag = false; for (int i = 0; i < eollist.Count; i++) { if (eollist[i].EnterOutType == SeatManage.EnumType.LogStatus.Valid && eollist[i].EnterOutState != SeatManage.EnumType.EnterOutLogType.Leave) { ReadingRoomInfo room = T_SM_ReadingRoom.GetSingleRoomInfo(eollist[i].ReadingRoomNo); lblReadingRoomName.Text = room.Name; lblSeatNo.Text = SeatComm.SeatNoToShortSeatNo(room.Setting.SeatNumAmount, eollist[i].SeatNo); lblNowState.Text = SeatComm.ConvertReaderState(eollist[i].EnterOutState); flag = true; break; } } if (!flag) { lblReadingRoomName.Text = "没有选择座位"; lblNowState.Text = "无座"; lblSeatNo.Text = "无"; } List <Label> labelList = readerLogQuery.GetEnterOutLogLabels(eollist); panel1.Controls.Clear(); for (int i = 0; i < labelList.Count; i++) { panel1.Controls.Add(labelList[i]); } } }