Ejemplo n.º 1
0
        private void choiceCamionAndChauffeur_Load(object sender, EventArgs e)
        {
            cmbCamion.DataSource    = SqlServer_Classes.executeAndReturnTable("select codecamm, Matricule from Camion");
            cmbCamion.ValueMember   = "codecamm";
            cmbCamion.DisplayMember = "Matricule";

            cmbChauffeur.DataSource    = SqlServer_Classes.executeAndReturnTable("select CodeChauffeur, CIN + ' ' + Upper(Nom) + ' ' + Lower(PreNom) as Name from chauffeur");
            cmbChauffeur.ValueMember   = "CodeChauffeur";
            cmbChauffeur.DisplayMember = "Name";
        }
Ejemplo n.º 2
0
        private void Consulter_Tournee_Load(object sender, EventArgs e)
        {
            DataTable dt = SqlServer_Classes.executeAndReturnTable(@"select *, [dbo].[getNbrCommande](NumeroTournee) from Tournee");

            foreach (DataRow r in dt.Rows)
            {
                userControl      = new LTournee_Row(int.Parse(r[0].ToString()), DateTime.Parse(r[1].ToString()), int.Parse(r[2].ToString()));
                userControl.Dock = DockStyle.Top;
                panelTournees.Controls.Add(userControl);
            }
            userControl      = new LTournee_Title();
            userControl.Dock = DockStyle.Top;
            panelTournees.Controls.Add(userControl);
        }
Ejemplo n.º 3
0
        private void Consulter_Commandes_Load(object sender, EventArgs e)
        {
            DataTable dt = SqlServer_Classes.executeAndReturnTable(@"select Codecommande, DateCommande, Convert(varchar, Client.Codeclient) + ' : ' + Upper(Nom) + ' ' + Prenom 
            from Commande inner join Client on Client.Codeclient = Commande.CodeClient");

            foreach (DataRow r in dt.Rows)
            {
                userControl      = new LCmd_Row(int.Parse(r[0].ToString()), DateTime.Parse(r[1].ToString()), r[2].ToString());
                userControl.Dock = DockStyle.Top;
                panelCommandes.Controls.Add(userControl);
            }
            userControl      = new LCmd_Title();
            userControl.Dock = DockStyle.Top;
            panelCommandes.Controls.Add(userControl);
        }
Ejemplo n.º 4
0
        public void loadCommande(int CodeCommande)
        {
            panelProducts.Controls.Clear();
            DataTable dt = SqlServer_Classes.executeAndReturnTable(@"select Designation, QteCommande, Unite, QteCommande * PrixUnitaire as mtTotal, ligneCommande.CodeProduit from Commande inner join ligneCommande on Commande.Codecommande = ligneCommande.Codecomm
                    inner join Produit on Produit.CodeProduit = ligneCommande.CodeProduit
                    where Commande.Codecommande = '" + CodeCommande + "'");

            foreach (DataRow r in dt.Rows)
            {
                userControl      = new Commande_Row(r[0].ToString(), int.Parse(r[1].ToString()), r[2].ToString(), decimal.Parse(r[3].ToString()), -1);
                userControl.Name = r[0].ToString();
                userControl.Dock = DockStyle.Top;
                panelProducts.Controls.Add(userControl);
            }
            userControl      = new Commande_Title();
            userControl.Dock = DockStyle.Top;
            panelProducts.Controls.Add(userControl);
            panelProducts.AutoScroll = false;
            panelProducts.HorizontalScroll.Enabled = false;
            panelProducts.HorizontalScroll.Visible = false;
            panelProducts.HorizontalScroll.Maximum = 0;
            panelProducts.AutoScroll = true;
        }
Ejemplo n.º 5
0
        public void loadCommande(int CodeTournee)
        {
            panelCommandes.Controls.Clear();
            DataTable dt = SqlServer_Classes.executeAndReturnTable(@"select CodeCommande, DateCommande, Convert(varchar, Client.Codeclient) + ' : ' + UPPER(Nom) + ' ' + LOWER(Prenom) from Commande
            inner join Client on Client.Codeclient = Commande.CodeClient
            where numTournee = '" + CodeTournee + "'");

            foreach (DataRow r in dt.Rows)
            {
                userControl = new LCmd_Row(int.Parse(r[0].ToString()), DateTime.Parse(r[1].ToString()), r[2].ToString());
                ((LCmd_Row)userControl).btnDetail.Enabled = false;
                userControl.Dock = DockStyle.Top;
                panelCommandes.Controls.Add(userControl);
            }
            userControl      = new LCmd_Title();
            userControl.Dock = DockStyle.Top;
            panelCommandes.Controls.Add(userControl);
            panelCommandes.AutoScroll = false;
            panelCommandes.HorizontalScroll.Enabled = false;
            panelCommandes.HorizontalScroll.Visible = false;
            panelCommandes.HorizontalScroll.Maximum = 0;
            panelCommandes.AutoScroll = true;
        }