示例#1
0
        protected void btnPayer_Click(object sender, EventArgs e)
        {
            try
            {
                Client Utilisateur = (Client)Session["Client"];

                int      idclient      = Convert.ToInt32(Utilisateur.IdClient);
                int      idhebergement = Convert.ToInt32(Session["Reservation"]);
                DateTime datedebut     = Convert.ToDateTime(this.txtDateDebut.Text);
                DateTime datefin       = Convert.ToDateTime(this.txtDateFin.Text);
                string   Prix          = this.lblPrix.Text;
                bool     Statut        = true;
                int      ModePaiement  = 0;
                if (this.ddlPaiement.SelectedValue != null)
                {
                    ModePaiement = Convert.ToInt32(this.ddlPaiement.SelectedValue);
                }
                else
                {
                    ModePaiement = 1;
                }

                DaoReservation daoReservation = new DaoReservation();

                daoReservation.SetReservation(idclient, idhebergement, datedebut, datefin, Prix, Statut, ModePaiement);
                Response.Redirect("BackendCommandes.aspx", false);
            }
            catch (Exception ex)
            {
                this.lblErreur.Visible = true;
                this.lblErreur.Text    = ex.Message;
                ((SiteMaster)Page.Master).AddError(ex);
            }
        }
示例#2
0
        public void Application_Startup(object sender, StartupEventArgs e)
        {
            //C'est ici, dans la méthode Application_Startup, qu'on instancie nos objets Dbal et Dao

            mydbal             = new Dbal("Escp_Game");
            thedaoclients      = new DaoClient(mydbal);
            thedaotheme        = new DaoTheme(mydbal);
            thedaoavis         = new DaoAvis(mydbal, thedaoclients, thedaotheme);
            thedaoobstacles    = new DaoObstacle(mydbal, thedaotheme);
            thedaoville        = new DaoVille(mydbal);
            thedaosalles       = new DaoSalle(mydbal, thedaoville, thedaotheme);
            thedaoutilisateurs = new DaoUtilisateur(mydbal, thedaoville);
            thedaoreservation  = new DaoReservation(mydbal, thedaoclients, thedaosalles, thedaoutilisateurs, thedaotheme);
            thedaoplacement    = new DaoPlacement_Obst(mydbal, thedaoreservation, thedaoobstacles);
            thedaoheure        = new DaoHeure(mydbal);



            // Create the startup window
            //là, on lance la fenêtre souhaitée en instanciant la classe de notre fenêtre
            directeur wnd = new directeur(thedaoavis, thedaoclients, thedaoobstacles, thedaoplacement, thedaoreservation, thedaosalles, thedaotheme, thedaoutilisateurs, thedaoville, thedaoheure);            //et on utilise la méthode Show() de notre objet fenêtre pour afficher la fenêtre

            //exemple: MainWindow lafenetre = new MainWindow(); (et on y passe en paramètre Dbal et Dao au besoin)
            wnd.Show();
        }
 protected void Page_Load(object sender, EventArgs e)
 {
     try
     {
         Client Utilisateur = null;
         if (Session["Client"] != null)
         {
             Utilisateur = (Client)Session["Client"];
         }
         DaoReservation  daoreservation = new DaoReservation();
         List <Commande> MesCommandes   = daoreservation.GetCommande(Utilisateur.IdClient);
         if (MesCommandes.Count() > 0)
         {
             this.lvwHebergement.DataSource = MesCommandes;
             this.lvwHebergement.DataBind();
         }
         else
         {
             this.pnlModalMessage.Visible = true;
         }
     }
     catch (Exception ex)
     {
         ((backend)Page.Master).AddError(ex);
     }
 }
        protected void Page_Load(object sender, EventArgs e)
        {
            DaoReservation daoReservation = new DaoReservation();

            this.lsvReservations.DataSource = daoReservation.GetReservations();
            this.lsvReservations.DataBind();
        }
示例#5
0
        protected void Reserver_Click(object sender, EventArgs e)
        {
            Client client        = (Client)Session["Client"];
            int    idhebergement = Convert.ToInt32(((Button)sender).CommandArgument);

            DaoReservation daoReservation = new DaoReservation();

            List <Hebergement> mesReservations = daoReservation.GetReservation(client.IdClient, 1);

            if (mesReservations != null)
            {
                bool existe = false;
                foreach (Hebergement item in mesReservations)
                {
                    if (item.IdHebergement == idhebergement)
                    {
                        existe = true;
                        /*have*/
                        break; //have kitkat
                    }
                }
                if (!existe)
                {
                    daoReservation.createReservation(client.IdClient, idhebergement, 2);
                }
            }
            else
            {
                daoReservation.createReservation(client.IdClient, idhebergement, 2);
            }

            Response.Redirect("/EspaceClient/Reservation.aspx");
        }
示例#6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            daoReservation = new DaoReservation();

            if (!IsPostBack)
            {
                this.gdvReservation.DataSource = daoReservation.GetReservations();
                this.gdvReservation.DataBind();
            }
        }
示例#7
0
 private void Application_Startup(object sender, StartupEventArgs e)
 {
     mydbal            = new Dbal("Escp_Game");
     theDaoAvis        = new DaoAvis(mydbal, theDaoClient, theDaoTheme);
     theDaoClient      = new DaoClient(mydbal);
     theDaoObstacle    = new DaoObstacle(mydbal, theDaoTheme);
     theDaoPObstacle   = new DaoPlacement_Obst(mydbal, theDaoReservation, theDaoObstacle);
     theDaoReservation = new DaoReservation(mydbal, theDaoClient, theDaoSalle, theDaoUtilisateur, theDaoTheme);
     theDaoSalle       = new DaoSalle(mydbal, theDaoVille, theDaoTheme);
     theDaoTheme       = new DaoTheme(mydbal);
     theDaoTransaction = new DaoTransaction(mydbal, theDaoClient, theDaoReservation);
     theDaoUtilisateur = new DaoUtilisateur(mydbal, theDaoVille);
     theDaoVille       = new DaoVille(mydbal);
 }
示例#8
0
        private void Application_Startup(object sender, StartupEventArgs e)
        {
            mydbal            = new Dbal("escp_Game");
            theDaoClient      = new DaoClient(mydbal);
            theDaoVille       = new DaoVille(mydbal);
            theDaoTheme       = new DaoTheme(mydbal);
            theDaoUtilisateur = new DaoUtilisateur(mydbal, theDaoVille);
            theDaoSalle       = new DaoSalle(mydbal, theDaoVille, theDaoTheme);
            theDaoReservation = new DaoReservation(mydbal, theDaoClient, theDaoSalle, theDaoUtilisateur, theDaoTheme);
            theDaoTransaction = new DaoTransaction(mydbal, theDaoClient, theDaoReservation);


            //bool res = false;
            Connexion wndco = new Connexion(theDaoClient, theDaoTransaction, theDaoUtilisateur, theDaoVille);

            wndco.Show();
        }
示例#9
0
        protected void btnAvis_Click(object sender, EventArgs e)
        {
            int idclient      = client.IdClient;
            int idhebergement = hebergement.IdHebergement;


            decimal note        = Convert.ToInt32(this.txtNote.Text);
            string  commentaire = this.txtCommentaire.Text;
            bool    etat        = true;


            DaoReservation daoAvis = new DaoReservation();

            daoAvis.createAvis(idclient, idhebergement, note, commentaire, etat, 5);

            Response.Redirect("./Reservation.aspx");
        }
示例#10
0
        protected void btnDelete_Click(object sender, EventArgs e)
        {
            Client client        = (Client)Session["Client"];
            int    idhebergement = Convert.ToInt32(((Button)sender).CommandArgument);

            DaoReservation     daoReservation  = new DaoReservation();
            List <Hebergement> mesReservations = daoReservation.GetReservation(client.IdClient, 1);

            foreach (Hebergement item in mesReservations)
            {
                if (item.IdHebergement == idhebergement)
                {
                    daoReservation.DelReservation(client.IdClient, idhebergement);
                    Response.Redirect("../EspaceClient/Reservation.aspx");
                    /*have*/
                    break; //have kitkat
                }
            }
        }
示例#11
0
        private List <Hebergement> loadReservation(int idclient)
        {
            DaoReservation daoReservation = new DaoReservation();

            return(daoReservation.GetReservation(idclient, 1));
        }
示例#12
0
 public directeur(DaoAvis thedaoavis, DaoClient thedaoclient, DaoObstacle thedaoobstacle, DaoPlacement_Obst thedaoPlacement_Obst, DaoReservation theDaoReservation, DaoSalle thedaosalle, DaoTheme thedaotheme, DaoUtilisateur thedaoutilisateur, DaoVille thedaoville, DaoHeure thedaoheure)
 {
     InitializeComponent();
     Globale.DataContext = new viewModel.viewModelSalles(thedaoavis, thedaoclient, thedaoobstacle, thedaoPlacement_Obst, theDaoReservation, thedaosalle, thedaotheme, thedaoutilisateur, thedaoville, thedaoheure);
     grid1.Visibility    = Visibility.Hidden;
     grid2.Visibility    = Visibility.Hidden;
     grid3.Visibility    = Visibility.Hidden;
     grid4.Visibility    = Visibility.Hidden;
     HOME.Visibility     = Visibility.Visible;
 }