private void AddCarteForm_Load(object sender, EventArgs e) { if (carte.Id == 0) { txtNumero.Text = CarteDao.generateKey(); } }
private void btnSave_Click(object sender, EventArgs e) { Form2Model(); CarteDao.save(carte); Vider(); txtNumero.Text = CarteDao.generateKey(); }
public void Dataload1() { List <Carte> Buss = CarteDao.findAll(); foreach (Carte carte in Buss) { cbNumeroCarte.Items.Add(carte.Numero); } }
public void Form2Model() { versement.Numero = txtNumero.Text; versement.Montant = double.Parse(txtMontant.Text); versement.Description = txtDescrip.Text; versement.Date = cbDate.Value; versement.carte = CarteDao.findByNumero(cbNumeroCarte.Text); versement.admin = administrateur; }
private void txtNumero_TextChanged(object sender, EventArgs e) { Carte cart = CarteDao.findByNumero(txtNumero.Text); if (cart != null) { txtPorteur.Text = cart.Porteur; txtSolde.Text = cart.Solde.ToString(); } }
private void dgCartes_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { for (int i = 0; i < dgCartes.RowCount; i++) { if ((bool)dgCartes.Rows[i].Selected) { AddCarteForm adf = new AddCarteForm(); Carte carte = CarteDao.findByNumero(dgCartes.Rows[i].Cells[0].Value.ToString()); adf.Model2Form(carte); adf.ShowDialog(); } } }
public void DataCartesload() { List <Carte> Buss = CarteDao.findAll(); int i = 0; dgCartes.Rows.Clear(); foreach (Carte carte in Buss) { dgCartes.Rows.Add(); dgCartes.Rows[i].Cells[0].Value = carte.Numero; dgCartes.Rows[i].Cells[1].Value = carte.Porteur; dgCartes.Rows[i].Cells[2].Value = carte.Solde; dgCartes.Rows[i].Cells[3].Value = carte.SoldeMin; dgCartes.Rows[i].Cells[4].Value = carte.Type; dgCartes.Rows[i].Cells[5].Value = carte.Code; dgCartes.Rows[i].Cells[6].Value = carte.DateCreation; dgCartes.Rows[i].Cells[7].Value = carte.DateExpiration; i++; } }
private void txtVal_TextChanged(object sender, EventArgs e) { List <Carte> Buss = CarteDao.findby(cbtab.Text, txtVal.Text); int i = 0; dgCartes.Rows.Clear(); foreach (Carte carte in Buss) { dgCartes.Rows.Add(); dgCartes.Rows[i].Cells[0].Value = carte.Numero; dgCartes.Rows[i].Cells[1].Value = carte.Porteur; dgCartes.Rows[i].Cells[2].Value = carte.Solde; dgCartes.Rows[i].Cells[3].Value = carte.SoldeMin; dgCartes.Rows[i].Cells[4].Value = carte.Type; dgCartes.Rows[i].Cells[5].Value = carte.Code; dgCartes.Rows[i].Cells[6].Value = carte.DateCreation; dgCartes.Rows[i].Cells[7].Value = carte.DateExpiration; i++; } }
private void btnChange_Click(object sender, EventArgs e) { if (DroitDao.findDroit(administrateur.Numero, "Carte", "Modifier")) { for (int i = 0; i < dgCartes.RowCount; i++) { if ((bool)dgCartes.Rows[i].Selected) { AddCarteForm adf = new AddCarteForm(); Carte carte = CarteDao.findByNumero(dgCartes.Rows[i].Cells[0].Value.ToString()); adf.Model2Form(carte); adf.ShowDialog(); } } } else { MessageBox.Show("Vous n\'avez pas ce droit"); } }
private void btnSave_Click(object sender, EventArgs e) { Form2Model(); CarteDao.Recharge(carte); Vider(); }