protected void SearchFlghtButton_Click(object sender, EventArgs e) { SearchParameters sp = new SearchParameters(); if (From.Text != null) { sp.Location = From.Text; } if (Destination.Text != null) { sp.Destination = Destination.Text; } if (When.Text != null && When.Text.Length > 0) { //MessageBox.Show(When.Text); sp.departDt = Convert.ToDateTime(When.Text); } if ((When.Text != null && When.Text.Length > 0) && (Days.Text != null && Days.Text.Length > 0)) { sp.returnDt = Convert.ToDateTime(When.Text).AddDays(Convert.ToInt32(Days.Text)); } Search.DataSource = FlightsTableDB.SearchFlights(sp); Search.DataBind(); //MessageBox.Show(sp.Destination + sp.Location + sp.departDt + sp.returnDt); }
protected void Page_Load(object sender, EventArgs e) { Search.DataSource = FlightsTableDB.getFlights(); Search.DataBind(); }