Esempio n. 1
0
        public static ObservableCollection <EnchereViewModel> listeEncheres()
        {
            ObservableCollection <EnchereDAO>       lDAO = EnchereDAO.listeEncheres();
            ObservableCollection <EnchereViewModel> l    = new ObservableCollection <EnchereViewModel>();

            foreach (EnchereDAO element in lDAO)
            {
                int idUtilisateur      = element.idUtilisateurEnchereDAO;
                UtilisateurViewModel u = UtilisateurORM.getUtilisateur(idUtilisateur);

                int idCommissairePriseur       = element.idCommissairePriseurEnchereDAO;
                CommissairePriseurViewModel cp = CommissairePriseurORM.getCommissairePriseur(idCommissairePriseur);

                int          idlotEnchere = element.idLotEnchereDAO;
                LotViewModel lo           = LotORM.getLot(idlotEnchere);

                int idOrdreAchatEnchere = element.idOrdreAchatEnchereDAO;
                OrdreAchatViewModel oa  = OrdreAchatORM.getOrdreAchat(idOrdreAchatEnchere);

                EnchereViewModel e = new EnchereViewModel(element.idEnchereDAO, element.prixEnchereDAO,
                                                          element.dateEnchereDAO, element.adjugeDAO, u, lo, cp, oa);
                l.Add(e);
            }

            return(l);
        }
Esempio n. 2
0
        public static LotViewModel getLot(int idLot)
        {
            LotDAO lDAO = LotDAO.getLot(idLot);

            LotViewModel p = new LotViewModel(lDAO.idLotDAO, lDAO.nomLotDAO, lDAO.descriptionLotDAO);

            return(p);
        }
Esempio n. 3
0
 public EnchereViewModel(int idEnchere, double prixEnchere, DateTime dateEnchere, int adjuge, UtilisateurViewModel idUtilisateurEnchere, LotViewModel idLotEnchere, CommissairePriseurViewModel idCommissairePriseurEnchere, OrdreAchatViewModel idOrdreAchatEnchere)
 {
     this.idEnchere                   = idEnchere;
     this.prixEnchere                 = prixEnchere;
     this.dateEnchere                 = dateEnchere;
     this.adjuge                      = adjuge;
     this.idUtilisateurEnchere        = idUtilisateurEnchere;
     this.idLotEnchere                = idLotEnchere;
     this.idCommissairePriseurEnchere = idCommissairePriseurEnchere;
     this.idOrdreAchatEnchere         = idOrdreAchatEnchere;
 }
Esempio n. 4
0
        public static ObservableCollection <LotViewModel> listeLots()
        {
            ObservableCollection <LotDAO>       lDAO = LotDAO.listeLots();
            ObservableCollection <LotViewModel> l    = new ObservableCollection <LotViewModel>();

            foreach (LotDAO element in lDAO)
            {
                LotViewModel p = new LotViewModel(element.idLotDAO, element.nomLotDAO, element.descriptionLotDAO);
                l.Add(p);
            }

            return(l);
        }
Esempio n. 5
0
 public ProduitViewModel(int idProduit, string nomProduit, string description, double prixReserve,
                         double prixDepart, int estVendu, int enstock, double prixVente, int nbInvendu,
                         UtilisateurViewModel utilisateurProduit, StockageViewModel stockageProduit, LotViewModel lotProduit)
 {
     this.idProduit          = idProduit;
     this.nomProduit         = nomProduit;
     this.descriptionProduit = description;
     this.prixReserve        = prixReserve;
     this.prixDepart         = prixDepart;
     this.estVendu           = estVendu;
     this.enStock            = enstock;
     this.prixVente          = prixVente;
     this.nbInvendu          = nbInvendu;
     this.utilisateurProduit = utilisateurProduit;
     this.stockageProduit    = stockageProduit;
     this.lotProduit         = lotProduit;
 }
Esempio n. 6
0
        public static ProduitViewModel getProduit(int idProduit)
        {
            ProduitDAO pDAO = ProduitDAO.getProduit(idProduit);

            int idUtilisateur      = pDAO.idUtilisateurProduitDAO;
            UtilisateurViewModel u = UtilisateurORM.getUtilisateur(idUtilisateur);

            int idStockage        = pDAO.idStockageProduitDAO;
            StockageViewModel sto = StockageORM.getStockage(idStockage);

            int          idLot = pDAO.idLotProduitDAO;
            LotViewModel l     = LotORM.getLot(idLot);

            ProduitViewModel p = new ProduitViewModel(pDAO.idProduitDAO, pDAO.nomProduitDAO, pDAO.descriptionProduitDAO,
                                                      pDAO.prixReserveDAO, pDAO.prixDepartDAO, pDAO.estVenduDAO, pDAO.enStockDAO,
                                                      pDAO.prixVenteDAO, pDAO.nbInvenduDAO, u, sto, l);

            return(p);
        }
Esempio n. 7
0
        public static EnchereViewModel getEnchere(int idEnchere)
        {
            EnchereDAO eDAO = EnchereDAO.getEnchere(idEnchere);

            int idUtilisateur      = eDAO.idUtilisateurEnchereDAO;
            UtilisateurViewModel u = UtilisateurORM.getUtilisateur(idUtilisateur);

            int idCommissairePriseur       = eDAO.idCommissairePriseurEnchereDAO;
            CommissairePriseurViewModel cp = CommissairePriseurORM.getCommissairePriseur(idCommissairePriseur);

            int          idlotEnchere = eDAO.idLotEnchereDAO;
            LotViewModel l            = LotORM.getLot(idlotEnchere);

            int idOrdreAchatEnchere = eDAO.idOrdreAchatEnchereDAO;
            OrdreAchatViewModel oa  = OrdreAchatORM.getOrdreAchat(idOrdreAchatEnchere);

            EnchereViewModel e = new EnchereViewModel(eDAO.idEnchereDAO, eDAO.prixEnchereDAO, eDAO.dateEnchereDAO,
                                                      eDAO.adjugeDAO, u, l, cp, oa);

            return(e);
        }
Esempio n. 8
0
        public static ObservableCollection <ProduitViewModel> listeProduits()
        {
            ObservableCollection <ProduitDAO>       lDAO = ProduitDAO.listeProduits();
            ObservableCollection <ProduitViewModel> l    = new ObservableCollection <ProduitViewModel>();

            foreach (ProduitDAO element in lDAO)
            {
                int idUtilisateur = element.idUtilisateurProduitDAO;
                int idStockage    = element.idStockageProduitDAO;
                int idLot         = element.idLotProduitDAO;

                UtilisateurViewModel u   = UtilisateurORM.getUtilisateur(idUtilisateur); // Plus propre que d'aller chercher le métier dans la DAO.
                StockageViewModel    sto = StockageORM.getStockage(idStockage);
                LotViewModel         lo  = LotORM.getLot(idLot);

                ProduitViewModel p = new ProduitViewModel(element.idProduitDAO, element.nomProduitDAO,
                                                          element.descriptionProduitDAO, element.prixReserveDAO, element.prixDepartDAO, element.estVenduDAO,
                                                          element.enStockDAO, element.prixVenteDAO, element.nbInvenduDAO, u, sto, lo);
                l.Add(p);
            }

            return(l);
        }
Esempio n. 9
0
 public static void insertLot(LotViewModel l)
 {
     LotDAO.insertLot(new LotDAO(l.idLotProperty, l.nomLotProperty, l.descriptionLotProperty));
 }