Exemplo n.º 1
0
        public static CatalogDetails GetCatalogDetails(string catalogID)
        {
            CatalogDetails details = null;

            try
            {
                using (_certonaService = new CertonaServiceClient())
                {
                    try
                    {
                        UserDTO user = FormsAuthenticationWrapper.User;
                        var     catalogDetailsRequest = new GetCatalogDetailsRequest()
                        {
                            User = user, CatalogID = catalogID
                        };
                        var catalogDetailsResponse = _certonaService.GetCatalogDetails(catalogDetailsRequest);


                        if (catalogDetailsResponse.Success && catalogDetailsResponse.CatalogDetails != null)
                        {
                            details = new CatalogDetails()
                            {
                                CatalogId           = catalogID,
                                Name                = catalogDetailsResponse.CatalogDetails.Name,
                                Description         = catalogDetailsResponse.CatalogDetails.Description,
                                AssetType           = catalogDetailsResponse.CatalogDetails.AssetType,
                                Icon_FileName       = catalogDetailsResponse.CatalogDetails.Icon_FileName,
                                CatalogApplications = catalogDetailsResponse.CatalogDetails.Applications,
                                LanguageName        = catalogDetailsResponse.CatalogDetails.LanguageName
                            };
                        }
                    }
                    catch (TimeoutException exception)
                    {
                        _certonaService.Abort();
                        throw;
                    }
                    catch (CommunicationException exception)
                    {
                        _certonaService.Abort();
                        throw;
                    }
                }
            }
            catch (Exception ex)
            {
                throw;
            }

            return(details);
        }
Exemplo n.º 2
0
        public static HeaderViewModel GetCatalogHeader(string catalogID)
        {
            var vm = new HeaderViewModel();

            try
            {
                using (_certonaService = new CertonaServiceClient())
                {
                    try
                    {
                        UserDTO user = FormsAuthenticationWrapper.User;
                        var     catalogDetailsRequest = new GetCatalogDetailsRequest()
                        {
                            User = user, CatalogID = catalogID
                        };
                        var catalogDetailsResponse = _certonaService.GetCatalogDetails(catalogDetailsRequest);


                        if (catalogDetailsResponse.Success && catalogDetailsResponse.CatalogDetails != null)
                        {
                            vm.CatalogName = catalogDetailsResponse.CatalogDetails.Name;
                        }
                    }
                    catch (TimeoutException exception)
                    {
                        _certonaService.Abort();
                        throw;
                    }
                    catch (CommunicationException exception)
                    {
                        _certonaService.Abort();
                        throw;
                    }
                }
            }
            catch (Exception ex)
            {
                throw;
            }

            return(vm);
        }