コード例 #1
0
        public ManageBudget(YearTop year)
        {
            _skipRefreshing = true;

            InitializeComponent();

            if (year == null)
            {
                throw new ArgumentException("Uninitialized year!");
            }

            _year                 = year;
            _dateSelected         = DateTime.Today;
            _showAnnual           = false;
            _allDatesTransactions = false;
            _selectedAccountName  = string.Empty;
            var accounts = _year.GetAccounts();

            if (accounts.Count <= 0)
            {
                throw new ArgumentException("Must instantiate at least one account.");
            }
            dateDtp.Value        = DateTime.Today;
            showAnnualCb.Checked = false;
            allDatesCb.Checked   = false;

            _year.FastForward(DateTime.Today);

            transactionsLv.MouseUp += new MouseEventHandler(purchasesLv_MouseUp);
            hardBillsLv.MouseUp    += new MouseEventHandler(hardBillsLv_MouseUp);
            softBillsLv.MouseUp    += new MouseEventHandler(softBillsLv_MouseUp);

            accountsLv.Items.Clear();
            foreach (var account in accounts)
            {
                ListViewItem lvi = new ListViewItem(account.Name);
                accountsLv.Items.Add(lvi);
            }
            accountsLv.Items[0].Checked = true;

            _skipRefreshing = false;
            RefreshPage();
        }
コード例 #2
0
        public void FastForwardYearTest()
        {
            yearTop.FastForward(new DateTime(2020, 12, 31));

            Console.WriteLine("Done");
        }