コード例 #1
0
        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);
        }
コード例 #2
0
        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);
        }
コード例 #3
0
 private void SaveSelectedAthletes(SimpleFilterViewModel model)
 {
     if (model.selectedAthletes != null)
     {
         SelectedAthleteIds = Array.ConvertAll(model.selectedAthletes.Split(','), int.Parse);
     }
 }
コード例 #4
0
 private void SaveRaceFilterValues(SimpleFilterViewModel model)
 {
     SaveRaceFilterValues(model.Races, model.AgeGroups, model.Genders);
     SaveDurationValues(model);
     SaveSelectedAthletes(model);
     SaveSelectedSkillLevel(model);
     SaveDistance(model);
 }
コード例 #5
0
        public static SimpleFilterViewModel Create()
        {
            var simple = new SimpleFilterViewModel();

            return(simple);
        }
コード例 #6
0
 private void SaveSelectedSkillLevel(SimpleFilterViewModel model)
 {
     SkillLevel = model.skilllevel;
 }
コード例 #7
0
 private void SaveDistance(SimpleFilterViewModel model)
 {
     Distance = model.distance;
 }
コード例 #8
0
 public RaceFilterViewModel(SimpleFilterViewModel model, string sortOrder = null)
 {
     PopulateRaceFilter(model.distance, sortOrder);
     SaveRaceFilterValues(model);
 }