Ejemplo n.º 1
0
    protected void Page_Init(object sender, EventArgs e)
    {
        if (SearchState.ValidateDetailsPageParameters(Request.Params))
        {
            State = new SearchState("Details", Request.Params, new HotelBooking.HotelBookingDataContextExt());
        }

        CheckInDateEdit.MinDate = DateTime.Now + TimeSpan.FromDays(1);

        if (State != null)
        {
            LocationComboBox.DataBindItems();
            LocationComboBox.SelectedItem = LocationComboBox.Items.FindByValue(State.Metro_Area.ID);
            CheckOutDateEdit.Value        = State.CheckOutDate;
            CheckInDateEdit.Value         = State.CheckInDate;
            RoomsComboBox.Value           = State.RoomsCount;
            AdultsSpinEdit.Value          = State.AdultsCount;
            ChildrenSpinEdit.Value        = State.ChildrenCount;
        }
        else
        {
            CheckOutDateEdit.Value = DateTime.Now + TimeSpan.FromDays(3);
            CheckInDateEdit.Value  = DateTime.Now + TimeSpan.FromDays(1);
        }
    }
 protected void Page_Init(object sender, EventArgs e)
 {
     if (!SearchState.ValidateDetailsPageParameters(Request.Params))
     {
         Response.Redirect("Default.aspx");
     }
     State             = new SearchState("Details", Request.Params, new HotelBookingDataContextExt());
     SearchPanel.State = State;
     BindRoomsNavBar(State.Hotel);
     //Pruebas
 }