// GET: Home public ActionResult Index() { var listing = new BLListing(); var featured = new FeaturedListingVM { FeaturedListings = listing.GetFeaturedListing() }; return(View(featured)); }
// 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)); }
// Create a new listing public static void AddListing(BLListing listing) { UpdateTransact( "AddListingBE", new[] { new SqlParameter("Price", listing.Price), new SqlParameter("Bedrooms", listing.Bedrooms), new SqlParameter( "ReferenceNumber", listing.Reference), new SqlParameter( "MarketingHeading", listing.MarketingHeading), new SqlParameter( "Description", listing.Description), new SqlParameter("Suburb", listing.Suburb), new SqlParameter("AgentGUID", listing.AgentGUID) }); }
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)); }