private void btn_transAdd_Click(object sender, EventArgs e) { TransactionEntry form_TransactionEntry = new TransactionEntry(myBudget, myTransaction); form_TransactionEntry.FormClosed += new FormClosedEventHandler(TransactionEntry_FormClosed); form_TransactionEntry.isAddTransactionEntry = true; form_TransactionEntry.Show(); }
private void btn_transModify_Click(object sender, EventArgs e) { int transaction_ID; string transaction_String; if (lstvw_TransactionEntry.SelectedItems.Count > 0) { transaction_ID = Convert.ToInt32(lstvw_TransactionEntry.SelectedItems[0].SubItems[0].Text); transaction_String = lstvw_TransactionEntry.SelectedItems[0].SubItems[1].Text; //TODO: in TransactionEntry, if modify is selected get the Transaction ID of the item selected so it can be updated in the database. myTransaction.SelectedTransaction = new Transaction { transactionID = transaction_ID, transactionName = transaction_String }; TransactionEntry form_TransactionEntry = new TransactionEntry(myBudget, myTransaction); form_TransactionEntry.FormClosed += new FormClosedEventHandler(TransactionEntry_FormClosed); form_TransactionEntry.isModifyTransactionEntry = true; form_TransactionEntry.Show(); } }