Ejemplo n.º 1
0
        protected void FillAccountsList()
        {
            AggregationCategorizationService svc = Services.AggCatService.GetService(Cache, HttpContext.Current.User.Identity.Name);
            AccountList accounts = svc.GetCustomerAccounts();

            AccountsGridView.DataSource = accounts.AnyIntuitObjects;
            AccountsGridView.DataBind();
        }
Ejemplo n.º 2
0
        internal AccountModel GetCustomerAccounts()
        {
            AccountModel model = new AccountModel();

            //Demo purposes only.  The OAuth tokens returned by the SAML assertion are valid for 1 hour and do not need to be requested before each API call.
            SamlRequestValidator validator = new SamlRequestValidator(AggCatAppSettings.Certificate,
                                                                      AggCatAppSettings.ConsumerKey,
                                                                      AggCatAppSettings.ConsumerSecret,
                                                                      AggCatAppSettings.SamlIdentityProviderId,
                                                                      AggCatAppSettings.CustomerId);
            ServiceContext ctx = new ServiceContext(validator);
            AggregationCategorizationService svc = new AggregationCategorizationService(ctx);

            try
            {
                AccountList accountList = svc.GetCustomerAccounts();
                if (accountList != null && accountList.AnyIntuitObjects != null)
                {
                    model.Accounts = accountList.AnyIntuitObjects.ToList();
                }
                else
                {
                    accountList = null;
                }

                model.Error   = null;
                model.Success = true;
            }
            catch (AggregationCategorizationException ex)
            {
                model.Accounts = null;
                model.Error    = ex.ToString();
                model.Success  = false;
            }

            return(model);
        }
        internal AccountModel GetCustomerAccounts()
        {
            AccountModel model = new AccountModel();

            //Demo purposes only.  The OAuth tokens returned by the SAML assertion are valid for 1 hour and do not need to be requested before each API call.
            SamlRequestValidator validator = new SamlRequestValidator(AggCatAppSettings.Certificate,
                                                                           AggCatAppSettings.ConsumerKey,
                                                                           AggCatAppSettings.ConsumerSecret,
                                                                           AggCatAppSettings.SamlIdentityProviderId,
                                                                           AggCatAppSettings.CustomerId);
            ServiceContext ctx = new ServiceContext(validator);
            AggregationCategorizationService svc = new AggregationCategorizationService(ctx);
            try
            {
                AccountList accountList = svc.GetCustomerAccounts();
                if (accountList != null && accountList.AnyIntuitObjects != null)
                {
                    model.Accounts = accountList.AnyIntuitObjects.ToList();
                }
                else
                {
                    accountList = null;
                }

                model.Error = null;
                model.Success = true;
            }
            catch (AggregationCategorizationException ex)
            {
                model.Accounts = null;
                model.Error = ex.ToString();
                model.Success = false;
            }

            return model;
        }