private void SelectComboBox_SelectedIndexChanged(object sender, EventArgs e) { BillsProcessor processor = new BillsProcessor(); billsForLabel = processor.GetBillsForLabel(SelectComboBox.Text); currentlyShownBill = billsForLabel[0]; currentlySelectedIndexWithinLabel = 0; PopulateControlsForBill(currentlyShownBill); }
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 } }
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; } }
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(); }
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); } }
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(); } }
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; }
private void UpdateCurrentlyShownBillFields() { BillsProcessor processor = new BillsProcessor(); processor.UpdateBill(currentlyShownBill); }