private void btn_moneyreceivedAdd_Click(object sender, EventArgs e) { MoneyReceivedEntry form_IncomeEntry = new MoneyReceivedEntry(myBudget, myIncome); form_IncomeEntry.FormClosed += new FormClosedEventHandler(TransactionEntry_FormClosed); form_IncomeEntry.isAddTransactionEntry = true; form_IncomeEntry.Show(); }
private void btn_moneyreceivedModify_Click(object sender, EventArgs e) { //TODO add code from modifying income int income_ID; string income_String; if (lstvw_MoneyReceived.SelectedItems.Count > 0) { income_ID = Convert.ToInt32(lstvw_MoneyReceived.SelectedItems[0].SubItems[0].Text); income_String = lstvw_MoneyReceived.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. myIncome.SelectedTransaction = new Transaction { transactionID = income_ID, transactionName = income_String }; MoneyReceivedEntry form_IncomeEntry = new MoneyReceivedEntry(myBudget, myIncome); form_IncomeEntry.FormClosed += new FormClosedEventHandler(TransactionEntry_FormClosed); form_IncomeEntry.isModifyTransactionEntry = true; form_IncomeEntry.Show(); } }