Beispiel #1
0
    public async ValueTask SetProperty(
        string path,
        FileHandle fileHandle,
        FileStats fileStats,
        string key,
        ReadOnlyMemory <byte> value,
        PropertyFeature feature)
    {
        using var transaction = new SqliteTransaction(_context, ITransaction.TransactionMode.Mutation);
        var eventBuilder = new FileChangeEventBuilder();

        if (path == "/")
        {
            // TODO
            throw new NotImplementedException();
        }

        var fileId = await IndexFile(transaction, path, fileHandle, fileStats, eventBuilder);

        await _databaseTable.InsertOrReplacePropertyAsync(transaction, fileId, key, value, feature);

        await transaction.CommitAsync();

        await EmitFileChangeEvents(eventBuilder.BuildFileEvents());
    }
Beispiel #2
0
        /// <summary>
        /// Domain behaviours - methods/operations
        /// </summary>

        #region Domain behaviours - methods/operations

        public Property Update(  // Note, rental status is NOT updated manually, but based on other services
            Property property,
            string propertyName,
            string propertyDesc,
            PropertyType propertyType,
            int propertyBuildYear,
            bool isActive,
            bool isShared,
            RentalStatus rentalStatus,
            bool isBasementSuite,
            DateTime updateDate,
            PropertyAddress propertyAddress,
            PropertyFacility propertyFacility,
            PropertyFeature propertyFeature
            )
        {
            property.PropertyName      = propertyName;
            property.PropertyDesc      = propertyDesc;
            property.Type              = propertyType;
            property.PropertyBuildYear = propertyBuildYear;
            property.IsActive          = isActive;
            property.IsShared          = isShared;
            property.IsBasementSuite   = isBasementSuite;
            property.Modified          = updateDate;
            property.Address           = propertyAddress;
            property.Facility          = propertyFacility;
            property.Feature           = propertyFeature;

            return(property);
        }
 public List <PropertyFeature> GetFeature(int typeId)
 {
     using (PropertyContext propertyContext = new PropertyContext())
     {
         PropertyFeature propertyFeatures = new PropertyFeature();
         return(propertyContext.PropertyFeatures.Where(id => id.PropertyTypeID == typeId).ToList());
     }
 }
Beispiel #4
0
        /// <summary>
        /// Constructor - for creating new instance with all required parameters (enforced)
        /// </summary>
        ///
        public CreatePropertyCommand(
            //int propertyId,
            string propertyName,
            string propertyDesc,
            PropertyType propertyType,
            //int? strataCouncilId,
            //int propertyAddressId,
            //int propertyFeatureId,
            //int propertyFacilityId,
            //int? propertyOwnerId,
            //int? propertyManagerId,
            //string propertyLogoImgUrl,
            //string propertyVideoUrl,
            int propertyBuildYear,
            //int propertyMgmntlStatusId,
            bool isActive,
            bool isShared,
            //int? furnishingId,
            RentalStatus rentalStatus,
            bool isBasementSuite,
            DateTime createdDate,
            DateTime updateDate,
            PropertyAddress propertyAddress,
            PropertyFacility propertyFacility,
            PropertyFeature propertyFeature//,

            //int propertyTypeId, //PropertyType propertyType,
            //int rentalStatusId
            )
        {
            //PropertyId = propertyId;
            PropertyName = propertyName;
            PropertyDesc = propertyDesc;
            Type         = propertyType;
            //StrataCouncilId = strataCouncilId;
            //PropertyAddressId = propertyAddressId;
            //PropertyFeatureId = propertyFeatureId;
            //PropertyFacilityId = propertyFacilityId;
            //PropertyOwnerId = propertyOwnerId;
            //PropertyManagerId = propertyManagerId;
            //PropertyLogoImgUrl = propertyLogoImgUrl;
            //PropertyVideoUrl = propertyVideoUrl;
            PropertyBuildYear = propertyBuildYear;
            //PropertyMgmntlStatusId = propertyMgmntlStatusId;
            IsActive = isActive;
            IsShared = isShared;
            //FurnishingId = furnishingId;
            Status           = rentalStatus;
            IsBasementSuite  = isBasementSuite;
            CreatedDate      = createdDate;
            UpdateDate       = updateDate;
            PropertyAddress  = propertyAddress;
            PropertyFacility = propertyFacility;
            PropertyFeature  = propertyFeature;

            //PropertyTypeId = propertyTypeId; //PropertyType = propertyType;
            //RentalStatusId = rentalStatusId;//RentalStatus = rentalStatus;
        }
Beispiel #5
0
        protected override void Prepare()
        {
            base.Prepare();
            base.Property.LandArea = Parameters.LandAreaLand;

            var list = DbContext.PropertyFeatures.Where(x => x.PropertyId == Parameters.PropertyId).ToList();

            if (list != null && list.Count > 0)
            {
                DbContext.PropertyFeatures.RemoveRange(list);
            }

            if (Parameters.CreditLand)
            {
                PropertyFeature f = new PropertyFeature();
                f.Feature = DbContext.Features.FirstOrDefault(x => x.FeatureTitle == "Credit");
                PropertyFeatures.Add(f);
            }
            if (Parameters.HasDocumentLand)
            {
                PropertyFeature f = new PropertyFeature();
                f.Feature = DbContext.Features.FirstOrDefault(x => x.FeatureTitle == "HasDocument");
                PropertyFeatures.Add(f);
            }

            if (Parameters.GasLand)
            {
                PropertyFeature f = new PropertyFeature();
                f.Feature = DbContext.Features.FirstOrDefault(x => x.FeatureTitle == "Gas");
                PropertyFeatures.Add(f);
            }
            if (Parameters.WaterLand)
            {
                PropertyFeature f = new PropertyFeature();
                f.Feature = DbContext.Features.FirstOrDefault(x => x.FeatureTitle == "Water");
                PropertyFeatures.Add(f);
            }
            if (Parameters.ElectricLand)
            {
                PropertyFeature f = new PropertyFeature();
                f.Feature = DbContext.Features.FirstOrDefault(x => x.FeatureTitle == "Electric");
                PropertyFeatures.Add(f);
            }
            if (Parameters.FenceLand)
            {
                PropertyFeature f = new PropertyFeature();
                f.Feature = DbContext.Features.FirstOrDefault(x => x.FeatureTitle == "Fence");
                PropertyFeatures.Add(f);
            }
            if (Parameters.GateLand)
            {
                PropertyFeature f = new PropertyFeature();
                f.Feature = DbContext.Features.FirstOrDefault(x => x.FeatureTitle == "Gate");
                PropertyFeatures.Add(f);
            }
        }
Beispiel #6
0
        public PropertyFeatureViewModel(PropertyFeature entity, Action <PropertyFeatureViewModel> act = null)
        {
            if (entity == null)
            {
                return;
            }

            Entity = entity;
            act?.Invoke(this);
        }
 public static async ValueTask AddOrUpdateObjectProperty <T>(
     this IPropertyOperations fs,
     FileHandle fileHandle,
     string name,
     T value,
     PropertyFeature feature = PropertyFeature.None)
     where T : class
 {
     var data = MessagePackSerializer.Serialize(value);
     await fs.SetProperty(fileHandle, name, data, feature);
 }
Beispiel #8
0
        private void AddFeaturesToProperty(Property property, int featureId)
        {
            var feature = this.DbContext.Features.FirstOrDefault(e => e.Id == featureId);
            var pf      = new PropertyFeature()
            {
                Feature  = feature,
                Property = property
            };

            this.DbContext.PropertiesFeatures.Add(pf);
            DbContext.SaveChanges();
        }
Beispiel #9
0
    public override async ValueTask SetProperty(
        FileHandle fileHandle,
        string name,
        ReadOnlyMemory <byte> value,
        PropertyFeature feature = PropertyFeature.None)
    {
        var localFileHandle = new LocalFileHandle(fileHandle);
        var stats           = StatRealPath(GetRealPath(localFileHandle.Path));

        if (!localFileHandle.IsSameFile(stats))
        {
            throw new FileNotFoundException(fileHandle);
        }

        await _hintFileTracker.SetProperty(localFileHandle.Path, fileHandle, stats, name, value, feature);
    }
Beispiel #10
0
    public async ValueTask SetProperty(
        FileHandle fileHandle,
        string name,
        ReadOnlyMemory <byte> value,
        PropertyFeature feature = PropertyFeature.None)
    {
        _logger.LogTrace("Set property {@key} {@length} to file {@fileHandle}.", name, value.Length, fileHandle);

        var(@namespace, rawFileHandle) = UnWarpFileHandle(fileHandle);

        if (!_fileSystems.TryGetValue(@namespace, out var fileSystem))
        {
            throw new FileNotFoundException(fileHandle);
        }

        await fileSystem.SetProperty(rawFileHandle, name, value);
    }
Beispiel #11
0
        /// <summary>
        /// Constructor - for creating new instance with all required parameters (enforced)
        /// </summary>
        ///
        public Property(
            string propertyName,
            string propertyDesc,
            PropertyType propertyType,
            string propertyManagerUserName,
            int propertyBuildYear,
            bool isActive,
            bool isShared,
            RentalStatus rentalStatus,
            bool isBasementSuite,
            DateTime createdDate,
            DateTime updateDate,

            //OwnerAddress ownerAddress,

            PropertyAddress propertyAddress,
            PropertyFacility propertyFacility,
            PropertyFeature propertyFeature

            )
        {
            PropertyName            = propertyName;
            PropertyDesc            = propertyDesc;
            Type                    = propertyType;
            PropertyManagerUserName = propertyManagerUserName;
            PropertyBuildYear       = propertyBuildYear;
            IsActive                = isActive;
            IsShared                = isShared;
            Status                  = rentalStatus;
            IsBasementSuite         = isBasementSuite;
            Created                 = createdDate;
            Modified                = updateDate;

            //OAddress = ownerAddress;
            Address  = propertyAddress;
            Facility = propertyFacility;
            Feature  = propertyFeature;
        }
Beispiel #12
0
        public async Task <CreatePropertyCommandResult> Handle(CreatePropertyCommand request, CancellationToken cancellationToken)
        {
            #region Create property aggregate root

            var createdProperty = new CreatePropertyCommandResult();

            var address = new PropertyAddress(request.PropertySuiteNumber,
                                              request.PropertyNumber, request.PropertyStreet,
                                              request.PropertyCity, request.PropertyStateProvince, request.PropertyZipPostCode,
                                              request.PropertyCountry);

            var feature = new PropertyFeature(request.NumberOfBathrooms,
                                              request.NumberOfBathrooms, request.NumberOfLayers,
                                              request.NumberOfParking, request.BasementAvailable,
                                              request.TotalLivingArea, request.IsShared, request.FeatureNotes);


            var facility = new PropertyFacility(request.Stove, request.Refrigerator, request.Dishwasher,
                                                request.AirConditioner, request.Laundry, request.BlindsCurtain, request.Furniture,
                                                request.Tvinternet, request.CommonFacility, request.SecuritySystem, request.UtilityIncluded,
                                                request.FireAlarmSystem, request.FacilityNotes, request.Others);



            var property = new Property(request.PropertyName, request.PropertyDesc, request.Type, request.PropertyManagerUserName,
                                        request.PropertyBuildYear, true, request.IsShared, request.Status,
                                        request.BasementAvailable, DateTime.Now, DateTime.Now, address, facility, feature);


            await _context.AddAsync(property);

            #endregion


            PropertyOwner owner = null;

            if (request.PropertyOwnerId == 0)
            {
                object ownerAddress = null;

                if (!request.IsSameAddress)
                {
                    ownerAddress = new OwnerAddress(request.OwnerStreetNumber, request.OwnerCity, request.OwnerStateProv,
                                                    request.OwnerCountry, request.OwnerZipPostCode);
                }
                else
                {
                    ownerAddress = new OwnerAddress(request.PropertySuiteNumber + " " + request.PropertyNumber + " " + request.PropertyStreet, request.PropertyCity, request.PropertyStateProvince,
                                                    request.PropertyCountry, request.PropertyZipPostCode);
                }

                owner = property.AddOwner("NotSet", request.FirstName, request.LastName, request.ContactEmail,
                                          request.ContactTelephone1, request.ContactTelephone2, request.OnlineAccessEnbaled, request.UserAvartaImgUrl,
                                          request.IsActive, request.RoleId, request.Notes, (OwnerAddress)ownerAddress);


                await _context.AddAsync(owner);
            }
            else
            {
                owner = _context.PropertyOwner.FirstOrDefault(o => o.Id == request.PropertyOwnerId);

                var ownerProperty = property.AddExsitingOwner(owner);

                owner.OwnerProperty.Add(ownerProperty);
            }

            try
            {
                await _context.SaveChangesAsync(); // comment out for testing message sending ONLY

                int PropertyId = property.Id;

                int NewOwnerId = owner.Id;

                request.PropertyId  = property.Id;
                request.CreatedDate = property.Created;
                request.UpdateDate  = property.Modified;

                //Populate return resultEnum.GetName(typeof())
                //
                createdProperty.Id                    = PropertyId;
                createdProperty.PropertyName          = request.PropertyName;
                createdProperty.Type                  = request.Type.ToString();
                createdProperty.Status                = request.Status.ToString();
                createdProperty.PropertyLogoImgUrl    = request.PropertyLogoImgUrl;
                createdProperty.IsShared              = request.IsShared;
                createdProperty.IsActive              = request.IsActive;
                createdProperty.IsBasementSuite       = request.IsBasementSuite;
                createdProperty.CreatedDate           = DateTime.Now.ToString("MMMM dd, yyyy");
                createdProperty.UpdateDate            = DateTime.Now.ToString("MMMM dd, yyyy");
                createdProperty.PropertySuiteNumber   = request.PropertySuiteNumber;
                createdProperty.PropertyStreet        = request.PropertyStreet;
                createdProperty.PropertyCity          = request.PropertyCity;
                createdProperty.PropertyStateProvince = request.PropertyStateProvince;
                createdProperty.PropertyZipPostCode   = request.PropertyZipPostCode;
                createdProperty.PropertyCountry       = request.PropertyCountry;


                Log.Information("Property with id {PropertyName} has been successfully created.", property.PropertyName);



                // Publish Domain Event (MediatR pattern)

                AssetCore.Events.PropertyCreatedEvent domainEvent = new AssetCore.Events.PropertyCreatedEvent(property);

                await _mediator.Publish(domainEvent);



                // Publish Integration Event (RabbitMQ)

                var streetNum = request.PropertySuiteNumber + " " + request.PropertyNumber + " " + request.PropertyStreet;

                //var streetNum = address.PropertySuiteNumber + " " + address.PropertyNumber + " " + address.PropertyStreet;
                // Send message to MQ
                //
                PropertyCreatedEvent e = new PropertyCreatedEvent(Guid.NewGuid(), request.PropertyId, request.PropertyName, request.PropertyManagerUserName,
                                                                  request.PropertyBuildYear, request.Type.ToString(), request.BasementAvailable, request.IsShared, request.NumberOfBedrooms,
                                                                  request.NumberOfBathrooms, request.NumberOfLayers, request.NumberOfParking, request.TotalLivingArea,
                                                                  streetNum, request.PropertyCity, request.PropertyStateProvince, request.PropertyCountry,
                                                                  request.PropertyZipPostCode, NewOwnerId, request.FirstName, request.LastName, request.ContactEmail, request.ContactTelephone1, request.ContactTelephone2,
                                                                  request.OwnerStreetNumber, request.OwnerCity, request.OwnerStateProv, request.OwnerZipPostCode, request.OwnerCountry);

                try
                {
                    await _messagePublisher.PublishMessageAsync(e.MessageType, e, "asset_created"); // publishing the message

                    Log.Information("Message  {MessageType} with Id {MessageId} has been published successfully", e.MessageType, e.MessageId);
                }
                catch (Exception ex)
                {
                    Log.Error(ex, "Error while publishing {MessageType} message with id {MessageId}.", e.MessageType, e.MessageId);
                }


                // Log message for reconciliation purpose         ******** This part can be replaced by Serilog ***************
                //
                var msgDetails = new MessageDetails();

                msgDetails.PrincicipalId     = e.PropertyId;
                msgDetails.PrincipalType     = "Property";
                msgDetails.PrincipalNameDesc = e.PropertyName;
                msgDetails.OperationType     = "Create";

                var details = msgDetails.ToBsonDocument();

                var msg = new Message(e.MessageId, "Asset Management", details, "asset_created", "asset_created.*", "Publish", DateTime.Now);

                await _loggingService.LogMessage(msg);
            }
            catch (Exception ex)
            {
                //throw ex;
                Log.Error(ex, "Error while creating property, {PropertyName} has not been created.", request.PropertyName);
            }

            return(createdProperty);
            //return new CreatePropertyCommandResult() { };
        }
Beispiel #13
0
 public abstract ValueTask SetProperty(
     FileHandle fileHandle,
     string name,
     ReadOnlyMemory <byte> value,
     PropertyFeature feature = PropertyFeature.None);
Beispiel #14
0
        public async Task <UpdatePropertyCommandResult> Handle(UpdatePropertyCommand request, CancellationToken cancellationToken)
        {
            var ppt = _context.Property.Include(op => op.OwnerProperty).ThenInclude(o => o.PropertyOwner).FirstOrDefault(p => p.Id == request.PropertyId);

//
            var address = new PropertyAddress(request.PropertySuiteNumber,
                                              request.PropertyNumber, request.PropertyStreet,
                                              request.PropertyCity, request.PropertyStateProvince, request.PropertyZipPostCode,
                                              request.PropertyCountry);

            var feature = new PropertyFeature(request.NumberOfBedrooms,
                                              request.NumberOfBathrooms, request.NumberOfLayers,
                                              request.NumberOfParking, request.BasementAvailable,
                                              request.TotalLivingArea, request.IsShared, request.FeatureNotes);


            var facility = new PropertyFacility(request.Stove, request.Refrigerator, request.Dishwasher,
                                                request.AirConditioner, request.Laundry, request.BlindsCurtain, request.Furniture,
                                                request.Tvinternet, request.CommonFacility, request.SecuritySystem, request.UtilityIncluded,
                                                request.FireAlarmSystem, request.Others, request.FacilityNotes);



            var updated = ppt.Update(ppt, request.PropertyName, request.PropertyDesc, request.PropertyType1, request.PropertyBuildYear,
                                     request.IsActive, request.IsShared, request.Status, request.BasementAvailable, DateTime.Now,
                                     address, facility, feature);

            _context.Property.Update(updated);

            var owners = ppt.OwnerProperty.Select(o => o.PropertyOwner).ToList();



            //var owners = _context.PropertyOwner
            //    .Include(op => op.OwnerProperty)
            //    .ThenInclude(p => p.FirstOrDefault().PropertyId == request.PropertyId).ToList();



            var contracts = _context.ManagementContract
                            //.Include(p => p.Property)
                            .Where(p => p.PropertyId == request.PropertyId).ToList();


            var updatedProperty = new UpdatePropertyCommandResult();

            // need to populate it either manual or automapper***************************
            updatedProperty.PropertyId        = request.PropertyId;
            updatedProperty.Id                = request.PropertyId;
            updatedProperty.AirConditioner    = request.AirConditioner;
            updatedProperty.BasementAvailable = request.BasementAvailable;
            updatedProperty.CommonFacility    = request.CommonFacility;
            updatedProperty.Dishwasher        = request.Dishwasher;
            updatedProperty.FacilityNotes     = request.FacilityNotes;
            updatedProperty.FireAlarmSystem   = request.FireAlarmSystem;
            //updatedProperty.FurnishingId = request.FurnishingId;
            updatedProperty.Furniture         = request.Furniture;
            updatedProperty.IsActive          = request.IsActive;
            updatedProperty.IsShared          = request.IsShared;
            updatedProperty.Laundry           = request.Laundry;
            updatedProperty.NumberOfBathrooms = request.NumberOfBathrooms;
            updatedProperty.NumberOfBedrooms  = request.NumberOfBedrooms;
            updatedProperty.NumberOfLayers    = request.NumberOfLayers;
            updatedProperty.NumberOfParking   = request.NumberOfParking;
            updatedProperty.Others            = request.Others;
            updatedProperty.PropertyBuildYear = request.PropertyBuildYear;
            updatedProperty.PropertyCity      = request.PropertyCity;
            updatedProperty.PropertyCountry   = request.PropertyCountry;
            updatedProperty.PropertyDesc      = request.PropertyDesc;
            //updatedProperty.PropertyLogoImgUrl = request.PropertyLogoImgUrl;
            //updatedProperty.PropertyManagerId = request.PropertyManagerId;
            updatedProperty.PropertyName          = request.PropertyName;
            updatedProperty.PropertyNumber        = request.PropertyNumber;
            updatedProperty.PropertyStateProvince = request.PropertyStateProvince;
            updatedProperty.PropertyStreet        = request.PropertyStreet;
            updatedProperty.PropertySuiteNumber   = request.PropertySuiteNumber;
            //updatedProperty.PropertyVideoUrl = request.PropertyVideoUrl;
            updatedProperty.PropertyZipPostCode = request.PropertyZipPostCode;
            updatedProperty.Refrigerator        = request.Refrigerator;
            updatedProperty.SecuritySystem      = request.SecuritySystem;
            updatedProperty.FeatureNotes        = request.FeatureNotes;

            updatedProperty.Status = request.Status.ToString(); //***************************************************************

            updatedProperty.Stove           = request.Stove;
            updatedProperty.TotalLivingArea = request.TotalLivingArea;
            updatedProperty.Tvinternet      = request.Tvinternet;

            updatedProperty.PropertyType1 = request.PropertyType1.ToString(); //***************************************************************
            updatedProperty.Type          = request.PropertyType1.ToString(); // new for client side rendering

            updatedProperty.UtilityIncluded = request.UtilityIncluded;
            updatedProperty.CreationDate    = ppt.Created.ToString("MMMM dd, yyyy");
            updatedProperty.CreatedDate     = ppt.Created.ToString("MMMM dd, yyyy"); //new for client side rendering

            updatedProperty.UpdateDate = updated.Modified.ToString("MMMM dd, yyyy");

            updatedProperty.OwnerList    = owners;
            updatedProperty.ContractList = contracts;

            try
            {
                await _context.SaveChangesAsync();

                // logging
                Log.Information("The property {PorpertyName} has been updated successfully", ppt.PropertyName);

                // Send messages if necessary

                PropertyUpdateEvent e = new PropertyUpdateEvent(Guid.NewGuid(), request.PropertyId, request.PropertyName,
                                                                request.PropertyBuildYear, request.PropertyType1.ToString(), request.BasementAvailable, request.IsShared, request.NumberOfBedrooms,
                                                                request.NumberOfBathrooms, request.NumberOfLayers, request.NumberOfParking, request.TotalLivingArea,
                                                                request.PropertyNumber + " " + request.PropertyStreet, request.PropertyCity, request.PropertyStateProvince, request.PropertyCountry,
                                                                request.PropertyZipPostCode);

                try
                {
                    await _messagePublisher.PublishMessageAsync(e.MessageType, e, "asset_created"); // publishing the message
                }
                catch (Exception ex)
                {
                    Log.Error(ex, "Error while publishing {MessageType} message with id {MessageId}.", e.MessageType, e.MessageId);
                }
            }
            catch (Exception ex)
            {
                //throw ex;
                Log.Error(ex, "Error occured while deleting the image for the property {PropertyName}.", ppt.PropertyName);
            }

            return(updatedProperty);  //.true;
        }
Beispiel #15
0
        public Tuple <Address, Property, PropertyDetail, PropertyFeature> Map(SetPropertyViewModel model, Seller seller)
        {
            var address = new Address
            {
                AddressLine1 = model.AddressLine1,
                AddressLine2 = model.AddressLine2,
                Town         = model.City,
                Province     = model.Suburb,
                PostalCode   = model.PostalCode,
                Country      = model.Country
            };

            var property = new Property
            {
                Title          = model.Title,
                Description    = model.Description,
                PropertyType   = model.PropertyType,
                OwnershipType  = model.OwnershipType,
                PropertyStatus = model.PropertyStatus,
                AddressId      = address.Id,
                SellerId       = seller.Id,
            };


            var details = new PropertyDetail
            {
                Bathrooms     = model.Bathrooms,
                Bedrooms      = model.Bedrooms,
                FloorSize     = model.FloorSize.GetDouble(),
                ErfSize       = model.ErfSize.GetDouble(),
                MonthlyLevies = model.MonthlyLevies.GetDouble(),
                RatesAndTaxes = model.RatesAndTaxes.GetDouble(),
                SpecialLevies = model.SpecialLevies.GetDouble(),
                PropertyId    = property.Id
            };

            var features = new PropertyFeature
            {
                AirConditioning  = model.AirConditioning,
                Balcony          = model.Balcony,
                Borehole         = model.Borehole,
                BuiltInBraai     = model.BuiltInBraai,
                BuiltInCupboards = model.BuiltInCupboards,
                Carpets          = model.Carpets,
                Carport          = model.Carport,
                DomesticBathroom = model.DomesticBathroom,
                DoubleGarage     = model.DoubleGarage,
                Clubhouse        = model.Clubhouse,
                FiberInternet    = model.FiberInternet,
                Garage           = model.Garage,
                Garden           = model.Garden,
                PetFriendly      = model.PetFriendly,
                SolarPower       = model.SolarPower,
                SwimmingPool     = model.SwimmingPool,
                TiledFloors      = model.TiledFloors,
                VisitorParking   = model.VisitorParking,
                PropertyId       = property.Id
            };

            return(new Tuple <Address, Property, PropertyDetail, PropertyFeature>(address, property, details, features));
        }
        protected override void Prepare()
        {
            base.Prepare();
            base.Property.ApartmentType = (int)Parameters.ApartmentType;

            base.Property.FloorNumber = Parameters.FloorNumberApartment;
            base.Property.TotalArea   = Parameters.TotalAreaApartment;
            base.Property.Bathroom    = Parameters.BathroomApartment;
            base.Property.FlatFloor   = Parameters.FlatFloorApartment;
            base.Property.RoomNumber  = Parameters.RoomNumberApartment;

            var list = DbContext.PropertyFeatures.Where(x => x.PropertyId == Parameters.PropertyId).ToList();

            if (list != null && list.Count > 0)
            {
                DbContext.PropertyFeatures.RemoveRange(list);
            }

            if (Parameters.CreditApartment)
            {
                PropertyFeature f = new PropertyFeature();
                f.Feature = DbContext.Features.FirstOrDefault(x => x.FeatureTitle == "Credit");
                PropertyFeatures.Add(f);
            }
            if (Parameters.HasDocumentApartment)
            {
                PropertyFeature f = new PropertyFeature();
                f.Feature = DbContext.Features.FirstOrDefault(x => x.FeatureTitle == "HasDocument");
                PropertyFeatures.Add(f);
            }
            if (Parameters.RepairingApartment)
            {
                PropertyFeature f = new PropertyFeature();
                f.Feature = DbContext.Features.FirstOrDefault(x => x.FeatureTitle == "Repairing");
                PropertyFeatures.Add(f);
            }
            if (Parameters.GasApartment)
            {
                PropertyFeature f = new PropertyFeature();
                f.Feature = DbContext.Features.FirstOrDefault(x => x.FeatureTitle == "Gas");
                PropertyFeatures.Add(f);
            }
            if (Parameters.WaterApartment)
            {
                PropertyFeature f = new PropertyFeature();
                f.Feature = DbContext.Features.FirstOrDefault(x => x.FeatureTitle == "Water");
                PropertyFeatures.Add(f);
            }
            if (Parameters.ElectricApartment)
            {
                PropertyFeature f = new PropertyFeature();
                f.Feature = DbContext.Features.FirstOrDefault(x => x.FeatureTitle == "Electric");
                PropertyFeatures.Add(f);
            }
            if (Parameters.TelephoneApartment)
            {
                PropertyFeature f = new PropertyFeature();
                f.Feature = DbContext.Features.FirstOrDefault(x => x.FeatureTitle == "Telephone");
                PropertyFeatures.Add(f);
            }
            if (Parameters.CabelTVApartment)
            {
                PropertyFeature f = new PropertyFeature();
                f.Feature = DbContext.Features.FirstOrDefault(x => x.FeatureTitle == "CabelTV");
                PropertyFeatures.Add(f);
            }
            if (Parameters.LiftApartment)
            {
                PropertyFeature f = new PropertyFeature();
                f.Feature = DbContext.Features.FirstOrDefault(x => x.FeatureTitle == "Lift");
                PropertyFeatures.Add(f);
            }

            if (Parameters.CentralHeatingSystemApartment)
            {
                PropertyFeature f = new PropertyFeature();
                f.Feature = DbContext.Features.FirstOrDefault(x => x.FeatureTitle == "CentralHeatingSystem");
                PropertyFeatures.Add(f);
            }


            if (Parameters.InternetApartment)
            {
                PropertyFeature f = new PropertyFeature();
                f.Feature = DbContext.Features.FirstOrDefault(x => x.FeatureTitle == "Internet");
                PropertyFeatures.Add(f);
            }

            if (Parameters.ConditionerApartment)
            {
                PropertyFeature f = new PropertyFeature();
                f.Feature = DbContext.Features.FirstOrDefault(x => x.FeatureTitle == "Conditioner");
                PropertyFeatures.Add(f);
            }

            if (Parameters.KitchenFurnitureApartment)
            {
                PropertyFeature f = new PropertyFeature();
                f.Feature = DbContext.Features.FirstOrDefault(x => x.FeatureTitle == "KitchenFurniture");
                PropertyFeatures.Add(f);
            }
            if (Parameters.HandyApartment)
            {
                PropertyFeature f = new PropertyFeature();
                f.Feature = DbContext.Features.FirstOrDefault(x => x.FeatureTitle == "Handy");
                PropertyFeatures.Add(f);
            }
            if (Parameters.CombySystemApartment)
            {
                PropertyFeature f = new PropertyFeature();
                f.Feature = DbContext.Features.FirstOrDefault(x => x.FeatureTitle == "CombySystem");
                PropertyFeatures.Add(f);
            }
        }
Beispiel #17
0
        protected override void Prepare()
        {
            base.Prepare();

            base.Property.FloorNumber = Parameters.FloorNumberHouse;
            base.Property.TotalArea   = Parameters.TotalAreaHouse;
            base.Property.Garage      = Parameters.GarageHouse;
            base.Property.Bathroom    = Parameters.BathroomHouse;
            base.Property.LandArea    = Parameters.LandAreaHouse;
            base.Property.RoomNumber  = Parameters.RoomNumberHouse;

            var list = DbContext.PropertyFeatures.Where(x => x.PropertyId == Parameters.PropertyId).ToList();

            if (list != null && list.Count > 0)
            {
                DbContext.PropertyFeatures.RemoveRange(list);
            }

            if (Parameters.CreditHouse)
            {
                PropertyFeature f = new PropertyFeature();
                f.Feature = DbContext.Features.FirstOrDefault(x => x.FeatureTitle == "Credit");
                PropertyFeatures.Add(f);
            }
            if (Parameters.HasDcoumentHouse)
            {
                PropertyFeature f = new PropertyFeature();
                f.Feature = DbContext.Features.FirstOrDefault(x => x.FeatureTitle == "HasDocument");
                PropertyFeatures.Add(f);
            }
            if (Parameters.RepairingHouse)
            {
                PropertyFeature f = new PropertyFeature();
                f.Feature = DbContext.Features.FirstOrDefault(x => x.FeatureTitle == "Repairing");
                PropertyFeatures.Add(f);
            }
            if (Parameters.GasHouse)
            {
                PropertyFeature f = new PropertyFeature();
                f.Feature = DbContext.Features.FirstOrDefault(x => x.FeatureTitle == "Gas");
                PropertyFeatures.Add(f);
            }
            if (Parameters.WaterHouse)
            {
                PropertyFeature f = new PropertyFeature();
                f.Feature = DbContext.Features.FirstOrDefault(x => x.FeatureTitle == "Water");
                PropertyFeatures.Add(f);
            }
            if (Parameters.ElectricHouse)
            {
                PropertyFeature f = new PropertyFeature();
                f.Feature = DbContext.Features.FirstOrDefault(x => x.FeatureTitle == "Electric");
                PropertyFeatures.Add(f);
            }
            if (Parameters.TelephoneHouse)
            {
                PropertyFeature f = new PropertyFeature();
                f.Feature = DbContext.Features.FirstOrDefault(x => x.FeatureTitle == "Telephone");
                PropertyFeatures.Add(f);
            }
            if (Parameters.CabelTVHouse)
            {
                PropertyFeature f = new PropertyFeature();
                f.Feature = DbContext.Features.FirstOrDefault(x => x.FeatureTitle == "CabelTV");
                PropertyFeatures.Add(f);
            }
            if (Parameters.InternetHouse)
            {
                PropertyFeature f = new PropertyFeature();
                f.Feature = DbContext.Features.FirstOrDefault(x => x.FeatureTitle == "Internet");
                PropertyFeatures.Add(f);
            }

            if (Parameters.ConditionerHouse)
            {
                PropertyFeature f = new PropertyFeature();
                f.Feature = DbContext.Features.FirstOrDefault(x => x.FeatureTitle == "Conditioner");
                PropertyFeatures.Add(f);
            }

            if (Parameters.KitchenFurnitureHouse)
            {
                PropertyFeature f = new PropertyFeature();
                f.Feature = DbContext.Features.FirstOrDefault(x => x.FeatureTitle == "KitchenFurniture");
                PropertyFeatures.Add(f);
            }
            if (Parameters.HandyHouse)
            {
                PropertyFeature f = new PropertyFeature();
                f.Feature = DbContext.Features.FirstOrDefault(x => x.FeatureTitle == "Handy");
                PropertyFeatures.Add(f);
            }
            if (Parameters.CombySystemHouse)
            {
                PropertyFeature f = new PropertyFeature();
                f.Feature = DbContext.Features.FirstOrDefault(x => x.FeatureTitle == "CombySystem");
                PropertyFeatures.Add(f);
            }
        }
Beispiel #18
0
        protected override void Prepare()
        {
            base.Prepare();
            base.Property.FloorNumber = Parameters.FloorNumberCommercial;
            base.Property.FlatFloor   = Parameters.FlatFloorCommercial;
            base.Property.TotalArea   = Parameters.TotalAreaCommercial;
            base.Property.RoomNumber  = Parameters.RoomNumberCommercial;

            var list = DbContext.PropertyFeatures.Where(x => x.PropertyId == Parameters.PropertyId).ToList();

            if (list != null && list.Count > 0)
            {
                DbContext.PropertyFeatures.RemoveRange(list);
            }

            if (Parameters.CreditCommercial)
            {
                PropertyFeature f = new PropertyFeature();
                f.Feature = DbContext.Features.FirstOrDefault(x => x.FeatureTitle == "Credit");
                PropertyFeatures.Add(f);
            }
            if (Parameters.HasDocumentCommercial)
            {
                PropertyFeature f = new PropertyFeature();
                f.Feature = DbContext.Features.FirstOrDefault(x => x.FeatureTitle == "HasDocument");
                PropertyFeatures.Add(f);
            }
            if (Parameters.RepairingCommercial)
            {
                PropertyFeature f = new PropertyFeature();
                f.Feature = DbContext.Features.FirstOrDefault(x => x.FeatureTitle == "Repairing");
                PropertyFeatures.Add(f);
            }
            if (Parameters.GasCommercial)
            {
                PropertyFeature f = new PropertyFeature();
                f.Feature = DbContext.Features.FirstOrDefault(x => x.FeatureTitle == "Gas");
                PropertyFeatures.Add(f);
            }
            if (Parameters.WaterCommercial)
            {
                PropertyFeature f = new PropertyFeature();
                f.Feature = DbContext.Features.FirstOrDefault(x => x.FeatureTitle == "Water");
                PropertyFeatures.Add(f);
            }
            if (Parameters.ElectricCommercial)
            {
                PropertyFeature f = new PropertyFeature();
                f.Feature = DbContext.Features.FirstOrDefault(x => x.FeatureTitle == "Electric");
                PropertyFeatures.Add(f);
            }
            if (Parameters.TelephoneCommercial)
            {
                PropertyFeature f = new PropertyFeature();
                f.Feature = DbContext.Features.FirstOrDefault(x => x.FeatureTitle == "Telephone");
                PropertyFeatures.Add(f);
            }
            if (Parameters.CabelTVCommercial)
            {
                PropertyFeature f = new PropertyFeature();
                f.Feature = DbContext.Features.FirstOrDefault(x => x.FeatureTitle == "CabelTV");
                PropertyFeatures.Add(f);
            }

            if (Parameters.CentralHeatingSystemCommercial)
            {
                PropertyFeature f = new PropertyFeature();
                f.Feature = DbContext.Features.FirstOrDefault(x => x.FeatureTitle == "CentralHeatingSystem");
                PropertyFeatures.Add(f);
            }


            if (Parameters.InternetCommercial)
            {
                PropertyFeature f = new PropertyFeature();
                f.Feature = DbContext.Features.FirstOrDefault(x => x.FeatureTitle == "Internet");
                PropertyFeatures.Add(f);
            }

            if (Parameters.ConditionerCommercial)
            {
                PropertyFeature f = new PropertyFeature();
                f.Feature = DbContext.Features.FirstOrDefault(x => x.FeatureTitle == "Conditioner");
                PropertyFeatures.Add(f);
            }


            if (Parameters.HandyCommercial)
            {
                PropertyFeature f = new PropertyFeature();
                f.Feature = DbContext.Features.FirstOrDefault(x => x.FeatureTitle == "Handy");
                PropertyFeatures.Add(f);
            }
            if (Parameters.CombySystemCommercial)
            {
                PropertyFeature f = new PropertyFeature();
                f.Feature = DbContext.Features.FirstOrDefault(x => x.FeatureTitle == "CombySystem");
                PropertyFeatures.Add(f);
            }
        }
 public void Update(PropertyFeature bus)
 {
     throw new NotImplementedException();
 }