public static ViaggioSearch getViaggioSearchParams(ViaggioSearchViewModel searchViewModelParams) { ViaggioSearch searchModelParams = null; if (searchViewModelParams != null) { searchModelParams = new ViaggioSearch() { SearchString = searchViewModelParams.SearchString, DataPartenzaMin = searchViewModelParams.DataPartenzaMin, DataPartenzaMax = searchViewModelParams.DataPartenzaMax, PrezzoMin = searchViewModelParams.PrezzoMin, PrezzoMax = searchViewModelParams.PrezzoMax, PassaDa = getGeoLocationModelFromViewModel(searchViewModelParams.PassaDa), ArrivaA = getGeoLocationModelFromViewModel(searchViewModelParams.ArrivaA), PassaDaTipoSearch = searchViewModelParams.PassaDaTipoSearch, ArrivaATipoSearch = searchViewModelParams.ArrivaATipoSearch, idAgenzia = searchViewModelParams.idAgenzia, searchApproved = searchViewModelParams.searchApproved, searchUnapproved = searchViewModelParams.searchUnapproved, searchMine = searchViewModelParams.searchMine, searchTheirs = searchViewModelParams.searchTheirs }; } return(searchModelParams); }
public ActionResult Search(ViaggioSearchViewModel searchParams) { var viaggiFound = new ViaggioRepository().Search(ViaggioHelper.getViaggioSearchParams(searchParams)); return(View(searchParams.ViewName, viaggiFound)); }