private void button1_Click(object sender, EventArgs e) { int validite = 0; if (txtcodecompte.Text.Equals("")) { validite = 1; txtcodecompte.Text = "Remplissez le champ"; MessageBox.Show("Entrez le numero du compte a rechercher", "Attention", MessageBoxButtons.OK, MessageBoxIcon.Warning); } else { try { bool cl = objetcompte.RechercherCompte(txtcodecompte.Text); if (!cl.Equals(false)) { this.Size = new Size(429, 415); txtcodeclient.Text = objetcompte.RecupererNumeroClient(); txtmontant.Text = objetcompte.RecupererSolde().ToString(); txttype.Text = objetcompte.RecupererType(); txtdevise.Text = objetcompte.RecupererDevise(); txtdatecreation.Text = objetcompte.RecupererDatecreation(); txtetat.Text = objetcompte.RecupererEtat(); } } catch (Exception) { MessageBox.Show("Ce compte n'existe pas", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information); } } }
private void textBox1_Click(object sender, EventArgs e) { if (txtcodecompte2.Text.Equals("Remplissez ce champ")) { txtcodecompte2.Text = ""; } if (txtcodecompte1.Text.Equals("")) { txtcodecompte1.Visible = true; txtcodecompte1.Text = "Remplissez ce champ"; } else if (txtcodecompte1.Text.Equals("Remplissez ce champ")) { txtcodecompte1.Text = ""; } else { try { if (txtcodecompte1.Text.Equals("Remplissez ce champ")) { txtcodecompte1.Text = ""; } else { bool cl = objetcompte.RechercherCompte(txtcodecompte1.Text); string devise = objetcompte.RecupererDevise(); if (!cl.Equals(false)) { string et = objetcompte.RecupererEtat(); if (et.Equals("desactiver")) { lberrorcp1.Visible = true; lberrorcp1.Text = "Compte inactif"; } else { lberrorcp1.Visible = true; lberrorcp1.Text = objetcompte.RecupererSolde() + " " + devise; } } } } catch (Exception) { // MessageBox.Show("Compte inexistant"); lberror1.Visible = true; lberrorcp1.Visible = true; lberrorcp1.Text = "Compte inexistant"; } } }
private void button1_Click(object sender, EventArgs e) { int validite = 0; if (txtcodecompte.Text.Equals("")) { validite = 1; MessageBox.Show("Remplissez le champ", "Attention", MessageBoxButtons.OK, MessageBoxIcon.Warning); } else { try { bool cl = objetcompte.RechercherCompte(txtcodecompte.Text); string devise = objetcompte.RecupererDevise(); if (!cl.Equals(false)) { string et = objetcompte.RecupererEtat(); if (et.Equals("desactiver")) { validite = 1; MessageBox.Show("Ce compte est inactif", "Attention", MessageBoxButtons.OK, MessageBoxIcon.Warning); } else { this.Size = new Size(454, 415); txtdepot.Enabled = true; txtmontant.Text = objetcompte.RecupererSolde() + " " + devise; bteffectuer.Enabled = true; btannuler.Enabled = true; txtdepot.Select(); cmbdevise.Text = devise; } } } catch (Exception) { MessageBox.Show("Compte inexistant"); } } }
private void button1_Click(object sender, EventArgs e) { int validite = 0; string bloquage = ""; if (txtcodecompte.Text.Equals("")) { validite = 1; MessageBox.Show("Remplissez le champ de recherche", "Attention", MessageBoxButtons.OK, MessageBoxIcon.Warning); } else { try { bool cl = Ut.RechercherCompte(txtcodecompte.Text); bloquage = Ut.RecupererEtat(); if (!cl.Equals(false)) { if (bloquage.Equals("desactiver")) { MessageBox.Show("Ce compte est deja inactif", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { this.Size = new Size(414, 244); } } } catch (Exception) { MessageBox.Show("Compte n'existe pas", "Attention", MessageBoxButtons.OK, MessageBoxIcon.Warning); } } }
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; } } }