示例#1
0
        protected void CheckAvailabilitySelectedDates_Click(object sender, EventArgs e)
        {
            if (Session["SelectedDates"] != null)
            {
                //create booking elements for grid view display
                sessionBookingElements = BookingElement.CreateBookingElementsForUserSelectedDates
                                             ((List <DateTime>)Session["SelectedDates"], currentRoomData);
                BookingElement.AddRoomRateByDate(currentRoomData, ref sessionBookingElements);
                BookingElement.AddAvailabilityToBookingElements(ref sessionBookingElements);
                //List<BookingElement> availableBookingElements =
                BookingElement.BookingElementsWithAvailability(ref sessionBookingElements);
                gvAvailability.DataSource = sessionBookingElements;
                gvAvailability.DataBind();
                foreach (GridViewRow row in gvAvailability.Rows)
                {
                    DropDownList dl        = (DropDownList)row.FindControl("ddlUserGuests");
                    int          max       = int.Parse(gvAvailability.Rows[row.RowIndex].Cells[2].Text);
                    int[]        ddlSource = Enumerable.Range(0, max + 1).ToArray();
                    dl.DataSource = ddlSource;
                    dl.DataBind();
                }

                UpdatePanelReturnAvailability.Update();
            }
        }
示例#2
0
        protected void btnClearDates_Click(object sender, EventArgs e)
        {
            userSelectedDate.Clear();
            EllensWebCalendar.SelectedDates.Clear();
            lstUserSelectedDates.Items.Clear();
            Session["SelectedDates"] = null;
            userSelectedDatesForDatabaseQuery.Clear();
            NoAvailability.Visible = false;

            //reset gridview for availability to emply and clear
            gvAvailability.DataSource = null;
            gvAvailability.DataBind();
            UpdatePanelReturnAvailability.Update();
        }