private void hardBillsLv_MouseUp(object sender, MouseEventArgs e) { int index = -1; IHardBill hardBill = null; if (e.Button == MouseButtons.Right) { if (hardBillsLv.Items.Count > 0) { ListViewItem selectedItem = hardBillsLv.GetItemAt(e.X, e.Y); if (selectedItem != null) { index = selectedItem.Index; hardBill = _year.GetHardBill(selectedItem.SubItems[0].Text); } } if ((hardBill != null) && (!hardBill.AutoPay)) { hbPay.Enabled = true; //purchasesEdit.Enabled = true; } else { hbPay.Enabled = false; //purchasesEdit.Enabled = false; } hbCms.Show(this, new Point(e.X + ((Control)sender).Left + 20, e.Y + ((Control)sender).Top + 20)); //accountCms.Show(this, new Point(e.X, e.Y)); } }
public void SimpleHardBillTest() { decimal checkingExpected = yearTop.GetAccount("checking").CurrentBalance; yearTop.GetHardBill("electricity").PerformAutoPay(new DateTime(2020, 2, 14)); checkingExpected -= yearTop.GetHardBill("electricity").Amount; Assert.AreEqual(checkingExpected, yearTop.GetAccount("checking").CurrentBalance); }
private void annualHbEdit_Click_1(object sender, EventArgs e) { string hardBill = hardBillsLv.SelectedItems[0].SubItems[0].Text; var editHardBill = new EditHardBillForm(_year.GetHardBill(hardBill), _year); editHardBill.NewHardBillAdded += RefreshPage_Handler; editHardBill.ShowDialog(); }