Ejemplo n.º 1
0
 private void AddCarteForm_Load(object sender, EventArgs e)
 {
     if (carte.Id == 0)
     {
         txtNumero.Text = CarteDao.generateKey();
     }
 }
Ejemplo n.º 2
0
 private void btnSave_Click(object sender, EventArgs e)
 {
     Form2Model();
     CarteDao.save(carte);
     Vider();
     txtNumero.Text = CarteDao.generateKey();
 }
Ejemplo n.º 3
0
        public void Dataload1()
        {
            List <Carte> Buss = CarteDao.findAll();

            foreach (Carte carte in Buss)
            {
                cbNumeroCarte.Items.Add(carte.Numero);
            }
        }
Ejemplo n.º 4
0
 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;
 }
Ejemplo n.º 5
0
        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();
            }
        }
Ejemplo n.º 6
0
        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();
                }
            }
        }
Ejemplo n.º 7
0
        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++;
            }
        }
Ejemplo n.º 8
0
        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++;
            }
        }
Ejemplo n.º 9
0
        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");
            }
        }
Ejemplo n.º 10
0
 private void btnSave_Click(object sender, EventArgs e)
 {
     Form2Model();
     CarteDao.Recharge(carte);
     Vider();
 }