1
public BusinessAccounting.ViewModel.Account.AccountViewModel AccountVM;    


public QBImportDataWizard()
{
    InitializeComponent();                
    dcBusinessAccountingContext.Load(dcBusinessAccountingContext.GetAccountsQuery());           
}

void oQB_RetrieveQBAccountsCompleted(object sender, QBAccountsServiceReference.RetrieveQBAccountsCompletedEventArgs e)
{
    foreach (BusinessAccounting.QBAccountsServiceReference.QBAccounts acc in QBAccountlist)
    {
        AccountVM.CurrentAccount.Active = acc.Active;
        AccountVM.CurrentAccount.Hierarchy =null;
        AccountVM.CurrentAccount.HierarchyLevel = acc.Sublevel;
        AccountVM.CurrentAccount.CashFlowID = 3;
        AccountVM.CurrentAccount.OpeningBalance = null;
        AccountVM.CurrentAccount.OpeningBalanceDate = DateTime.Now;
        AccountVM.CurrentAccount.Category1099ID = null;
        AccountVM.CurrentAccount.Remarks ="";
        AccountVM.CurrentAccount.BankID = 0;//Here i am getting error.
    }
}

下の行を削除QBImportDataWizard() dcBusinessAccountingContext.Load(dcBusinessAccountingContext.GetAccountsQuery());しても、エラーは発生しません。理由を教えてください。

4

0 に答える 0