/// <summary> /// 判断当前时间阅览室选座状态 /// </summary> /// <param name="set"></param> /// <param name="time"></param> /// <returns></returns> public static SelectSeatMode RoomSelectSeatMode(SeatChooseMethodSet set, DateTime date) { SelectSeatMode chooseMethod = set.DefaultChooseMethod; //判断是否启用高级设置 if (set.UsedAdvancedSet) { DayOfWeek day = date.DayOfWeek; try { SeatChooseMethodPlan plan = set.AdvancedSelectSeatMode[day]; DateTime strDate = date; //遍历当天的时间段,判断是是否有满足当前时间的设置项 foreach (SeatChooseMethodOption option in plan.PlanOption) { DateTime beginDatetime = DateTime.Parse(strDate.ToShortDateString() + " " + option.UsedTime.BeginTime); DateTime endDatetime = DateTime.Parse(strDate.ToShortDateString() + " " + option.UsedTime.EndTime); if (DateTimeOperate.DateAccord(beginDatetime, endDatetime, date))//判断当前时间是否满足项 { chooseMethod = option.ChooseMethod; break; } } } catch { chooseMethod = set.DefaultChooseMethod; } } return(chooseMethod); }
/// <summary> /// 选座方式验证 /// </summary> /// <param name="clientset">终端选座方式</param> /// <param name="roomSelectSeatSet">阅览室设置的选座方式</param> /// <returns></returns> public static SelectSeatMode ProvenSelectSeatMethod(ClientConfig clientset, SeatChooseMethodSet roomSelectSeatSet) { SelectSeatMode method = SelectSeatMode.OptionalMode; if (clientset.SelectMethod == SelectSeatMode.Default) { method = NowReadingRoomState.RoomSelectSeatMode(roomSelectSeatSet, ServiceDateTime.Now); } else { method = clientset.SelectMethod; } return(method); }
/// <summary> /// 选座方式验证 /// </summary> /// <param name="clientset">终端选座方式</param> /// <param name="roomSelectSeatSet">阅览室设置的选座方式</param> /// <returns></returns> public static SelectSeatMode ProvenSelectSeatMethod(ClientConfigV2 clientset, SeatChooseMethodSet roomSelectSeatSet) { return(clientset.SelectMethod == SelectSeatMode.Default ? SeatManage.Bll.NowReadingRoomState.RoomSelectSeatMode(roomSelectSeatSet, SeatManage.Bll.ServiceDateTime.Now) : clientset.SelectMethod); }