protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { Voyage[] voyages; voyages = VoyageFactory.GetAll(ConfigurationManager.ConnectionStrings["cnnStr"].ConnectionString); Repeater_Voyages.DataSource = voyages.ToArray(); Repeater_Voyages.DataBind(); } }
protected void Page_Load(object sender, EventArgs e) { Membre membre = Session[TP3.SESSIONMEMBRE] as Membre; if (membre != null) { Reservation[] reservations = ReservationFactory.GetAllById(System.Configuration.ConfigurationManager.ConnectionStrings["cnnStr"].ConnectionString, membre.Id); Repeater_Voyages.DataSource = reservations.ToArray(); Repeater_Voyages.DataBind(); } else { Response.Redirect("Default.aspx"); } }
protected void Rechercher_Click(object sender, EventArgs e) { string depart; string destination; bool fumeur; bool animaux; bool bienEquipe; DateTime dateDebut; DateTime dateFin; depart = txtDepart.Text; destination = txtDestination.Text; fumeur = ckBoxFumeur.Checked; animaux = ckBoxAnimaux.Checked; bienEquipe = ckBoxBcpBagage.Checked; dateDebut = calDebut.SelectedDate; dateFin = calFin.SelectedDate; Voyage[] voyages = VoyageFactory.Search(ConfigurationManager.ConnectionStrings["cnnStr"].ConnectionString, fumeur, animaux, bienEquipe, depart, destination, dateDebut, dateFin); Repeater_Voyages.DataSource = voyages.ToArray(); Repeater_Voyages.DataBind(); }