示例#1
0
        private void btnNetIncome_Click(object sender, RoutedEventArgs e)
        {
            dpBalanceDate.Visibility = Visibility.Collapsed;
            gridFilters.Visibility = Visibility.Collapsed;
            tpTransactionPeriod.Visibility = Visibility.Visible;
            cbGroupBy.Visibility = Visibility.Visible;

            TreeList treeList = new TreeList();
            AccountNode incomes = Accounts.ProfitLossReport("/2/", tpTransactionPeriod.StartDate, tpTransactionPeriod.EndDate);
            AccountNode expenses = Accounts.ProfitLossReport("/3/", tpTransactionPeriod.StartDate, tpTransactionPeriod.EndDate);
            AccountNode netIncome = new AccountNode();
            netIncome.RootAccount = new AccountInfo(SqlHierarchyId.Parse("/4/"), "Net income", incomes.RootAccount.Balance + expenses.RootAccount.Balance);
            treeList.Tree.Items.Add(incomes);
            treeList.Tree.Items.Add(expenses);
            treeList.Tree.Items.Add(netIncome);
            bookkeeperPanel.Children.Clear();
            bookkeeperPanel.Children.Add(treeList);
            bookkeeperPanel.Tag = AccWindows.NetIncomeReport;

            BuildChart();
        }
示例#2
0
        private void ShowBalance()
        {
            if (dpBalanceDate.SelectedDate == null)
                dpBalanceDate.SelectedDate = DateTime.Now;

            TreeList treeList = new TreeList();
            AccountNode parent = Accounts.GetTree("/1/", dpBalanceDate.SelectedDate.Value);//my resources  //Accounts.GetTree(SqlHierarchyId.GetRoot().ToString())//all accounts
            treeList.Tree.Items.Add(parent);
            bookkeeperPanel.Children.Clear();
            bookkeeperPanel.Children.Add(treeList);
        }