private void PCSspend_Click(object sender, EventArgs e) { double balance = m_cash.getBalance(); KeyValuePair <string, string> sel = (KeyValuePair <string, string>)PCScombo.SelectedItem; CashCategory catKey; if (!Enum.TryParse(sel.Key, true, out catKey)) { } double cash; if (!double.TryParse(PCSamount.Text, out cash)) { //Cash amount not successfully parsed } if (cash <= 0.0) { m_UCs.MessageBoxShow("Please ensure a correct spending amount"); } else if (cash > balance) { m_UCs.MessageBoxShow("Insufficient funds to complete transaction"); } else { var r_cash = m_cash.doUpdate(cAcc.accUserName, catKey, cash, AccountAuditType.AAT_CashSpent); if (r_cash == null) { //Cash not successfully added } m_UCs.ShowScreen_Transactions(); } }
private void PCSAdd_Click(object sender, EventArgs e) { double cash = 0.0; if (!double.TryParse(PCAamount.Text, out cash)) { //Cash amount not successfully parsed } var r_cash = m_cash.doUpdate(cAcc.accUserName, CashCategory.PCC_CashAdd, cash, AccountAuditType.AAT_CashSpent); if (r_cash == null) { //Cash not successfully added } m_UCs.ShowScreen_Main(); }