Пример #1
0
        public PartialViewResult ManageDetails(int id, int cpsId)
        {
            var model = VariantModel.GetVariantDetails(id);

            ViewBag.cpsId = cpsId;
            return(PartialView(model));
        }
Пример #2
0
        public PartialViewResult ManageModifiers(int id, int cpsId)
        {
            var model = VariantModel.GetVariantBoosts(id);

            ViewBag.cpsId = cpsId;
            return(PartialView(model));
        }
Пример #3
0
        public PartialViewResult CreateNewStrategy(VariantNodeViewModel variant)
        {
            int newId = VariantModel.CreateVariant(variant);

            var vm = ExperienceModel.GetExperienceDetailsWithRules(variant.ExperienceID);

            vm.CreatedVariantId = newId;
            return(PartialView("ViewStrategies", vm));
        }
Пример #4
0
        public JsonResult UpdateVariantAction(string variantList, string actionStatus, string experienceID)
        {
            switch (actionStatus)
            {
            case "Move Up":
            case "Move Down":
                VariantModel.UpdateVariantListPriority(variantList, actionStatus);
                break;

            default:
                VariantModel.UpdateVariantStatus(variantList, actionStatus);
                break;
            }

            // pass list back so we can rebind grid
            var m = ExperienceModel.GetExperienceStrategies(int.Parse(experienceID));

            return(Json(new { strategies = m }, JsonRequestBehavior.AllowGet));
        }
Пример #5
0
        public MvcHtmlString GetPersonalizationTypeDdl(string catalogID)
        {
            var list = VariantModel.GetRecTypeList(catalogID);
            var ddl  = "<select name='MethodID' id='MethodID' style='width: 200px;' data-original-value=''>";

            if (list.Count == 0)
            {
                ddl += "<option value=''>No Personalization Types</option>";
            }
            else
            {
                foreach (var recType in list)
                {
                    ddl += string.Format("<option value='{0}'>{1}</option>", recType.MethodID.ToString(), recType.Name);
                }
            }

            ddl += "</select>";

            return(MvcHtmlString.Create(ddl));
        }
Пример #6
0
        public static ExperienceNodeViewModel GetExperienceDetailsWithRules(int experienceID)
        {
            var model = ExperienceModel.GetExperienceDetails(experienceID);
            List <ExperienceStrategy> strategyList = ExperienceModel.GetExperienceStrategies(experienceID);

            model.StrategyCount = strategyList.Count;

            // Additional model client side binding
            List <VariantRule> rulesList = new List <VariantRule>();
            List <ExperienceStrategyDecisionPlan> decisionPlanList = new List <ExperienceStrategyDecisionPlan>();
            List <int> sList = new List <int>();

            foreach (var strategy in strategyList)
            {
                rulesList.AddRange(VariantModel.GetVariantRulesForDetailGrid(strategy.StrategyID));

                var str = VariantModel.GetVariantSlotString(strategy.StrategyID);

                decisionPlanList.Add(new ExperienceStrategyDecisionPlan()
                {
                    StrategyID      = strategy.StrategyID,
                    NumberOfItems   = strategy.NumberOfItems,
                    MinItems        = strategy.MinItemsReturned,
                    BreakOnMinItems = strategy.BreakOnMinItemsReturned,
                    SlotInfo        = str
                });

                sList.Add(strategy.StrategyID);
            }
            sList.Sort();
            model.DecisionPlans  = decisionPlanList;
            model.VariantRules   = rulesList;
            model.StrategyIDList = sList;

            return(model);
        }
Пример #7
0
 public void ManageDetails(VariantDetails details)
 {
     // Save the variant Details
     VariantModel.UpdateVariantDetails(details);
 }
Пример #8
0
        public PartialViewResult Header(int id)
        {
            var model = VariantModel.GetVariantDetails(id);

            return(PartialView(model));
        }
Пример #9
0
        public PartialViewResult ViewRules(int id)
        {
            var model = VariantModel.GetVariantRules(id);

            return(PartialView(model));
        }
Пример #10
0
        public JsonResult UpdateVariantModifiers(string variantId, int pool, int profile, List <VariantBiases> biases, List <ViewModels.Variant.VariantModel> variants)
        {
            var model = VariantModel.UpdateVariantModifiers(variantId, pool, profile, biases, variants);

            return(Json(model));
        }
Пример #11
0
        public PartialViewResult ViewModifiers(int id)
        {
            var model = VariantModel.GetVariantBoosts(id);

            return(PartialView(model));
        }