コード例 #1
0
 /// <summary>
 /// 绑定提供预约阅览室下拉列表
 /// </summary>
 private void BindSelReadingRoom()
 {
     try
     {
         List <ReadingRoomInfo> roomList = handler.GetCanBespeakNowDayRoomInfo();
         if (ReadingRoomList != null)
         {
             ReadingRoomList.Clear();
         }
         else
         {
             ReadingRoomList = new Dictionary <string, ReadingRoomInfo>();
         }
         foreach (ReadingRoomInfo room in roomList)
         {
             ReadingRoomList.Add(room.No, room);
             ListItem item = new ListItem {
                 Text = room.Name, Value = room.No
             };
             selReadingRoom.Items.Add(item);
         }
         if (selReadingRoom.Items.Count <= 0)
         {
             spanWarmInfo.Visible        = true;
             spanWarmInfo.InnerText      = "您选择的日期没有提供预约的阅览室,请重新选择日期!";
             DataListBookSeat.DataSource = null;
             DataListBookSeat.DataBind();
         }
     }
     catch (Exception ex)
     {
         spanWarmInfo.Visible   = true;
         spanWarmInfo.InnerText = ex.Message;
     }
 }
コード例 #2
0
 /// <summary>
 /// 绑定预约座位列表
 /// </summary>
 /// <param name="readingRoomNo">阅览室编号</param>
 /// <param name="conn"></param>
 private void BindBookSeat(string readingRoomId)
 {
     try
     {
         if (selReadingRoom.SelectedIndex == -1)
         {
             spanWarmInfo.Visible   = true;
             spanWarmInfo.InnerText = "请选择阅览室";
             return;
         }
         string      readingRoomNo = selReadingRoom.Items[selReadingRoom.SelectedIndex].Value;
         List <Seat> seats         = handler.GetReadingRoomSeatList(readingRoomNo);
         if (seats.Count <= 0)
         {
             DataListBookSeat.DataSource = null;
             DataListBookSeat.DataBind();
             spanWarmInfo.Visible   = true;
             spanWarmInfo.InnerText = "当前阅览室没有可选择的座位。";
         }
         DataListBookSeat.DataSource = seats;
         DataListBookSeat.DataBind();
         hidRrId.Value = readingRoomId;
     }
     catch (Exception ex)
     {
         spanWarmInfo.Visible        = true;
         spanWarmInfo.InnerText      = ex.Message;
         DataListBookSeat.DataSource = null;
         DataListBookSeat.DataBind();
     }
 }
コード例 #3
0
 /// <summary>
 /// 绑定提供预约阅览室下拉列表
 /// </summary>
 private void BindSelReadingRooms(string date)
 {
     try
     {
         List <AJM_ReadingRoom> roomList = handler.GetBesapeakRoomList(date, UserSchoolInfo.SchoolNo);
         ReadingRoomList = new Dictionary <string, AJM_ReadingRoom>();
         foreach (AJM_ReadingRoom room in roomList)
         {
             ReadingRoomList.Add(room.RoomNo, room);
             ListItem item = new ListItem {
                 Text = room.RoomName, Value = room.RoomNo
             };
             selReadingRoom.Items.Add(item);
         }
         if (selReadingRoom.Items.Count <= 0)
         {
             spanWarmInfo.Visible        = true;
             spanWarmInfo.InnerText      = "您选择的日期没有提供预约的阅览室,请重新选择日期!";
             DataListBookSeat.DataSource = null;
             DataListBookSeat.DataBind();
         }
     }
     catch (Exception ex)
     {
         spanWarmInfo.Visible   = true;
         spanWarmInfo.InnerText = ex.Message;
     }
 }
コード例 #4
0
 /// <summary>
 /// 绑定预约座位列表
 /// </summary>
 /// <param name="readingRoomNo">阅览室编号</param>
 /// <param name="conn"></param>
 private void BindBookSeat(string date, string readingRoomId)
 {
     try
     {
         if (selReadingRoom.SelectedIndex < 0)
         {
             spanWarmInfo.Visible   = true;
             spanWarmInfo.InnerText = "请选择阅览室";
             return;
         }
         string readingRoomNo = selReadingRoom.Items[selReadingRoom.SelectedIndex].Value;
         List <AJM_BespeakSeat> besapeakSeat = handler.GetRoomBesapeakSeat(readingRoomNo, date, UserSchoolInfo.SchoolNo);
         if (besapeakSeat.Count <= 0)
         {
             spanWarmInfo.Visible   = true;
             spanWarmInfo.InnerText = "您选择的阅览室当前日期已经没有可预约的座位。";
         }
         DataListBookSeat.DataSource = besapeakSeat;
         DataListBookSeat.DataBind();
         hidRrId.Value = readingRoomId;
     }
     catch (Exception ex)
     {
         spanWarmInfo.Visible        = true;
         spanWarmInfo.InnerText      = ex.Message;
         DataListBookSeat.DataSource = null;
         DataListBookSeat.DataBind();
     }
 }
コード例 #5
0
        /// <summary>
        /// 绑定提供预约阅览室下拉列表
        /// </summary>
        private void BindSelReadingRoom(string bookDate)
        {
            DateTime bespeakDate = DateTime.Parse(bookDate);

            try
            {
                List <SeatManage.ClassModel.ReadingRoomInfo> roomList = handler.GetCanBespeakReaderRoomInfo(this.UserSchoolInfo, bespeakDate);
                if (this.ReadingRoomList != null)
                {
                    this.ReadingRoomList.Clear();
                }
                else
                {
                    this.ReadingRoomList = new Dictionary <string, ReadingRoomInfo>();
                }
                foreach (ReadingRoomInfo room in roomList)
                {
                    this.ReadingRoomList.Add(room.No, room);
                    ListItem item = new ListItem()
                    {
                        Text = room.Name, Value = room.No
                    };
                    selReadingRoom.Items.Add(item);
                }
                if (selReadingRoom.Items.Count <= 0)
                {
                    spanWarmInfo.Visible        = true;
                    spanWarmInfo.InnerText      = "您选择的日期没有提供预约的阅览室,请重新选择日期!";
                    DataListBookSeat.DataSource = null;
                    DataListBookSeat.DataBind();
                }
            }
            catch (Exception ex)
            {
                spanWarmInfo.Visible   = true;
                spanWarmInfo.InnerText = ex.Message;
            }
        }
コード例 #6
0
 /// <summary>
 /// 绑定提供预约阅览室下拉列表
 /// </summary>
 private void BindSelReadingRoom()
 {
     try
     {
         List <SeatManage.ClassModel.ReadingRoomInfo> roomList = handler.GetReadingRoomUsingUsingState(this.UserSchoolInfo);
         if (this.ReadingRoomList != null)
         {
             this.ReadingRoomList.Clear();
         }
         else
         {
             this.ReadingRoomList = new Dictionary <string, ReadingRoomInfo>();
         }
         foreach (ReadingRoomInfo room in roomList)
         {
             this.ReadingRoomList.Add(room.No, room);
             ListItem item = new ListItem()
             {
                 Text = room.Name, Value = room.No
             };
             selReadingRoom.Items.Add(item);
         }
         if (selReadingRoom.Items.Count <= 0)
         {
             spanWarmInfo.Visible        = true;
             spanWarmInfo.InnerText      = "读不起当前没有可选座的阅览室";
             DataListBookSeat.DataSource = null;
             DataListBookSeat.DataBind();
         }
     }
     catch (Exception ex)
     {
         spanWarmInfo.Visible   = true;
         spanWarmInfo.InnerText = ex.Message;
     }
 }
        /// <summary>
        /// 绑定预约座位列表
        /// </summary>
        /// <param name="readingRoomNo">阅览室编号</param>
        /// <param name="conn"></param>
        private void BindBookSeat(string readingRoomId)
        {
            try
            {
                if (selReadingRoom.SelectedIndex == -1)
                {
                    spanWarmInfo.Visible   = true;
                    spanWarmInfo.InnerText = "请选择阅览室";
                    return;
                }
                string      readingRoomNo = selReadingRoom.Items[selReadingRoom.SelectedIndex].Value;
                List <Seat> seats         = handler.GetNowDayBookSeatList(this.UserSchoolInfo, readingRoomNo);
                if (seats.Count <= 0)
                {
                    spanWarmInfo.Visible   = true;
                    spanWarmInfo.InnerText = "您选择的日期已经没有可预约的座位。";
                }
                List <SeatManage.ClassModel.ReadingRoomInfo> roomList = handler.GetCanBespeakNowDayRoomInfo(this.UserSchoolInfo);
                if (roomList.Count > 0)
                {
                    foreach (SeatManage.ClassModel.ReadingRoomInfo room in roomList)
                    {
                        if (room.No == readingRoomNo)
                        {
                            if (room.Setting.LimitReaderEnter.Used)
                            {
                                bool isenter = false;
                                if (room.Setting.LimitReaderEnter.CanEnter)
                                {
                                    foreach (string t in room.Setting.LimitReaderEnter.ReaderTypes.Split(';'))
                                    {
                                        if (t == this.LoginUserInfo.ReaderType)
                                        {
                                            isenter = true;
                                        }
                                    }
                                }
                                else
                                {
                                    isenter = true;
                                    foreach (string t in room.Setting.LimitReaderEnter.ReaderTypes.Split(';'))
                                    {
                                        if (t == this.LoginUserInfo.ReaderType)
                                        {
                                            isenter = false;
                                        }
                                    }
                                }
                                if (!isenter)
                                {
                                    seats = new List <Seat>();
                                    spanWarmInfo.Visible   = true;
                                    spanWarmInfo.InnerText = "您的读者类型不允许在此阅览室预约。";
                                }
                            }
                            if (room.Setting.SeatBespeak.BespeakArea.BespeakType == BespeakAreaType.Percentage)
                            {
                                int stopSeatCount = 0;
                                foreach (KeyValuePair <string, Seat> item in room.SeatList.Seats)
                                {
                                    if (item.Value.IsSuspended)
                                    {
                                        stopSeatCount++;
                                    }
                                }
                                int bookdCount   = room.SeatList.Seats.Count - seats.Count;
                                int canbookCount = (int)((room.SeatList.Seats.Count - stopSeatCount) * room.Setting.SeatBespeak.BespeakArea.Scale);
                                if (bookdCount >= canbookCount)
                                {
                                    seats = new List <Seat>();
                                    spanWarmInfo.Visible   = true;
                                    spanWarmInfo.InnerText = "您选择的日期已经没有可预约的座位。";
                                }
                            }
                            break;
                        }
                    }
                }

                DataListBookSeat.DataSource = seats;
                DataListBookSeat.DataBind();
                hidRrId.Value = readingRoomId;
            }
            catch (Exception ex)
            {
                spanWarmInfo.Visible        = true;
                spanWarmInfo.InnerText      = ex.Message;
                DataListBookSeat.DataSource = null;
                DataListBookSeat.DataBind();
            }
        }