protected void Page_Load(object sender, EventArgs e) { try { Session["ListeHebergement"] = Functions.LoadHebergement(); if (!IsPostBack) { //Nombre de photo dans le carrousel int nbrephotos = 5; List <Hebergement> ListeHasardeuse = lgthasard(nbrephotos); this.litCarousel.Visible = true; this.litCarousel.Text = Functions.GenerationCarousel(ListeHasardeuse); DaoDataDDL dataDDL = new DaoDataDDL(); this.ddlDepartement = Functions.GenerationDDL(this.ddlDepartement, dataDDL.GetDataDDL("Departement_code", "Departement_nom_uppercase", "Departement", null, null)); this.ddlDepartement.DataBind(); this.ddlType = Functions.GenerationDDL(this.ddlType, dataDDL.GetDataDDL("IdTypeHebergement", "NomHebergement", "TypeHebergement", null, null)); this.ddlType.DataBind(); } } catch (Exception ex) { ((SiteMaster)Page.Master).AddError(ex); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { DaoDataDDL daoDataDDL = new DaoDataDDL(); this.ddlType = Functions.GenerationDDL(this.ddlType, daoDataDDL.GetDataDDL("IdTypeHebergement", "NomHebergement", "TypeHebergement", null, null)); this.ddlType.DataBind(); } }
protected void Page_Load(object sender, EventArgs e) { try { if (Session["Client"] != null && Session["Reservation"] != null) { //Selection du logement à reserver Hebergement MaResa; DaoHebergement daoHebergement = new DaoHebergement(); MaResa = daoHebergement.GetHebergement((int)Session["Reservation"]); this.txtaujourdhui.Text = DateTime.Today.ToString("yyyy-MM-dd"); this.imgHebergement.ImageUrl = MaResa.Photo; this.lblTitre.Text = MaResa.Nom; this.lblDescription.Text = MaResa.Description; Adresse adresseHebergement = MaResa.Adresse; if (adresseHebergement != null) { this.lblAdresse.Text = Convert.ToString(adresseHebergement.Numero) + ' ' + Convert.ToString(adresseHebergement.Voie) + "<br />" + Convert.ToString(adresseHebergement.CodePostal) + " " + Convert.ToString(adresseHebergement.Ville); } if (!IsPostBack) { this.lblPrix.Text = Convert.ToString(MaResa.PrixDeBase); this.lblDuree.Text = "1"; } else { int compteJour = Convert.ToInt32(((Convert.ToDateTime(this.txtDateFin.Text)).Subtract(Convert.ToDateTime(this.txtDateDebut.Text))).TotalDays); decimal PrixTotal = (MaResa.PrixDeBase) * compteJour; this.lblPrix.Text = PrixTotal.ToString(); this.ddlPaiement.SelectedValue = this.ddlPaiement.SelectedValue; this.lblDuree.Text = compteJour.ToString(); } DaoDataDDL daoData = new DaoDataDDL(); this.ddlPaiement = Functions.GenerationDDL(this.ddlPaiement, daoData.GetDataDDL("IdModePaiement", "NomModePaiement", "ModePaiement", null, null)); this.ddlPaiement.DataBind(); } else { Response.Redirect("Default.aspx"); } } catch (Exception ex) { ((SiteMaster)Page.Master).AddError(ex); } }