private bool AmountAccontIDCheck(bool amount_changed, double amount, Int32 account_id) { //AuxVariables double tmp_saldo; List <object> objects; //Run Method if (account_id != 0) { objects = Read(Controllers.ClassType.account); tmp_saldo = 0; foreach (object obj in objects) { Models.Account temp = (Models.Account)obj; if (temp.GetID() == account_id) { tmp_saldo = temp.GetSaldo(); } } return(tmp_saldo + amount >= 0); } else { return(true); } }
public List <Int32> GetLowerAccountIDs() { //AuxVariables List <object> objects; List <Int32> result; //Run Method result = new List <int>(); objects = Read(Controllers.ClassType.account); foreach (object obj in objects) { Models.Account temp = (Models.Account)obj; if (temp.GetUpperAccountID() == primary_key) { result.Add(temp.GetID()); } } return(result); }
public List <Int32> GetPossibleUpperAccountIDs() { //AuxVariables List <object> objects; List <Int32> result; //Run Method result = new List <int>(); objects = Read(Controllers.ClassType.account); foreach (object obj in objects) { Models.Account temp = (Models.Account)obj; if (temp.GetAccessible() & temp.GetAsset() == asset & temp.GetConsisted() == consisted & temp.GetUpperAccountID() == 0 & temp.GetAccountingRecordIDs().Count == 0) { result.Add(temp.GetID()); } } return(result); }