Beispiel #1
0
        public static TaxGateway Load(Int32 taxGatewayId, bool useCache)
        {
            if (taxGatewayId == 0)
            {
                return(null);
            }
            TaxGateway taxGateway = null;
            string     key        = "TaxGateway_" + taxGatewayId.ToString();

            if (useCache)
            {
                taxGateway = ContextCache.GetObject(key) as TaxGateway;
                if (taxGateway != null)
                {
                    return(taxGateway);
                }
            }
            taxGateway = new TaxGateway();
            if (taxGateway.Load(taxGatewayId))
            {
                if (useCache)
                {
                    ContextCache.SetObject(key, taxGateway);
                }
                return(taxGateway);
            }
            return(null);
        }
Beispiel #2
0
        public static bool Delete(Int32 taxGatewayId)
        {
            TaxGateway taxGateway = new TaxGateway();

            if (taxGateway.Load(taxGatewayId))
            {
                return(taxGateway.Delete());
            }
            return(false);
        }