public static SimpleFilterViewModel Create(FilterViewModel filterView) { var simple = new SimpleFilterViewModel(); simple.Races = filterView.selectedRaceIds.JoinIfNotNull(); simple.AgeGroups = filterView.selectedAgeGroupIds.JoinIfNotNull(); simple.Genders = filterView.selectedGenderIds.JoinIfNotNull(); simple.swimlowtimevalue = filterView.swimlowtimevalue; simple.swimhightimevalue = filterView.swimhightimevalue; simple.bikelowtimevalue = filterView.bikelowtimevalue; simple.bikehightimevalue = filterView.bikehightimevalue; simple.runlowtimevalue = filterView.runlowtimevalue; simple.runhightimevalue = filterView.runhightimevalue; simple.finishlowtimevalue = filterView.finishlowtimevalue; simple.finishhightimevalue = filterView.finishhightimevalue; simple.selectedAthletes = null; //no conversion; simple.skilllevel = null; //no conversion simple.distance = filterView.distance; return(simple); }
public static SimpleFilterViewModel Create(string queryString) { var simple = new SimpleFilterViewModel(); var parms = HttpUtility.ParseQueryString(queryString); simple.Races = parms["races"]; simple.AgeGroups = parms["agegroups"]; simple.Genders = parms["genders"]; simple.swimlowtimevalue = parms["swimlowtimevalue"]; simple.swimhightimevalue = parms["swimhightimevalue"]; simple.bikelowtimevalue = parms["bikelowtimevalue"]; simple.bikehightimevalue = parms["bikehightimevalue"]; simple.runlowtimevalue = parms["runlowtimevalue"]; simple.runhightimevalue = parms["runhightimevalue"]; simple.finishlowtimevalue = parms["finishlowtimevalue"]; simple.finishhightimevalue = parms["finishhightimevalue"]; simple.selectedAthletes = null; //no conversion; simple.skilllevel = null; //no conversion simple.distance = parms["distance"]; return(simple); }
private void SaveSelectedAthletes(SimpleFilterViewModel model) { if (model.selectedAthletes != null) { SelectedAthleteIds = Array.ConvertAll(model.selectedAthletes.Split(','), int.Parse); } }
private void SaveRaceFilterValues(SimpleFilterViewModel model) { SaveRaceFilterValues(model.Races, model.AgeGroups, model.Genders); SaveDurationValues(model); SaveSelectedAthletes(model); SaveSelectedSkillLevel(model); SaveDistance(model); }
public static SimpleFilterViewModel Create() { var simple = new SimpleFilterViewModel(); return(simple); }
private void SaveSelectedSkillLevel(SimpleFilterViewModel model) { SkillLevel = model.skilllevel; }
private void SaveDistance(SimpleFilterViewModel model) { Distance = model.distance; }
public RaceFilterViewModel(SimpleFilterViewModel model, string sortOrder = null) { PopulateRaceFilter(model.distance, sortOrder); SaveRaceFilterValues(model); }