Esempio n. 1
0
        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);
            }
        }
        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
        }