コード例 #1
0
        private void SelectComboBox_SelectedIndexChanged(object sender, EventArgs e)
        {
            BillsProcessor processor = new BillsProcessor();

            billsForLabel = processor.GetBillsForLabel(SelectComboBox.Text);

            currentlyShownBill = billsForLabel[0];
            currentlySelectedIndexWithinLabel = 0;

            PopulateControlsForBill(currentlyShownBill);
        }
コード例 #2
0
        private void DoPaymentButton_Click(object sender, EventArgs e)
        {
            BillsProcessor processor = new BillsProcessor();

            if (processor.MarkBillAsPaid(currentlyShownBill.Id))
            {
                MakePaidLabelGreen();
                processor.CreateNextBillInstance(currentlyShownBill.Label);
                PopulateLabelsDropDown(); //Refresh list of bills for the label
            }
        }
コード例 #3
0
        private void PopulateLabelsDropDown()
        {
            BillsProcessor processor = new BillsProcessor();

            SelectComboBox.BeginUpdate();
            SelectComboBox.Items.Clear();
            SelectComboBox.Items.AddRange(processor.GetBillsLabels(true));
            SelectComboBox.EndUpdate();
            if (SelectComboBox.Items != null && SelectComboBox.Items.Count > 0)
            {
                SelectComboBox.SelectedIndex = 0;
            }
        }
コード例 #4
0
        private void PopulateControlsForBill(Bill entry)
        {
            this.SuspendLayout();
            DescriptionTextBox.Text = entry.Label;
            PaymentDateTextBox.Text = entry.PaymentDate;
            BillsProcessor processor = new BillsProcessor();

            NextPaymentDateTextBox.Text = processor.GetNextPaymentDate(entry.PaymentDate, entry.Frequency);
            ValueTextBox.Text           = entry.Value.ToString();
            FrequencyTextBox.Text       = entry.Frequency.ToString();
            SetPaidLabel();
            this.ResumeLayout();
        }
コード例 #5
0
        private void PaymentDateButton_Click(object sender, EventArgs e)
        {
            string editedValue = CollectEditedValue(EditorType.Date);

            if (!string.IsNullOrWhiteSpace(editedValue))
            {
                currentlyShownBill.PaymentDate = editedValue;
                UpdateCurrentlyShownBillFields();
                PaymentDateTextBox.Text = currentlyShownBill.PaymentDate;
                BillsProcessor processor = new BillsProcessor();
                NextPaymentDateTextBox.Text = processor.GetNextPaymentDate(currentlyShownBill.PaymentDate, currentlyShownBill.Frequency);
            }
        }
コード例 #6
0
        private void ShowWarningsIfNeeded()
        {
            BillsProcessor processor = new BillsProcessor();

            Bill[] unpaidBills    = processor.GetUnpaidBills();
            Bill[] incommingBills = processor.GetIncommingBills();
            if (unpaidBills.Length > 0 ||
                incommingBills.Length > 0)
            {
                WarningsList warningsDialog = new WarningsList();
                warningsDialog.InitializeEntriesLists(unpaidBills, incommingBills);
                warningsDialog.ShowDialog();
            }
        }
コード例 #7
0
        private void buttonFind_Click(object sender, EventArgs e)
        {
            FoundBills = new Bill[0];
            //Do the search
            BillsProcessor processor = new BillsProcessor();

            if (radioButtonForLabel.Checked)
            {
                FoundBills = processor.FindBills(textBoxLabel.Text, checkBoxPaid.Checked);
            }
            else
            {
                FoundBills = processor.FindBills(dateTimePicker.Value.ToShortDateString(), radioButtonNewer.Checked, checkBoxPaid.Checked);
            }

            DialogResult = DialogResult.OK;
        }
コード例 #8
0
        private void UpdateCurrentlyShownBillFields()
        {
            BillsProcessor processor = new BillsProcessor();

            processor.UpdateBill(currentlyShownBill);
        }