示例#1
0
        // GET: Listing
        public ActionResult SearchListings()
        {
            var listing = new BLListing();

            var searchListings = new SearchListingVW {
                Suburbs =
                    new SelectList(listing.GetSuburbs()),
                Bedrooms =
                    new SelectList(listing.GetBedrooms()),
                PriceRanges =
                    new SelectList(listing.GetPriceRanges())
            };

            return(View(searchListings));
        }
示例#2
0
        public ActionResult GetListings(SearchListingVW searchVM)
        {
            var listingModel = new BLListing();

            var splitted =
                searchVM.PriceRange.Split('-');

            var minPrice =
                Convert.ToDecimal(splitted[0].Trim());
            var maxPrice =
                Convert.ToDecimal(splitted[1].Trim());

            var searchListings =
                listingModel.GetSearchListings(
                    searchVM.Suburb, searchVM.BedroomsNumber,
                    minPrice, maxPrice);

            ViewData["Suburb"] = searchVM.Suburb;
            return(View(searchListings));
        }