Exemplo n.º 1
0
 public AccountDialog(AccountViewModel account, AccountancyApplication accountancyApplication)
 {
     Users = accountancyApplication.Users;
     AccountInfo = account;
     InitializeComponent();
     txtName.SelectAll();
 }
Exemplo n.º 2
0
 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));
 }
Exemplo n.º 3
0
        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;
        }
Exemplo n.º 4
0
        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());
        }
Exemplo n.º 5
0
 internal void AdjustParent(AccountancyApplication app)
 {
     m_parent = app.GetCategory(m_underlyingData.categoryId);
 }
Exemplo n.º 6
0
 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
 }
Exemplo n.º 7
0
 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)
 {
 }