示例#1
0
        public static Paiement GetPaiementById(string id, bool initializer = true)
        {
            var pdao = PaiementDAL.SelectPaiementById(id);
            var utilisateurPaiement = new Utilisateur();
            var lotPaiement         = new Lot();


            if (initializer)
            {
                lotPaiement         = LotORM.GetLotById(LotDAL.SelectLotById(pdao.LotId).IdLot, false);
                utilisateurPaiement =
                    UtilisateurORM.GetUtilisateurById(
                        UtilisateurDAL.SelectUtilisateurById(pdao.UtilisateurId).IdUtilisateur, false);
            }


            var paiement = new Paiement(pdao.IdPaiement, utilisateurPaiement, pdao.TypePaiement,
                                        pdao.ValidationPaiement, lotPaiement);

            if (initializer)
            {
                _paiementsDictionary[paiement.IdPaiement] = paiement;
                LotORM.Populate(paiement.LotPaiement);
                UtilisateurORM.Populate(new List <Utilisateur>(new[]
                {
                    paiement.UtilisateurPaiement
                }));
            }

            return(paiement);
        }
示例#2
0
        public static Lot GetLotById(string id, bool initializer = true)
        {
            var lot = new Lot();

            var ldao     = LotDAL.SelectLotById(id);
            var lproduit = new List <Produit>();

            if (initializer)
            {
                var produits = ProduitORM.GetAllProduit();
                foreach (var produit in produits)
                {
                    if (produit.LotProduit.IdLot == id)
                    {
                        lproduit.Add(produit);
                    }
                }
            }

            lot = new Lot(id, ldao.NomLot, ldao.Description, lproduit);

            if (initializer)
            {
                _lotsDictionary[lot.IdLot] = lot;
                ProduitORM.Populate(lproduit);
            }

            return(lot);
        }
示例#3
0
        public static Vente GetVenteById(string id, bool initializer = true)
        {
            var vdao         = VenteDAL.SelectVenteById(id);
            var lotVente     = new Lot();
            var adresseVente = new Adresse();

            if (initializer)
            {
                lotVente     = LotORM.GetLotById(LotDAL.SelectLotById(vdao.LotId).IdLot, false);
                adresseVente = AdresseORM.GetAdresseById(AdresseDAL.SelectAdresseById(vdao.AdresseId).IdAdresse, false);
            }


            var vente = new Vente(vdao.IdVente, vdao.DateDebut, adresseVente, lotVente);

            if (initializer)
            {
                _ventesDictionary[vente.IdVente] = vente;
                LotORM.Populate(vente.LotVente);
                AdresseORM.Populate(new List <Adresse>(new[] { vente.AdresseVente }));
            }

            return(vente);
        }