コード例 #1
0
        public static ShipZone Load(Int32 shipZoneId, bool useCache)
        {
            if (shipZoneId == 0)
            {
                return(null);
            }
            ShipZone shipZone = null;
            string   key      = "ShipZone_" + shipZoneId.ToString();

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

            if (shipZone.Load(shipZoneId))
            {
                return(shipZone.Delete());
            }
            return(false);
        }