Esempio n. 1
0
        private void bunifuImageButton1_Click(object sender, EventArgs e)
        {
            string      code        = bunifuCustomTextbox1.Text;
            Fournisseur fournisseur = app.manager.searchFournisseurByKey(bunifuCustomTextbox8.Text)[0];


            string modePaiement = (string)metroComboBox2.SelectedItem;
            double montant      = Double.Parse(bunifuCustomTextbox5.Text);
            double regle        = Double.Parse(bunifuCustomTextbox6.Text);
            double reste        = Double.Parse(bunifuCustomTextbox7.Text);

            Paiement paiement = new Paiement(modePaiement, montant, regle, reste);

            string   designation   = bunifuCustomTextbox2.Text;
            double   quantite      = Double.Parse(bunifuCustomTextbox3.Text);
            double   prixUnitaire  = Double.Parse(bunifuCustomTextbox4.Text);
            DateTime dateOperation = bunifuDatepicker1.Value;

            app.manager.updateOperationFournisseur(operation, new OperationFournisseur(code, fournisseur, paiement, designation, quantite, prixUnitaire, dateOperation));
            Close();
        }
Esempio n. 2
0
        public void selectFromOperationFournisseur()
        {
            string     req = "SELECT * FROM OPERATIONFOURNISSEUR;";
            SqlCommand cmd = new SqlCommand(req, con);

            SqlDataReader r = cmd.ExecuteReader();

            while (r.Read())
            {
                try
                {
                    string      code        = (string)r[0];
                    Fournisseur fournisseur = app.manager.searchFournisseurByCode((string)r[1]);


                    string modePaiement = (string)r[2];
                    double montant      = (double)r[3];
                    double regle        = (double)r[4];
                    double reste        = (double)r[5];



                    string   designation   = (string)r[6];
                    double   quantite      = (double)r[7];
                    double   prixUnitaire  = (double)r[8];
                    DateTime dateOperation = (DateTime)r[9];

                    Paiement paiement = new Paiement(modePaiement, montant, regle, reste);
                    Console.WriteLine(code + "," + fournisseur + "," + modePaiement + "," + montant + "," + regle + "," + reste + "," + designation + "," + quantite
                                      + "," + prixUnitaire + "," + dateOperation);
                    app.manager.addOperationFournisseur(new OperationFournisseur(code, fournisseur, paiement, designation, quantite, prixUnitaire, dateOperation));
                }
                catch (Exception ex)
                {
                    Console.WriteLine(ex.Message);
                }
            }
            r.Close();
        }
Esempio n. 3
0
        private void bunifuImageButton1_Click(object sender, EventArgs e)
        {
            if (bunifuCustomTextbox1.Text == "")
            {
                MessageBox.Show("Le code est obligatoire");
            }
            else
            {
                if (app.manager.searchOperationCLientByCode(bunifuCustomTextbox1.Text) == null)
                {
                    string code   = bunifuCustomTextbox1.Text;
                    Client client = app.manager.searchClientByKey((string)metroComboBox1.SelectedItem)[0];


                    string modePaiement = (string)metroComboBox2.SelectedItem;
                    double montant      = Double.Parse(bunifuCustomTextbox5.Text);
                    double regle        = Double.Parse(bunifuCustomTextbox6.Text);
                    double reste        = Double.Parse(bunifuCustomTextbox7.Text);



                    string   designation   = bunifuCustomTextbox2.Text;
                    double   quantite      = Double.Parse(bunifuCustomTextbox3.Text);
                    double   prixUnitaire  = Double.Parse(bunifuCustomTextbox4.Text);
                    DateTime dateOperation = bunifuDatepicker1.Value;

                    Paiement paiement = new Paiement(modePaiement, ttc, regle, reste);

                    app.manager.addOperationClient(new OperationClient(code, client, paiement, designation, quantite, prixUnitaire, dateOperation));
                    MessageBox.Show("Operation bien ajouter, lancement de la facture attendez svp : ");
                    facture();
                    Close();
                }
                else
                {
                    MessageBox.Show("Cette Operation existe déja");
                }
            }
        }