Example #1
0
 private void comboCodeClient_KeyUp(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Enter)
     {
         TB_Client c = new TB_Client();
         if (c.FindByKey(comboCodeClient.Text))
         {
             textNomClient.Text       = c.Nom;
             textPrenomClient.Text    = c.Prenom;
             maskedTextTelClient.Text = c.NTel;
             textAdresseClient.Text   = c.Adresse;
             this.SelectNextControl(textAdresseClient, true, true, true, true);
             clientExiste = true;
         }
         else
         {
             comboCodeClient.Text     = c.GenerateCode();
             textNomClient.Text       = "";
             textPrenomClient.Text    = "";
             maskedTextTelClient.Text = "";
             textAdresseClient.Text   = "";
             this.SelectNextControl(comboCodeClient, true, true, true, true);
             clientExiste = false;
         }
     }
 }
Example #2
0
        private void c1Combo1_TextChanged(object sender, EventArgs e)
        {
            TB_Client client = new TB_Client();

            client.FindByKey(c1Combo1.Text);
            TextNomClient.Value     = client.Nom;
            TextPrenomClient.Value  = client.Prenom;
            TextTelClient.Value     = client.NTel;
            TextAdresseClient.Value = client.Adresse;
        }
Example #3
0
        public InfoClient(string Code)
        {
            InitializeComponent();
            Save = false;
            TB_Client client = new TB_Client();

            client.FindByKey(Code);
            c1TextBox1.Value = client.Code;
            c1TextBox2.Value = client.Nom;
            c1TextBox3.Value = client.Prenom;
            c1TextBox4.Value = client.Adresse;
            c1TextBox5.Value = client.NTel;
        }
Example #4
0
        private void comboCodeClient_SelectedIndexChanged(object sender, EventArgs e)
        {
            TB_Client c = new TB_Client();

            if (c.FindByKey(comboCodeClient.Text))
            {
                textNomClient.Text       = c.Nom;
                textPrenomClient.Text    = c.Prenom;
                maskedTextTelClient.Text = c.NTel;
                textAdresseClient.Text   = c.Adresse;
                this.SelectNextControl(textAdresseClient, true, true, true, true);
                clientExiste = true;
            }
        }
Example #5
0
 private void Supprimer_Click(object sender, EventArgs e)
 {
     if (MessageBox.Show("Vous ete sure de vouloire Supprimer ceux Client ?", "Attention", MessageBoxButtons.YesNo) == DialogResult.Yes)
     {
         int    index = c1TrueDBGrid1.Row;
         string Code  = c1TrueDBGrid1.Columns["Code"].CellText(index);
         if (Code == null)
         {
             MessageBox.Show("Code Vide");
             return;
         }
         DB_PostgreSQL dataBase = new DB_PostgreSQL();
         dataBase.ExecuteNonQuery("DELETE FROM \"Facture\" Where \"Code_Client\"='" + Code + "'");
         TB_Client Ar = new TB_Client();
         Ar.FindByKey(Code);
         Ar.DeleteData();
         GestionClient_Load(sender, e);
     }
 }