private static CreditCardTypeCollection DBMapping(DBCreditCardTypeCollection dbCollection) { if (dbCollection == null) return null; CreditCardTypeCollection collection = new CreditCardTypeCollection(); foreach (DBCreditCardType dbItem in dbCollection) { CreditCardType item = DBMapping(dbItem); collection.Add(item); } return collection; }
private static CreditCardTypeCollection DBMapping(DBCreditCardTypeCollection dbCollection) { if (dbCollection == null) { return(null); } CreditCardTypeCollection collection = new CreditCardTypeCollection(); foreach (DBCreditCardType dbItem in dbCollection) { CreditCardType item = DBMapping(dbItem); collection.Add(item); } return(collection); }
/// <summary> /// Gets all credit card types /// </summary> /// <returns>Credit card type collection</returns> public override DBCreditCardTypeCollection GetAllCreditCardTypes() { DBCreditCardTypeCollection creditCardTypeCollection = new DBCreditCardTypeCollection(); Database db = NopSqlDataHelper.CreateConnection(_sqlConnectionString); DbCommand dbCommand = db.GetStoredProcCommand("Nop_CreditCardTypeLoadAll"); using (IDataReader dataReader = db.ExecuteReader(dbCommand)) { while (dataReader.Read()) { DBCreditCardType creditCardType = GetCreditCardTypeFromReader(dataReader); creditCardTypeCollection.Add(creditCardType); } } return(creditCardTypeCollection); }
/// <summary> /// Gets all credit card types /// </summary> /// <returns>Credit card type collection</returns> public static CreditCardTypeCollection GetAllCreditCardTypes() { string key = string.Format(CREDITCARDS_ALL_KEY); object obj2 = NopCache.Get(key); if (CreditCardTypeManager.CacheEnabled && (obj2 != null)) { return((CreditCardTypeCollection)obj2); } DBCreditCardTypeCollection dbCollection = DBProviderManager <DBCreditCardTypeProvider> .Provider.GetAllCreditCardTypes(); CreditCardTypeCollection creditCardTypeCollection = DBMapping(dbCollection); if (CreditCardTypeManager.CacheEnabled) { NopCache.Max(key, creditCardTypeCollection); } return(creditCardTypeCollection); }