Example #1
0
 public static int CreateRule(int variantID, string ruleName)
 {
     try
     {
         using (_certonaService = new CertonaServiceClient())
         {
             try
             {
                 UserDTO user    = FormsAuthenticationWrapper.User;
                 var     request = new CreateRuleRequest()
                 {
                     User          = user,
                     ApplicationID = null,
                     Description   = string.Empty,
                     Enabled       = true,
                     Name          = ruleName,
                     VariantID     = variantID
                 };
                 var response = _certonaService.CreateRule(request);
                 return(response.RuleID);
             }
             catch (TimeoutException exception)
             {
                 _certonaService.Abort();
                 throw;
             }
             catch (CommunicationException exception)
             {
                 _certonaService.Abort();
                 throw;
             }
         }
     }
     catch (Exception ex)
     {
         throw;
     }
 }