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());
那么它不会给出任何错误。让我知道为什么?