Exemple #1
0
        public BE.ListingViewModel GetListingByFacilityGuid(Guid facilityGuid)
        {
            DA.FacilityGateway facilityGateway = new DA.FacilityGateway();
            DA.Facility facility = facilityGateway.GetByPK(facilityGuid);

            // Validation of client.
            if (null == facility)
                return null;
            if (Guid.Empty == facility.CityStateZipGuid)
                return null;
            if (Guid.Empty == facility.ListingTypeGuid)
                return null;

            DA.CityStateZipGateway cityGateway = new DA.CityStateZipGateway();
            DA.CityStateZip cityStateZip = cityGateway.GetByPK(facility.CityStateZipGuid);

            // Validation of city state zip.
            if (null == cityStateZip)
                return null;

            DA.ListingTypeGateway listingGateway = new DA.ListingTypeGateway();
            DA.ListingType listingType = listingGateway.GetByPK(facility.ListingTypeGuid);

            // Validation of paymentInfo.
            if (null == listingType)
                return null;

            BE.ListingViewModel listing = EntityConversion.BuildListingViewModel(facility, cityStateZip, listingType);
            return listing;
        }
Exemple #2
0
        public BE.AccountViewModel GetByEmail(string email)
        {
            DA.ClientGateway clientGateway = new DA.ClientGateway();
            DA.Client client = clientGateway.GetByEmail(email);

            // Validation of client.
            if (null == client)
                return null;
            if (Guid.Empty == client.CityStateZipGuid)
                return null;
            if (Guid.Empty == client.PaymentInfoGuid)
                return null;

            DA.CityStateZipGateway cityGateway = new DA.CityStateZipGateway();
            DA.CityStateZip cityStateZip = cityGateway.GetByPK(client.CityStateZipGuid);

            // Validation of city state zip.
            if (null == cityStateZip)
                return null;

            DA.PaymentInfoGateway paymentGateway = new DA.PaymentInfoGateway();
            DA.PaymentInfo paymentInfo = paymentGateway.GetByPK(client.PaymentInfoGuid);

            // Validation of paymentInfo.
            if (null == paymentInfo)
                return null;

            BE.AccountViewModel account = EntityConversion.BuildAccountViewModel(client, cityStateZip, paymentInfo);
            return account;
        }
 public BE.CityStateZip GetCityStateZipByCityStateZipGuid(Guid cityStateZipGuid)
 {
     DA.CityStateZipGateway gateway = new DA.CityStateZipGateway();
     BE.CityStateZip result = new BE.CityStateZip();
     result = gateway.GetByPK(cityStateZipGuid).ToBusinessEntity();
     return result;
 }
Exemple #4
0
        public IQueryable<BE.AccountViewModel> GetAll()
        {
            DA.ClientGateway clientGateway = new DA.ClientGateway();
            List<DA.Client> clients = clientGateway.GetClientList();
            List<BE.AccountViewModel> accountList = new List<BE.AccountViewModel>();
            foreach (var client in clients)
            {
                //Validation of client.
                if (null == client)
                    return null;
                if (Guid.Empty == client.CityStateZipGuid)
                    return null;
                if (Guid.Empty == client.PaymentInfoGuid)
                    return null;

                DA.CityStateZipGateway cityGateway = new DA.CityStateZipGateway();
                DA.CityStateZip cityStateZip = cityGateway.GetByPK(client.CityStateZipGuid);

                // Validation of city state zip.
                if (null == cityStateZip)
                    return null;

                DA.PaymentInfoGateway paymentGateway = new DA.PaymentInfoGateway();
                DA.PaymentInfo paymentInfo = paymentGateway.GetByPK(client.PaymentInfoGuid);

                // Validation of paymentInfo.
                if (null == paymentInfo)
                    return null;

                //Full Account of Client
                BE.AccountViewModel account = EntityConversion.BuildAccountViewModel(client, cityStateZip, paymentInfo);
                accountList.Add(account);
            }

            return accountList.AsQueryable();
        }