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());
下面的行,则表示没有任何错误。让我知道为什么?