Esempio n. 1
0
 public void Init(List <HousingContext.Property> properties)
 {
     BuiltProperty = new HousingContext.Property()
     {
         Id = properties.Count < 1 ? IdSeed : (from p in properties select p.Id).Max() + 1
     };
 }
Esempio n. 2
0
 public override void AddArea(HousingContext.Property property)
 {
     if (!RandomHelper.GenerateAOneInXChance(200))
     {
         return;
     }
     BuiltAddress.Area = Faker.Address.StreetName();
 }
Esempio n. 3
0
 public override void AddComposite(HousingContext.Property property)
 {
     BuiltAddress.Composite =
         !string.IsNullOrEmpty(BuiltAddress.Street) ? $"{BuiltAddress.StreetNumber} {BuiltAddress.Street}" : "";
     BuiltAddress.Composite +=
         !string.IsNullOrEmpty(BuiltAddress.Area) ? $"\n{BuiltAddress.Area}" : "";
     BuiltAddress.Composite +=
         !string.IsNullOrEmpty(BuiltAddress.City) ? $"\n{BuiltAddress.City}" : "";
     BuiltAddress.Composite +=
         !string.IsNullOrEmpty(BuiltAddress.County) ? $"\n{BuiltAddress.County}" : "";
     BuiltAddress.Composite +=
         !string.IsNullOrEmpty(BuiltAddress.PostCode) ? $"\n{BuiltAddress.PostCode}" : "";
 }
Esempio n. 4
0
 public HousingContext.Tenancy Build(
     ITenancyBuilder builder,
     List <HousingContext.Tenancy> tenancies,
     List <TenancyType> tenancyTypes,
     List <TenureType> tenureTypes,
     HousingContext.Property property)
 {
     builder.Init(tenancies);
     builder.SetName();
     builder.SetStartDate();
     builder.SetEndDate();
     builder.SetTenancyType(tenancyTypes);
     builder.SetTenureType(tenureTypes);
     builder.SetProperty(property);
     return(builder.Tenancy);
 }
Esempio n. 5
0
        public override void AddComposite(HousingContext.Property property)
        {
            var estateAddress = AssociatedAddressList.First(x => x.PropertyId == property.ParentId).AddressId;

            BuiltAddress.Composite  = $"{BuiltAddress.BuildingName}";
            BuiltAddress.Composite +=
                !string.IsNullOrEmpty(estateAddress.Street) ? $"\n{estateAddress.StreetNumber} {estateAddress.Street}" : "";
            BuiltAddress.Composite +=
                !string.IsNullOrEmpty(estateAddress.Area) ? $"\n{estateAddress.Area}" : "";
            BuiltAddress.Composite +=
                !string.IsNullOrEmpty(estateAddress.City) ? $"\n{estateAddress.City}" : "";
            BuiltAddress.Composite +=
                !string.IsNullOrEmpty(estateAddress.County) ? $"\n{estateAddress.County}" : "";
            BuiltAddress.Composite +=
                !string.IsNullOrEmpty(estateAddress.PostCode) ? $"\n{estateAddress.PostCode}" : "";
        }
Esempio n. 6
0
        public HousingContext.Address Build(
            IAddressBuilder builder, HousingContext.Property property, List <HousingContext.Address> addresses)
        {
            builder.Init(addresses);
            builder.AddBuildingName();
            builder.AddStreetNumber();
            builder.AddStreet(property);
            builder.AddFlatNumber();
            builder.AddArea(property);
            builder.AddCity(property);
            builder.AddPostCode(property);
            builder.AddCity(property);
            builder.AddComposite(property);

            return(builder.Address);
        }
Esempio n. 7
0
        public HousingContext.Property Build(
            IPropertyBuilder builder,
            List <HousingContext.Property> properties,
            List <PropertyType> propertyTypes,
            List <PropertySubType> propertySubTypes,
            List <LeaseType> leaseTypes,
            List <HousingContext.Address> addresses,
            List <AssociatedAddress> associatedAddresses,
            List <AddressType> addressTypes,
            HousingContext.Property parent)
        {
            builder.Init(properties);
            builder.SetParent(parent);
            builder.SetPropertyType(propertyTypes);
            builder.SetPropertySubType(propertySubTypes);
            builder.SetLeaseType(leaseTypes);
            builder.SetName();
            builder.SetPostalAddress(addresses, associatedAddresses, addressTypes);

            return(builder.Property);
        }
Esempio n. 8
0
 public override void AddArea(HousingContext.Property property)
 {
     BuiltAddress.Area = IsChance(Random.Next(1, 20), 20) ? Faker.Address.StreetName() : null;
 }
Esempio n. 9
0
 public override void AddCity(HousingContext.Property property)
 {
     BuiltAddress.City = Faker.Address.City();
 }
Esempio n. 10
0
 public abstract void AddComposite(HousingContext.Property property);
Esempio n. 11
0
 public override void AddStreet(HousingContext.Property property)
 {
     BuiltAddress.Street = Faker.Address.StreetName();
 }
Esempio n. 12
0
 public abstract void AddCity(HousingContext.Property property);
Esempio n. 13
0
 public abstract void AddPostCode(HousingContext.Property property);
Esempio n. 14
0
 public abstract void AddStreet(HousingContext.Property property);
Esempio n. 15
0
 public abstract void AddArea(HousingContext.Property property);
Esempio n. 16
0
 public override void AddPostCode(HousingContext.Property property)
 {
     BuiltAddress.PostCode = Faker.Address.UkPostCode();
 }
Esempio n. 17
0
 public void SetParent(HousingContext.Property property)
 {
     BuiltProperty.ParentId = property;
 }
Esempio n. 18
0
 public abstract void SetProperty(HousingContext.Property property);
Esempio n. 19
0
 public override void SetProperty(HousingContext.Property property)
 {
     BuiltTenancy.PropertyId = property;
 }
Esempio n. 20
0
 public override void AddComposite(HousingContext.Property property)
 {
     base.AddComposite(property);
     BuiltAddress.Composite = $"{BuiltAddress.FlatNumber} {BuiltAddress.Composite}";
 }
Esempio n. 21
0
        public override void AddStreet(HousingContext.Property property)
        {
            var estateAddress = AssociatedAddressList.First(x => x.PropertyId == property.ParentId).AddressId;

            BuiltAddress.Street = estateAddress.Street;
        }
Esempio n. 22
0
        public override void AddPostCode(HousingContext.Property property)
        {
            var estateAddress = AssociatedAddressList.First(x => x.PropertyId == property.ParentId).AddressId;

            BuiltAddress.PostCode = estateAddress.PostCode;
        }