Exemplo n.º 1
0
        private string ValidateRouteParams()
        {
            string errMsg = null;

            string selectedAgeGroupId = (ddlAge.SelectedItem as AgeGroup).AgeGroupID;

            if (!routeSetViewModel.AgeGroups.Where(x => x.AgeGroupID == selectedAgeGroupId).Any())
            {
                errMsg = "Age group selected is not valid!";
                return(errMsg);
            }

            string selectedDifficultyId = (ddlDifficulty.SelectedItem as RouteDifficulty).RouteDifficultyID;

            if (!routeSetViewModel.RouteDifficulties.Where(x => x.RouteDifficultyID == selectedDifficultyId).Any())
            {
                errMsg = "Difficulty selected is not valid!";
                return(errMsg);
            }

            if (!rocksOnRouteViewModel.AnyRocksInRoute())
            {
                errMsg = "Please add some rocks to the route!";
                return(errMsg);
            }

            return(errMsg);
        }
Exemplo n.º 2
0
        private void btnDemoDone_Click(object sender, RoutedEventArgs e)
        {
            SetTemplateOfControlFromResource(ctrlBtnDemo, BtnRecordDemoTemplateResourceKey);

            if (routeSetClimbMode == ClimbMode.Boulder)
            {
                if (rocksOnRouteViewModel.AnyRocksInRoute())
                {
                    BoulderRoute newBoulderRoute = CreateBoulderRouteFromUi();
                    rocksOnRouteViewModel.SaveRocksOnBoulderRoute(newBoulderRoute);
                }
            }
        }