Beispiel #1
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);
            }
        }
        public static List <PropertyFeatures> GetFeaturesFromListItems
            (List <SelectListItem> featuresList)
        {
            var featuresModelList = new List <PropertyFeatures>();

            foreach (var item in featuresList)
            {
                if (item.Selected)
                {
                    var heating = new PropertyFeatures
                    {
                        ID          = Convert.ToInt32(item.Value),
                        FeatureName = item.Text
                    };
                    featuresModelList.Add(heating);
                }
            }

            return(featuresModelList);
        }
Beispiel #3
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);
            }
        }
        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 #5
0
        /// <summary>
        ///  Get property price valuation with confidence estimation
        /// </summary>
        /// <exception cref="ApiException">Thrown when fails to make API call</exception>
        /// <param name="propertyFeatures">Property features to valuate</param>
        /// <returns>Task of ApiResponse (Valuation)</returns>
        public async System.Threading.Tasks.Task <ApiResponse <Valuation> > GetValuationAsyncWithHttpInfo(PropertyFeatures propertyFeatures)
        {
            // verify the required parameter 'propertyFeatures' is set
            if (propertyFeatures == null)
            {
                throw new ApiException(400, "Missing required parameter 'propertyFeatures' when calling DefaultApi->GetValuation");
            }

            var    localVarPath         = "/properties/getValuation";
            var    localVarPathParams   = new Dictionary <String, String>();
            var    localVarQueryParams  = new List <KeyValuePair <String, String> >();
            var    localVarHeaderParams = new Dictionary <String, String>(this.Configuration.DefaultHeader);
            var    localVarFormParams   = new Dictionary <String, String>();
            var    localVarFileParams   = new Dictionary <String, FileParameter>();
            Object localVarPostBody     = null;

            // to determine the Content-Type header
            String[] localVarHttpContentTypes = new String[] {
                "application/json"
            };
            String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);

            // to determine the Accept header
            String[] localVarHttpHeaderAccepts = new String[] {
                "application/problem+json"
            };
            String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);

            if (localVarHttpHeaderAccept != null)
            {
                localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);
            }

            if (propertyFeatures != null && propertyFeatures.GetType() != typeof(byte[]))
            {
                localVarPostBody = this.Configuration.ApiClient.Serialize(propertyFeatures); // http body (model) parameter
            }
            else
            {
                localVarPostBody = propertyFeatures; // byte array
            }

            // authentication (ApiKeyAuth) required
            if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("X-API-KEY")))
            {
                localVarHeaderParams["X-API-KEY"] = this.Configuration.GetApiKeyWithPrefix("X-API-KEY");
            }

            // make the HTTP request
            IRestResponse localVarResponse = (IRestResponse)await this.Configuration.ApiClient.CallApiAsync(localVarPath,
                                                                                                            Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
                                                                                                            localVarPathParams, localVarHttpContentType);

            int localVarStatusCode = (int)localVarResponse.StatusCode;

            if (ExceptionFactory != null)
            {
                Exception exception = this.ExceptionFactory("GetValuation", localVarResponse);
                if (exception != null)
                {
                    throw exception;
                }
            }

            return(new ApiResponse <Valuation>(localVarStatusCode,
                                               localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)),
                                               (Valuation)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(Valuation))));
        }
Beispiel #6
0
        /// <summary>
        ///  Get property price valuation with confidence estimation
        /// </summary>
        /// <exception cref="ApiException">Thrown when fails to make API call</exception>
        /// <param name="propertyFeatures">Property features to valuate</param>
        /// <returns>Task of Valuation</returns>
        public async System.Threading.Tasks.Task <Valuation> GetValuationAsync(PropertyFeatures propertyFeatures)
        {
            ApiResponse <Valuation> localVarResponse = await GetValuationAsyncWithHttpInfo(propertyFeatures);

            return(localVarResponse.Data);
        }
Beispiel #7
0
        /// <summary>
        ///  Get property price valuation with confidence estimation
        /// </summary>
        /// <exception cref="ApiException">Thrown when fails to make API call</exception>
        /// <param name="propertyFeatures">Property features to valuate</param>
        /// <returns>Valuation</returns>
        public Valuation GetValuation(PropertyFeatures propertyFeatures)
        {
            ApiResponse <Valuation> localVarResponse = GetValuationWithHttpInfo(propertyFeatures);

            return(localVarResponse.Data);
        }
Beispiel #8
0
        /// <summary>
        ///  Get only property price valuation without confidence estimation
        /// </summary>
        /// <exception cref="ApiException">Thrown when fails to make API call</exception>
        /// <param name="propertyFeatures">Property features that describe property</param>
        /// <returns>int?</returns>
        public int?GetFastValuation(PropertyFeatures propertyFeatures)
        {
            ApiResponse <int?> localVarResponse = GetFastValuationWithHttpInfo(propertyFeatures);

            return(localVarResponse.Data);
        }
Beispiel #9
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);
            }
        }