예제 #1
0
        public ActionResult Index()
        {
            var conditionTypeParameters = GetParameters();

            var viewModel = new IsInPersonaViewModel
            {
                PersonaCodeName = conditionTypeParameters.PersonaName,
                AllPersonas     = GetAllPersonasViewModel(conditionTypeParameters.PersonaName)
            };

            return(PartialView("~/Components/Personalization/ConditionTypes/IsInPersona/_IsInPersonaConfiguration.cshtml", viewModel));
        }
예제 #2
0
        public ActionResult Validate(IsInPersonaViewModel viewModel)
        {
            if (!ModelState.IsValid)
            {
                viewModel.AllPersonas = GetAllPersonasViewModel();
                return(PartialView("~/Components/Personalization/ConditionTypes/IsInPersona/_IsInPersonaConfiguration.cshtml", viewModel));
            }

            var parameters = new IsInPersonaConditionType
            {
                PersonaName = viewModel.PersonaCodeName
            };

            return(new ConditionTypeValidationResult(parameters));
        }