public Form1() { Cities = new CityDropdown(); Presenter = new DataPresenter(); InitializeComponent(); }
protected void Page_Load(object sender, EventArgs e) { RestrictDate = DateTime.UtcNow.ToLosAngerlesTime(); if (RestrictDate > DateTime.UtcNow.ToLosAngerlesTime().Date.AddHours(19)) { RestrictDate = RestrictDate.AddDays(1); } // Search CallBack IsForceResetFilter = Request["__EVENTARGUMENT"] == "true" || !IsPostBack; List <Products> listProducts; if (!IsPostBack) { //// Check-In Date if (Session["SearchRange"] != null) { CheckInDateText.Text = Session["SearchRange"].ToString(); } } Initialize(); // Update new market if user search again var currentSession = Session["UserSession"]; SetCustomerInfo(currentSession); Session["marketId"] = MarketSearch.Id; TitleLiteral.Text = string.Format(Constant.SearchDocumentTitle, MarketSearch.LocationName, StrPassSearch); if (currentSession != null) { // Update new market if user search again if (PublicCustomerInfos != null && Request.Path != PublicCustomerInfos.BrowsePassUrl) { PublicCustomerInfos.BrowsePassUrl = string.Format(Constant.SearchPageWithCityUrl, MarketSearch.Permalink, Request.Url.Segments[Request.Url.Segments.Length - 1]); _customerInfoRepository.Update(PublicCustomerInfos); } // Invalid Session if (PublicCustomerInfos == null && Request.Params["sp"] == null) { Session["UserSession"] = null; Response.Redirect(Request.Url.AbsoluteUri); } } CurrentProductLabel.Text = MarketSearch.LocationName; var liTag = (HtmlGenericControl)CityDropdown.FindControl(MarketSearch.Permalink); if (liTag != null) { liTag.Attributes["class"] = "active"; } BindHotelSearch(out listProducts); if (!IsPostBack) { BindMetaHeader(listProducts); } }