Ejemplo n.º 1
0
 public static IAccountRet AddAccount(QBAccount account)
 {
     ENAccountType enAccountType = ENAccountType.atCostOfGoodsSold;
     switch(account.AccountType)
     {
         case QBAccountType.COGSAccount:
             enAccountType = ENAccountType.atCostOfGoodsSold;
             break;
         case QBAccountType.CurrentAssetsAccount:
             enAccountType = ENAccountType.atOtherCurrentAsset;
             break;
         case QBAccountType.IncomeAccount:
             enAccountType = ENAccountType.atIncome;
             break;
     }
     IAccountRet accountRet = QBFC_Core.QBAddAccount(account.AccountName, true, enAccountType,
                                                     account.AccountNumber);
     return accountRet;
 }
Ejemplo n.º 2
0
 protected override void LoadPage()
 {
     CanEdit = true;
     Setup();
     Account = new QBAccount();
     PageTitle = "Create Quick Books Account";
 }
 private void LoadTradeReceivableAccountsLists()
 {
     SimpleIoc.Default.GetInstance<QBMainWindowViewModel>().GlobalStatus =
         string.Format("Downloading {0}accounts from Quick Books ...", "");
     TradeReceivableAccountList.Clear();
     TradeReceivableAccountList.Add(DefaultAccount);
     SelectedTradeReceivableAccount = DefaultAccount;
     IAccountRetList accountRetList = QBIntegrationMethods.GetReceivableAccounts();
     if (accountRetList != null && accountRetList.Count != 0)
     {
         for (int i = 0; i <= accountRetList.Count - 1; i++)
         {
             SimpleIoc.Default.GetInstance<QBMainWindowViewModel>().GlobalStatus =
                 string.Format("Downloaded {0} account from Quick Books ...", i);
             IAccountRet accountRet = accountRetList.GetAt(i);
             ENAccountType accntType = accountRet.AccountType.GetValue();
             QBAccount account = new QBAccount
             {
                 AccountName = accountRet.Name.GetValue(),
                 AccountNumber = accountRet.AccountNumber.GetValue(),
                 QBAccountId = accountRet.ListID.GetValue(),
                 AccountType = QBAccountType.ReceivableAccount
             };
            
             TradeReceivableAccountList.Add(account);
         }
     }
     SimpleIoc.Default.GetInstance<QBMainWindowViewModel>().GlobalStatus =
         string.Format("Ready.");
 }