Exemple #1
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;
     }
 }