コード例 #1
0
        public static ShipGateway Load(Int32 shipGatewayId, bool useCache)
        {
            if (shipGatewayId == 0)
            {
                return(null);
            }
            ShipGateway shipGateway = null;
            string      key         = "ShipGateway_" + shipGatewayId.ToString();

            if (useCache)
            {
                shipGateway = ContextCache.GetObject(key) as ShipGateway;
                if (shipGateway != null)
                {
                    return(shipGateway);
                }
            }
            shipGateway = new ShipGateway();
            if (shipGateway.Load(shipGatewayId))
            {
                if (useCache)
                {
                    ContextCache.SetObject(key, shipGateway);
                }
                return(shipGateway);
            }
            return(null);
        }
コード例 #2
0
        public static bool Delete(Int32 shipGatewayId)
        {
            ShipGateway shipGateway = new ShipGateway();

            if (shipGateway.Load(shipGatewayId))
            {
                return(shipGateway.Delete());
            }
            return(false);
        }