public static GiftCertificateTransaction Load(Int32 giftCertificateTransactionId, bool useCache) { if (giftCertificateTransactionId == 0) { return(null); } GiftCertificateTransaction giftCertificateTransaction = null; string key = "GiftCertificateTransaction_" + giftCertificateTransactionId.ToString(); if (useCache) { giftCertificateTransaction = ContextCache.GetObject(key) as GiftCertificateTransaction; if (giftCertificateTransaction != null) { return(giftCertificateTransaction); } } giftCertificateTransaction = new GiftCertificateTransaction(); if (giftCertificateTransaction.Load(giftCertificateTransactionId)) { if (useCache) { ContextCache.SetObject(key, giftCertificateTransaction); } return(giftCertificateTransaction); } return(null); }
public static bool Delete(Int32 giftCertificateTransactionId) { GiftCertificateTransaction giftCertificateTransaction = new GiftCertificateTransaction(); if (giftCertificateTransaction.Load(giftCertificateTransactionId)) { return(giftCertificateTransaction.Delete()); } return(false); }