예제 #1
0
        public SearchMapViewModel(SearchMapViewModel model, int?propertyType = null,
                                  DateTime?from           = null, DateTime?to = null,
                                  int?rentalPricePeriodId = null,
                                  int?areaFrom            = null, int?areaTo     = null,
                                  int?priceFrom           = null, int?priceTo    = null,
                                  int?cityId        = null, int?distanceFromCity = null,
                                  List <int> extras = null)
        {
            this.PropertyType     = propertyType == -1 ? null : propertyType ?? model.PropertyType;
            this.AreaFrom         = areaFrom == -1 ? null : areaFrom ?? model.AreaFrom;
            this.AreaTo           = areaTo == -1 ? null : areaTo ?? model.AreaTo;
            this.PriceFrom        = priceFrom == -1 ? null : priceFrom ?? model.PriceFrom;
            this.PriceTo          = priceTo == -1 ? null : priceTo ?? model.PriceTo;
            this.CityId           = cityId == -1 ? null : cityId ?? model.CityId;
            this.DistanceFromCity = distanceFromCity == -1 ? null : distanceFromCity ?? model.DistanceFromCity;
            this.IsForRent        = model.IsForRent;
            this.From             = from ?? model.From;
            this.To = to ?? model.To;
            this.IsShortPeriodRent = IsShortPeriodRent ?? model.IsShortPeriodRent;

            this.Extras = extras ?? model.Extras;
        }
예제 #2
0
        public SearchAllViewModel(SearchMapViewModel model, string viewType = "ListProperties")
        {
            this.IsForRent         = model.IsForRent;
            this.To                = model.To;
            this.From              = model.From;
            this.IsShortPeriodRent = model.IsShortPeriodRent;
            this.PropertyType      = model.PropertyType;
            this.AreaFrom          = model.AreaFrom;
            this.AreaTo            = model.AreaTo;
            this.PriceFrom         = model.PriceFrom;
            this.PriceTo           = model.PriceTo;
            this.CityId            = model.CityId;
            this.DistanceFromCity  = model.DistanceFromCity;
            this.Extras            = model.Extras;

            this.PageCount = 1;
            this.PageSize  = 6;
            this.SortBy    = "PropertyName";
            this.OrderBy   = "Descending";

            this.ViewType = viewType;
        }