private void button1_Click(object sender, EventArgs e) { int validite = 0; string bloquage = ""; if (txtcodecompte.Text.Equals("")) { validite = 1; txtcodecompte.Text = "Remplissez le champ"; MessageBox.Show("Remplissez le champ de recherche", "Attention", MessageBoxButtons.OK, MessageBoxIcon.Warning); } else { try { bool cl = objetcompte.RechercherCompte(txtcodecompte.Text); bool cp2 = objetpret.RechercherClient(objetcompte.RecupererNumeroClient()); if (cp2 != null) { MessageBox.Show(" Le pret ne peut être effectué car le client a déjà un pret en cours. ", "Impossible", MessageBoxButtons.OK, MessageBoxIcon.Warning); validite = 1; this.Size = new Size(486, 186); txtcodecompte.Focus(); //lbdevise.Visible = false; //lbdevise1.Visible = false; } else { bool cl1 = objetcompte.RechercherCompte(txtcodecompte.Text); bloquage = objetcompte.RecupererEtat(); if (!cl.Equals(null)) { if (bloquage.Equals("desactiver")) { MessageBox.Show("Ce compte est inactif", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { //lbdevise.Visible = true; //lbdevise.Text = cl.getdevise(); //lbdevise1.Visible = true; //lbdevise1.Text = cl.getdevise(); txtsolde.Text = objetcompte.RecupererSolde().ToString(); txtdevise.Text = objetcompte.RecupererDevise().ToString(); this.Size = new Size(486, 412); txtmontant.Focus(); montantcompte = objetcompte.RecupererSolde(); } } } } catch (Exception) { MessageBox.Show("Ce compte n'existe pas", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information); this.Size = new Size(486, 186); txtcodecompte.Focus(); //lbdevise.Visible = false; //lbdevise1.Visible = false; } } }