private void ProcessImportABNModelView(string fileName, OptionViewModel options) { if (ImportFile(fileName)) { try { using (BankingDbContext db = new BankingDbContext(options.DbConnection)) { foreach (Import record in Cache) { db.Imports.Add(record); db.SaveChanges(); } } Log.Write($"{Cache.Count} records are imported from ABN file"); MessageBox.Show($"{Cache.Count} records are imported.", "Import ABN", MessageBoxButton.OK, MessageBoxImage.Information); } catch (Exception ex) { Log.Write($"Import ABN file has failed after record {Cache.Count}", ex.Message, ex.InnerException.ToString()); throw new ImportException("Import ABN file has failed"); } } }
public ImportINGViewModel(string fileName, OptionViewModel options) { if (ImportFile(fileName)) { try { using (BankingDbContext db = new BankingDbContext(options.DbConnection)) { foreach (Import record in Cache) { db.Imports.Add(record); db.SaveChanges(); } } Log.Write($"{Cache.Count} records are imported from ING file"); MessageBox.Show($"{Cache.Count} records are imported.", "Import ING", MessageBoxButton.OK, MessageBoxImage.Information); } catch { Log.Write("Failed importing ING file"); throw new ImportException("Import ING file has failed"); } } }
public OVCardViewModel(OptionViewModel options, OVCardList listView) { Options = options; ListView = listView; OpenCards(); }
public ImportProcessViewModel(OptionViewModel options, MainViewModel mainVM) { Options = options; MainVM = mainVM; ProcessImportToBankAsync(); ProcessMissedTallies(); ProcessPostImportAsync(); }
public ImportViewModel(OptionViewModel options, MainWindow parent) { Options = options; OpenImportTable(); View = new ImportWindow(this) { Top = parent.Top + 20, Left = parent.Left + 20 }; View.ShowDialog(); }
public BankViewModel(OptionViewModel options, OverviewWindow parent, MainViewModel mainVM, string tallyName, string month) { Options = options; MainVM = mainVM; OpenBankTable(tallyName, month); View = new BankWindow(this) { Top = parent.Top + 20, Left = parent.Left + 20 }; bool?Result = View.ShowDialog(); if ((bool)Result) { Db.Dispose(); } }
public BankViewModel(OptionViewModel options, MainWindow parent, MainViewModel mainVM, bool hasMissedTallies = false) { Options = options; MainVM = mainVM; HasMissedTallies = hasMissedTallies; OpenBankTable(); View = new BankWindow(this) { Top = parent.Top + 20, Left = parent.Left + 20 }; bool?Result = View.ShowDialog(); if ((bool)Result) { Db.Dispose(); } }
public ImportABNViewModel(string fileName, OptionViewModel options) { Log.Write("Starting ABN import"); ProcessImportABNModelView(fileName, options); }