Beispiel #1
0
        // bouton pour enregistrer le retour location et mise à jour des
        // données de la location et de la voiture (appel à la méthode Retourner_Loc
        private void Valider_Click(object sender, EventArgs e)
        {
            int    ind   = Dg_Loc.CurrentRow.Index;
            int    Num   = int.Parse(Dg_Loc[0, ind].Value.ToString());
            string Immat = Dg_Loc[1, ind].Value.ToString();
            int    Kr    = int.Parse(Dg_Loc[6, ind].Value.ToString());

            LocationADO.Retourner_Loc(Num, Immat, Kr);
            MessageBox.Show("Retour Validé");
        }
Beispiel #2
0
        // bouton de recherche de locations en cours par Immat voiture ou par ID client
        private void Rech_Cl_Click(object sender, EventArgs e)
        {
            List <Location> L;

            if (Txt_Voit.Text != "")
            {
                L = LocationADO.List_Loc_Vt(Txt_Voit.Text);
                Affiche(L);
            }
            else
            if (Txt_Cl.Text != "")
            {
                L = LocationADO.List_Loc_Cl(int.Parse(Txt_Cl.Text));
                Affiche(L);
            }
            else
            {
                MetroFramework.MetroMessageBox.Show(this, "Vous devez choisir un critère");
            }
        }
Beispiel #3
0
 // Enregistrement de la nouvelle location et modification disponibilité voiture
 private void Valider_Click_1(object sender, EventArgs e)
 {
     if (Txt_Nbj.Text == "")
     {
         MetroFramework.MetroMessageBox.Show(this, "Vous devez indiquer le nombre de jours");
     }
     else
     {
         Location L = new Location
         {
             Immat_V  = Txt_Voit.Text,
             Id_Cl    = int.Parse(Txt_Cl.Text),
             DDeb_Loc = DDéb_Loc.Value,
             DRet_Loc = DRet_Loc.Value,
             Kil_Dep  = int.Parse(Txt_Kil.Text),
             Nbj_Loc  = int.Parse(Txt_Nbj.Text)
         };
         LocationADO.Ajouter(L);
         VoitureADO.Modif_Disp(L.Immat_V);
         MessageBox.Show("Location enregistrée");
     }
 }
Beispiel #4
0
        private void FRetLoc_Load(object sender, EventArgs e)
        {
            List <Location> L = LocationADO.List_Loc();

            Affiche(L);
        }