private void NouvelleCommande_Load(object sender, EventArgs e) { this.comboCodeClient.Focus(); //----------------Informations Societe (BEGIN)------------------------------// InfoSociete Societe = new InfoSociete(); string titre = Societe.nom + "\n" + Societe.adresse + "\nTel:" + Societe.tel + " Fax:" + Societe.fax; label10.Text = titre; MemoryStream ms = new MemoryStream(); ms.Write(Societe.logo, 0, Societe.logo.Length); Image imgPhoto = Image.FromStream(ms); picLogo.Image = imgPhoto; //----------------Informations Societe (END)------------------------------// labelCodeFacture.Text = facture.GenerateCode(); comboCodeClient.DataSource = TB_Client.GetList(); comboCodeClient.DisplayMember = "Code"; dateTimePicker2.Value = dateTimePicker2.Value.AddDays(1); comboCodeClient.Text = client.GenerateCode(); textNomClient.Text = ""; textPrenomClient.Text = ""; maskedTextTelClient.Text = ""; textAdresseClient.Text = ""; }
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; } } }
public InfoClient() { InitializeComponent(); Save = true; btnOK.Enabled = true; TB_Client client = new TB_Client(); c1TextBox1.Value = client.GenerateCode(); }
private void button1_Click(object sender, EventArgs e) { TB_Client client = new TB_Client(); TextNomClient.Value = ""; TextPrenomClient.Value = ""; TextTelClient.Value = ""; TextAdresseClient.Value = ""; c1Combo1.Text = client.GenerateCode(); }