Exemple #1
0
        public static List <CatalogAttribute> GetCatalogMappingFields(int ruleID)
        {
            try
            {
                using (_certonaService = new CertonaServiceClient())
                {
                    try
                    {
                        List <CatalogAttribute> list = new List <CatalogAttribute>();
                        UserDTO user    = FormsAuthenticationWrapper.User;
                        var     request = new GetCatalogByRuleRequest()
                        {
                            User          = user,
                            ApplicationID = null,
                            RuleId        = ruleID
                        };
                        var response = _certonaService.GetCatalogByRule(request);

                        //if (response.Success && response.Details != null)
                        //{
                        //    foreach (var catalog in response.Details)
                        //    {
                        //        var catalogRequest = new GetCatalogMappingFieldsRequest()
                        //        {
                        //            User = user,
                        //            ApplicationID = null,
                        //            CatalogID = catalog.CatalogID
                        //        };


                        //        var catalogResponse = _certonaService.GetCatalogMappingFields(catalogRequest);

                        //        if (catalogResponse.Success)
                        //        {
                        //            list.Add(new CatalogAttribute()
                        //            {
                        //                CatalogMappingFields = catalogResponse.CatalogFields,
                        //                CatalogID = catalog.CatalogID,
                        //                CatalogName = catalog.CatalogName
                        //            });
                        //        }
                        //    }

                        //}

                        return(list);
                    }
                    catch (TimeoutException exception)
                    {
                        _certonaService.Abort();
                        throw;
                    }
                    catch (CommunicationException exception)
                    {
                        _certonaService.Abort();
                        throw;
                    }
                }
            }
            catch (Exception ex)
            {
                throw;
            }
        }