public void PutGlAccount(int glaccountsid, GlAccount glAccountstoUpdate) { //GlAccount.UpdateData(glAccountstoUpdate); IGlAccountDb glAccountDb = new GlAccountDb(); glAccountDb.RetrieveById(glaccountsid); glAccountDb.UpdateData(glAccountstoUpdate); }
public bool GetGLAccountBalanceConfirmed(int glAccountid, double amount) { IGlAccountDb glAccountDb = new GlAccountDb(); GlAccount glAccount = glAccountDb.RetrieveById(glAccountid); if (glAccount.Balance < amount) { return(false); } else { return(true); } }
public double GetGlAccountWithdrawal(int glAccountid, double amount) { IGlAccountDb glAccountDb = new GlAccountDb(); GlAccount glAccount = glAccountDb.RetrieveById(glAccountid); //Credit account if its any of these 2 glAccount Types below: if (glAccount.GlAccountCodes.StartsWith("1") || glAccount.GlAccountCodes.StartsWith("5")) { if (glAccount.Balance >= amount) { glAccount.Balance = glAccount.Balance - amount; } } //Credit account if its any of these 3 glAccount Types below: else if (glAccount.GlAccountCodes.StartsWith("2") || glAccount.GlAccountCodes.StartsWith("3") || glAccount.GlAccountCodes.StartsWith("4")) { glAccount.Balance = glAccount.Balance + amount; } return(glAccount.Balance); }