public List <Auction> GetAuctions(string title_like = "", double currentBid_lte = 0) { if (title_like != "" && currentBid_lte != 0) { return(dao.SearchByTitleAndPrice(title_like, currentBid_lte)); } else if (title_like != "") { return(dao.SearchByTitle(title_like)); } else if (currentBid_lte != 0) { return(dao.SearchByPrice(currentBid_lte)); } return(dao.List()); }
public List <Auction> ListAllAuctions(string title_like = "", double currentBid_lte = 0) { List <Auction> auctions = new List <Auction>(); if (title_like != "" && currentBid_lte != 0) { auctions = dao.SearchByTitleAndPrice(title_like, currentBid_lte); } else if (title_like != "") { auctions = dao.SearchByTitle(title_like); } else if (currentBid_lte != 0) { auctions = dao.SearchByPrice(currentBid_lte); } else { auctions = dao.List(); } return(auctions); }
public List<Auction> ListAuctions(string title_like = "", double currentBid_lte = 0) { List<Auction> auction = dao.SearchByTitle(title_like); List<Auction> matchPrices = dao.SearchByPrice(currentBid_lte); List<Auction> matches = dao.SearchByTitleAndPrice(title_like, currentBid_lte); if (title_like != null && currentBid_lte != 0) { return matches; } else if (title_like == null && currentBid_lte != 0) { return matchPrices; } else if (title_like != null && currentBid_lte == 0) { return auction; } else { return dao.List(); } }