Пример #1
0
        private void Supprimer(object sender, RoutedEventArgs e)
        {
            PlageViewModel p = (PlageViewModel)listePlages.SelectedItem;

            lp.Remove(p);
            PlageORM.supprimerPlage(p);
            listePlages.ItemsSource = lp;
        }
Пример #2
0
        public static PlageViewModel getPlage(int id)
        {
            DAOPlage         pDAO  = DAOPlage.getPlage(id);
            int              idCom = pDAO.idCommuneDAOPlage;
            CommuneViewModel c     = CommuneORM.getCommune(idCom);
            PlageViewModel   p     = new PlageViewModel(pDAO.idDAOPlage, pDAO.nomDAOPlage, c, pDAO.superficieDAOPlage);

            return(p);
        }
Пример #3
0
 public ComptageViewModel(int nbDeParticipants, EtudeViewModel etude, PlageViewModel plage, PersonneViewModel personne, NbEspecesViewModel nbEspeces, string coordonnees)
 {
     this.nbDeParticipants = nbDeParticipants;
     this.etude            = etude;
     this.plage            = plage;
     this.personne         = personne;
     this.nbEspeces        = nbEspeces;
     this.coordonnees      = coordonnees;
 }
 private void Ajouter_une_plage(object sender, RoutedEventArgs e)
 {
     try
     {
         CommuneViewModel commune = (CommuneViewModel)listeCommunes.SelectedItem;
         PlageViewModel   pl      = new PlageViewModel(nomTextBox.Text, commune, Int32.Parse(supTextBox.Text));
         PlageORM.ajouterPlage(pl);
         this.NavigationService.Navigate(new PageListPlages());
     }
     catch { }
 }
Пример #5
0
        public static ObservableCollection <PlageViewModel> listePlage()
        {
            ObservableCollection <DAOPlage>       lDAO = DAOPlage.listePlages();
            ObservableCollection <PlageViewModel> l    = new ObservableCollection <PlageViewModel>();

            foreach (DAOPlage element in lDAO)
            {
                int idCom = element.idCommuneDAOPlage;

                CommuneViewModel c = CommuneORM.getCommune(idCom); // Plus propre que d'aller chercher le métier dans la DAO.
                PlageViewModel   p = new PlageViewModel(element.idDAOPlage, element.nomDAOPlage, c, element.superficieDAOPlage);
                l.Add(p);
            }
            return(l);
        }
 public static void insertPlage(PlageViewModel p)
 {
     DALPlage.insertPlage(new DAOPlage(p.nomPlageProperty, p.Commune.idCommuneProperty, p.superficieProperty));
 }
 public static void deletePlage(EnsemblesViewModel ensembles, PlageViewModel plage)
 {
     DAOPlageEnsemble.supprimerPlageEnsemble(ensembles, plage);
 }
 public static void ajouterPlage(EnsemblesViewModel ensembles, PlageViewModel plage)
 {
     DAOPlageEnsemble.insertPlageEnsemble(ensembles, plage);
 }
Пример #9
0
 public void deletedPlageEtude(PlageViewModel plage, EtudeViewModel etude)
 {
     DALPlageEtude.deletedPlageEtude(new DAOPlageEtude(plage.idPlageProperty, etude.idEtudeProperty));
 }
Пример #10
0
 public static void supprimerPlage(PlageViewModel plage)
 {
     DAOPlage.supprimerPlage(plage.idPlageProperty);
 }
Пример #11
0
 public static void ajouterPlage(PlageViewModel plage)
 {
     DAOPlage.insertPlage(plage);
 }