public AccountDialog(AccountViewModel account, AccountancyApplication accountancyApplication) { Users = accountancyApplication.Users; AccountInfo = account; InitializeComponent(); txtName.SelectAll(); }
public PersonViewModel(Person person, AccountancyApplication accountancyApplication) { m_underlyingData = person; Name = person.name; FullName = person.fullName; m_accountancyApplication = accountancyApplication; UserAccounts = new ObservableCollection<AccountViewModel>(m_accountancyApplication.EnumUserAccounts(this)); }
public ExpenseViewModel(Expense e, AccountancyApplication app) { Account = app.GetAccount(e.accountId); Amount = e.amount; Date = e.date; Category = app.GetCategory(e.categoryId); Description = e.description; m_underlyingData = e; }
public MainWindow() { InitializeComponent(); Application.Current.DispatcherUnhandledException += (e, a) => { if (a.Exception is SQLiteException) { SQLiteException ex = (SQLiteException)a.Exception; MessageBox.Show(this, ex.Message, "Error", MessageBoxButton.OK, MessageBoxImage.Exclamation); a.Handled = true; } }; DatabaseFileName = IOPath.GetFullPath("..\\..\\..\\..\\..\\Data\\FCHA_Master"); SQLiteConnection conn = new SQLiteConnection(string.Format("Data Source={0};Version=3;", DatabaseFileName)); conn.Open(); AccountancyApplication = new AccountancyApplication(new AccountancyDatabase(conn), new CbrClient()); }
internal void AdjustParent(AccountancyApplication app) { m_parent = app.GetCategory(m_underlyingData.categoryId); }
public AccountDialog(PersonViewModel selectedUser, AccountancyApplication accountancyApplication) : this(accountancyApplication.CreateAccount(selectedUser), accountancyApplication) { // todo: create account only user has confirmed - pressed OK. // If user presses cancel account still exists }
public ExpenseViewModel(long amount, CategoryViewModel category, AccountViewModel account, string description, AccountancyApplication app) : this(new Expense(0, account.AccountId, amount, category.CategoryId, app.SelectedDate, description), app) { }