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(); } }
public void Display() { mUCs p_mucs = mUCs.s_mUCs; p_mucs.HideAll(); p_mucs.m_ucLoggedIn.Left = p_mucs.m_ucLogin.Left; p_mucs.m_ucLoggedIn.Top = p_mucs.m_ucLogin.Top; p_mucs.m_ucLoggedIn.Show(); acc = new mAccount(); Guid?mAccount = acc.accountLoggedIn(); if (mAccount == null || mAccount == Guid.Empty) { } else { cAcc = new cAccount().readById((Guid)mAccount); //Check if should log out TimeSpan ts = DateTime.Now - cAcc.accDT; if (ts.Minutes >= 5) { p_mucs.m_ucLogin.Display(); } mCash mCash = new mCash(); LINuser.Text = cAcc.accUserName; LINbalance.Text = mCash.getBalance(); } }