public ListSearchResultViewModel FillEnhancedSearchResultModel(EnhancedSearchViewModel m) { var model = new ListSearchResultViewModel(); model.Agreements = GetEnhancedClients(m.Typ, m.Förbrukning, m.ElområdeId); model.Agreements.AddRange(GetScrapedEnhanced(m.Typ, m.Förbrukning, m.ElområdeId)); model.Förbrukning = m.Förbrukning; model.Typ = m.Typ; model.ElId = m.ElområdeId; model.Postnummer = m.Postnummer.ToString(); return(model); }
public ListSearchResultViewModel FillSpecifiedEnhancedSearchModel(EnhancedSearchViewModel m) { var model = FillEnhancedSearchResultModel(m); if (m.Source != null && m.Source != "no") { model.Agreements = HideNotMatchingSource(model.Agreements); } if (m.Property != null) { model.Agreements = HideNotMatchingProperty(model.Agreements, m.Property); } if (m.PaymentMethod != null) { model.Agreements = HideNotMatchingPayment(model.Agreements, m.PaymentMethod); } return(model); }
public ActionResult Lista(EnhancedSearchViewModel model) { if (ModelState.IsValid) { try { var searchmodel = _searchRepo.FillSpecifiedEnhancedSearchModel(model); return(View("Search", searchmodel)); } catch { var m = new ListSearchResultViewModel { Förbrukning = model.Förbrukning, Typ = model.Typ, Agreements = new List <SearchResultViewModel>() }; return(View(m)); } } return(View("Index", model)); }
public ActionResult Index() { var model = new EnhancedSearchViewModel(); return(View(model)); }