/// <summary>
        /// 获取阅览室列表
        /// </summary>
        /// <param name="LoginID"></param>
        /// <returns></returns>
        public static DataTable GetMonitorGraphReadingRoomList(string LoginID)
        {
            DataTable dt = new DataTable();

            dt.Columns.Add("roomNum", typeof(string));
            dt.Columns.Add("roomName", typeof(string));
            dt.Columns.Add("libraryName", typeof(string));
            dt.Columns.Add("seatCountAll", typeof(int));
            dt.Columns.Add("seatCountUsed", typeof(int));
            dt.Columns.Add("seatCountShortLeave", typeof(int));

            SeatManage.ClassModel.ManagerPotency potency = SeatManage.Bll.T_SM_ManagerPotency.GetManangePotencyByLoginID(LoginID);
            List <string> roomNums = new List <string>();
            Dictionary <string, ReadingRoomSeatUsedState> roomSeatUsingState = new Dictionary <string, ReadingRoomSeatUsedState>();

            if (potency != null)
            {
                for (int i = 0; i < potency.RightRoomList.Count; i++)
                {
                    roomNums.Add(potency.RightRoomList[i].No);
                }
            }
            roomSeatUsingState = NowReadingRoomState.GetRoomSeatUsedState(roomNums);
            foreach (ReadingRoomInfo model in potency.RightRoomList)
            {
                DataRow dr = dt.NewRow();
                dr["roomNum"]     = model.No;
                dr["roomName"]    = model.Name;
                dr["libraryName"] = model.Libaray.Name;
                //int stopSeatCount = 0;
                //foreach (KeyValuePair<string, Seat> item in model.SeatList.Seats)
                //{
                //    if (item.Value.IsSuspended)
                //    {
                //        stopSeatCount++;
                //    }
                //}
                dr["seatCountAll"]        = roomSeatUsingState[model.No].SeatAmountAll;
                dr["seatCountUsed"]       = roomSeatUsingState[model.No].SeatAmountUsed;
                dr["seatCountShortLeave"] = roomSeatUsingState[model.No].SeatAmountShortLeave;
                dt.Rows.Add(dr);
            }
            return(dt);
        }
        /// <summary>
        /// 获取当天预约座位
        /// </summary>
        /// <param name="libNum"></param>
        /// <returns></returns>
        public static DataTable NowDayBespeakRoomInfo(string libNum)
        {
            DataTable dt = new DataTable();

            dt.Columns.Add("roomNum", typeof(string));
            dt.Columns.Add("roomName", typeof(string));
            dt.Columns.Add("libraryName", typeof(string));
            dt.Columns.Add("SeatAmount", typeof(int));
            dt.Columns.Add("SurplusBespeskAmcount", typeof(int));
            dt.Columns.Add("RoomSetting", typeof(string));
            //获取图书馆下的阅览室信息
            List <string> libNums = new List <string>();

            libNums.Add(libNum);
            List <SeatManage.ClassModel.ReadingRoomInfo> rooms = SeatManage.Bll.T_SM_ReadingRoom.GetReadingRooms(null, libNums, null);
            List <string> roomNums = new List <string>();

            foreach (SeatManage.ClassModel.ReadingRoomInfo room in rooms)
            {
                roomNums.Add(room.No);
            }
            //获取阅览室中的座位使用信息
            Dictionary <string, ReadingRoomSeatUsedState> roomSeatUsingState = new Dictionary <string, ReadingRoomSeatUsedState>();

            roomSeatUsingState = NowReadingRoomState.GetRoomSeatUsedState(roomNums);
            for (int i = 0; i < rooms.Count; i++)
            {
                if (!rooms[i].Setting.SeatBespeak.Used || !rooms[i].Setting.SeatBespeak.NowDayBespeak)
                {
                    continue;
                }
                DataRow dr = dt.NewRow();
                dr["roomName"]              = rooms[i].Name;
                dr["roomNum"]               = rooms[i].No;
                dr["libraryName"]           = rooms[i].Libaray.Name;
                dr["SeatAmount"]            = roomSeatUsingState[rooms[i].No].SeatAmountAll;
                dr["SurplusBespeskAmcount"] = roomSeatUsingState[rooms[i].No].SeatAmountAll - roomSeatUsingState[rooms[i].No].SeatAmountUsed - roomSeatUsingState[rooms[i].No].SeatBookingCount + roomSeatUsingState[rooms[i].No].SeatTemUseCount;
                dr["RoomSetting"]           = rooms[i].Setting.ToString();
                dt.Rows.Add(dr);
            }
            return(dt);
        }
        /// <summary>
        /// 图书馆座位信息绑定
        /// </summary>
        /// <param name="libId"></param>
        /// <returns></returns>
        public static DataTable LibrarySeatInfo(string libNum)
        {
            DataTable dt = new DataTable();

            dt.Columns.Add("ReadingRoomName", typeof(string));
            dt.Columns.Add("SeatAmount", typeof(int));
            dt.Columns.Add("SeatUsedAmount", typeof(int));
            dt.Columns.Add("PersonTimes", typeof(int));
            dt.Columns.Add("LeisureSeat", typeof(int));
            //获取图书馆下的阅览室信息
            List <string> libNums = new List <string>();

            libNums.Add(libNum);
            List <SeatManage.ClassModel.ReadingRoomInfo> rooms = SeatManage.Bll.T_SM_ReadingRoom.GetReadingRooms(null, libNums, null);
            List <string> roomNums = new List <string>();

            foreach (SeatManage.ClassModel.ReadingRoomInfo room in rooms)
            {
                roomNums.Add(room.No);
            }
            //获取阅览室中的座位使用信息
            Dictionary <string, ReadingRoomSeatUsedState> roomSeatUsingState = new Dictionary <string, ReadingRoomSeatUsedState>();

            roomSeatUsingState = NowReadingRoomState.GetRoomSeatUsedState(roomNums);
            for (int i = 0; i < rooms.Count; i++)
            {
                if (!roomSeatUsingState.ContainsKey(rooms[i].No))
                {
                    continue;
                }
                DataRow dr = dt.NewRow();

                dr["ReadingRoomName"] = rooms[i].Name;
                dr["SeatAmount"]      = roomSeatUsingState[rooms[i].No].SeatAmountAll;
                dr["SeatUsedAmount"]  = roomSeatUsingState[rooms[i].No].SeatAmountUsed;
                dr["PersonTimes"]     = roomSeatUsingState[rooms[i].No].PersonTimes;
                dr["LeisureSeat"]     = roomSeatUsingState[rooms[i].No].SeatAmountAll - roomSeatUsingState[rooms[i].No].SeatAmountUsed - roomSeatUsingState[rooms[i].No].SeatBookingCount + roomSeatUsingState[rooms[i].No].SeatTemUseCount;
                dt.Rows.Add(dr);
            }
            return(dt);
        }