Ejemplo n.º 1
0
        internal AccountModel GetCustomerAccountTransactions(AccountModel accountModel)
        {
            try
            {
                //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);
                accountModel.Transactions = svc.GetAccountTransactions(accountModel.AccountId, new DateTime(2011, 01, 01)).AnyIntuitObjects.ToList();
                accountModel.Success      = true;
                accountModel.Error        = null;
            }
            catch (AggregationCategorizationException ex)
            {
                accountModel.Transactions = null;
                accountModel.Success      = false;
                accountModel.Error        = ex.ToString();
            }

            return(accountModel);
        }
Ejemplo n.º 2
0
 protected void ShowTransactions(String startDate, String endDate)
 {
     try
     {
         AggregationCategorizationService svc = Services.AggCatService.GetService(Cache, HttpContext.Current.User.Identity.Name);
         TransactionList transactionList      = svc.GetAccountTransactions(long.Parse(Request.QueryString["Account"]),
                                                                           Convert.ToDateTime(startDate), Convert.ToDateTime(endDate));
         AccountsGridView.DataSource = transactionList.AnyIntuitObjects;
         AccountsGridView.DataBind();
     }
     catch (Exception ex)
     {
         Master.ErrorMessage = "Error occurred while calling GetAccountTransactions: " + ex.Message;
     }
 }
        internal AccountModel GetCustomerAccountTransactions(AccountModel accountModel)
        {
            try
            {
                //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);
                accountModel.Transactions = svc.GetAccountTransactions(accountModel.AccountId, new DateTime(2011, 01, 01)).AnyIntuitObjects.ToList();
                accountModel.Success = true;
                accountModel.Error = null;
            }
            catch (AggregationCategorizationException ex)
            {
                accountModel.Transactions = null;
                accountModel.Success = false;
                accountModel.Error = ex.ToString();
            }

            return accountModel;
        }