Beispiel #1
0
        private void txtAnnuler_Click(object sender, EventArgs e)
        {
            Ajout f1 = new Ajout(reef, idClient);

            this.Dispose();
            f1.ShowDialog();
        }
Beispiel #2
0
        private void btnAjouter_Click(object sender, EventArgs e)
        {
            string referance;

            BAL.BALCommande bl;
            bl = new BALCommande();


            referance = (bl.getMaxRef() + 1).ToString();
            Ajout f1 = new Ajout(referance, "");

            f1.ShowDialog();
        }
Beispiel #3
0
        private void btnValider_Click(object sender, EventArgs e)
        {
            bl = new BALLigCmd();
            dl = new LigCmd();

            /*  dl.NumCmd = Int32.Parse(reef);
             * dl.CodeProduit = txtProduit.Text;
             * dl.Qte = Int32.Parse(txtQte.Text);
             * dl.Prix = Int32.Parse(txtPrix.Text);*/
            OleDbConnection ccn = new OleDbConnection();

            ccn = Global.seConnecter(Global.cs);
            string codeprd = "'" + txtProduit.Text + "'";

            Global.ExecuterOleDbAction(@"update LigCmd set LigCmd.Qte = " + Int32.Parse(txtQte.Text) + ", LigCmd.Prix = " + Int32.Parse(txtPrix.Text) + " where LigCmd.CodeProduit = " + codeprd + " and LigCmd.NumCmd = " + Int32.Parse(reef), ccn);


            Global.seDeconnecter(ccn);


            Ajout f1 = new Ajout(reef, idClient);



            OleDbConnection cn = new OleDbConnection();
            OleDbDataReader lect;

            cn   = Global.seConnecter(Global.cs);
            lect = Global.ExecuterOleDBSelect(@"select * from Client where NumClient =" + idClient, cn);
            while (lect.Read())
            {
                f1.txtClient.Text     = lect.GetValue(1).ToString();
                f1.txtRue.Text        = lect.GetValue(2).ToString();
                f1.txtVille.Text      = lect.GetValue(3).ToString();
                f1.txtCodePostal.Text = lect.GetValue(4).ToString();
                f1.txtTel.Text        = lect.GetValue(5).ToString();
            }
            Global.seDeconnecter(cn);
            lect.Close();

            this.Dispose();
            f1.ShowDialog();
        }
Beispiel #4
0
        private void btnValider_Click(object sender, EventArgs e)
        {
            int res;

            bl             = new BALLigCmd();
            dl             = new LigCmd();
            dl.NumCmd      = Int32.Parse(reef);
            dl.CodeProduit = txtProduit.Text;
            dl.Qte         = Int32.Parse(txtQte.Text);
            dl.Prix        = Int32.Parse(txtPrix.Text);

            res = bl.AjouterLigCmd(dl);
            if (res == 1)
            {
                Ajout f1 = new Ajout(reef, idClient);



                OleDbConnection cn = new OleDbConnection();
                OleDbDataReader lect;
                cn   = Global.seConnecter(Global.cs);
                lect = Global.ExecuterOleDBSelect(@"select * from Client where NumClient =" + idClient, cn);
                while (lect.Read())
                {
                    f1.txtClient.Text     = lect.GetValue(1).ToString();
                    f1.txtRue.Text        = lect.GetValue(2).ToString();
                    f1.txtVille.Text      = lect.GetValue(3).ToString();
                    f1.txtCodePostal.Text = lect.GetValue(4).ToString();
                    f1.txtTel.Text        = lect.GetValue(5).ToString();
                }
                Global.seDeconnecter(cn);
                lect.Close();

                this.Dispose();
                f1.ShowDialog();
            }
            else
            {
                MessageBox.Show("Echec Ajout de Ligne Comm.");
            }
        }
Beispiel #5
0
        private void btnModifier_Click(object sender, EventArgs e)
        {
            if (gridList.SelectedRows.Count == 1)
            {
                string Idcmd = gridList.SelectedRows[0].Cells[0].Value.ToString();

                bl = new BALCommande();
                dl = new Commande();



                Ajout f1 = new Ajout(gridList.SelectedRows[0].Cells[0].Value.ToString(), bl.getCltbyIdcmd(Idcmd).ToString());



                OleDbConnection cn = new OleDbConnection();
                OleDbDataReader lect;
                cn   = Global.seConnecter(Global.cs);
                lect = Global.ExecuterOleDBSelect(@"select * from Client where NumClient =" + Int32.Parse(bl.getCltbyIdcmd(Idcmd).ToString()), cn);
                while (lect.Read())
                {
                    f1.txtClient.Text     = lect.GetValue(1).ToString();
                    f1.txtRue.Text        = lect.GetValue(2).ToString();
                    f1.txtVille.Text      = lect.GetValue(3).ToString();
                    f1.txtCodePostal.Text = lect.GetValue(4).ToString();
                    f1.txtTel.Text        = lect.GetValue(5).ToString();
                }
                Global.seDeconnecter(cn);
                lect.Close();

                f1.ShowDialog();
            }


            else
            {
                MessageBox.Show("Selectionner le commande souhaiter" + "\n" + "Selectionner la ligne entiere.", "Erreur de selection", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
        }
Beispiel #6
0
        private void btnValider_Click(object sender, EventArgs e)
        {
            if (gridClient.SelectedRows.Count == 1)
            {
                string IdClient = gridClient.SelectedRows[0].Cells[0].Value.ToString();

                Ajout f1 = new Ajout(ch1, IdClient);

                f1.txtClient.Text     = gridClient.SelectedRows[0].Cells[1].Value.ToString();
                f1.txtRue.Text        = gridClient.SelectedRows[0].Cells[2].Value.ToString();
                f1.txtVille.Text      = gridClient.SelectedRows[0].Cells[3].Value.ToString();
                f1.txtCodePostal.Text = gridClient.SelectedRows[0].Cells[4].Value.ToString();
                f1.txtTel.Text        = gridClient.SelectedRows[0].Cells[5].Value.ToString();
                this.Dispose();
                f1.ShowDialog();
            }
            else
            {
                MessageBox.Show("Selectionner le client souhaiter" + "\n" + "Selectionner la ligne entiere.", "Erreur de selection", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
        }