public static CurrencyContainerRec CheckAndGetValidCurrencyContainer(int currencyType, int quantity) { foreach (CurrencyContainerRec currencyContainerRec in StaticDB.currencyContainerDB.GetRecordsByParentID(currencyType)) { if (CurrencyContainerDB.IsCurrencyContainerValid(quantity, currencyContainerRec.MinAmount, currencyContainerRec.MaxAmount)) { return(currencyContainerRec); } } return(null); }
public static CurrencyContainerRec CheckAndGetValidCurrencyContainer(int currencyType, int quantity) { CurrencyContainerRec currencyContainerRec; using (IEnumerator <CurrencyContainerRec> enumerator = StaticDB.currencyContainerDB.GetRecordsByParentID(currencyType).GetEnumerator()) { while (enumerator.MoveNext()) { CurrencyContainerRec current = enumerator.Current; if (!CurrencyContainerDB.IsCurrencyContainerValid(quantity, current.MinAmount, current.MaxAmount)) { continue; } currencyContainerRec = current; return(currencyContainerRec); } return(null); } return(currencyContainerRec); }