Exemplo n.º 1
0
        public PartialViewResult CreateNewStrategy(VariantNodeViewModel variant)
        {
            int newId = VariantModel.CreateVariant(variant);

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

            vm.CreatedVariantId = newId;
            return(PartialView("ViewStrategies", vm));
        }
Exemplo n.º 2
0
        public PartialViewResult CreateStrategies(int NodeId, string updateTargetId)
        {
            var vm = new VariantNodeViewModel()
            {
                ExperienceID = NodeId
            };

            ViewBag.UpdateTargetId = updateTargetId;
            return(PartialView(vm));
        }
Exemplo n.º 3
0
 public static int CreateVariant(VariantNodeViewModel model)
 {
     try
     {
         using (_certonaService = new CertonaServiceClient())
         {
             try
             {
                 UserDTO user    = FormsAuthenticationWrapper.User;
                 var     request = new CreateVariantRequest()
                 {
                     User           = user,
                     ExperienceID   = model.ExperienceID,
                     Name           = model.Name,
                     Description    = model.Description,
                     Priority       = model.Priority,
                     CatalogID      = model.CatalogID,
                     ContainerName  = model.ContainerTitle,
                     NumberOfAssets = model.NumberOfAssets,
                     MethodID       = model.MethodID
                 };
                 var response = _certonaService.CreateVariant(request);
                 return(response.VariantID);
             }
             catch (TimeoutException exception)
             {
                 _certonaService.Abort();
                 throw;
             }
             catch (CommunicationException exception)
             {
                 _certonaService.Abort();
                 throw;
             }
         }
     }
     catch (Exception ex)
     {
         throw;
     }
 }