/// <summary> /// Handles opening a <see cref="Views.PayeeEdit"/> form being opened from a <see cref="PayeeViewForm"/> forms /// </summary> /// <param name="sender">The sender object</param> /// <param name="e">Event arguments</param> public static void EditPayeeClick(object sender, EventArgs e) { if (PayeeEdit == null) { PayeeEdit = new PayeeEdit(); PayeeEdit.FormClosed += PayeeEditViewOnFormClosed; } var selectedItems = PayeeView.payeeListView.SelectedItems; if (selectedItems.Count > 0) { var selecteditem = selectedItems[0]; var payeeId = Guid.Parse(selecteditem.SubItems[0].Text); var payee = ListAccessHelper.FindPayee(payeeId); EditPayee = payee; } else { EditPayee = null; } PayeeEdit.Show(PayeeView); PayeeView.Hide(); }
/// <summary> /// Handles a <see cref="Views.PayeeAdd"/> form being opened from a <see cref="PayeeViewForm"/> form /// </summary> /// <param name="sender">The sender object</param> /// <param name="e">Event arguments</param> public static void AddPayeeClick(object sender, EventArgs e) { if (PayeeAdd == null) { PayeeAdd = new PayeeAdd(); PayeeAdd.FormClosed += PayeeAddViewOnClick; } PayeeAdd.Show(PayeeView); PayeeView.Hide(); }