public static ShipRateMatrix Load(Int32 shipRateMatrixId, bool useCache) { if (shipRateMatrixId == 0) { return(null); } ShipRateMatrix shipRateMatrix = null; string key = "ShipRateMatrix_" + shipRateMatrixId.ToString(); if (useCache) { shipRateMatrix = ContextCache.GetObject(key) as ShipRateMatrix; if (shipRateMatrix != null) { return(shipRateMatrix); } } shipRateMatrix = new ShipRateMatrix(); if (shipRateMatrix.Load(shipRateMatrixId)) { if (useCache) { ContextCache.SetObject(key, shipRateMatrix); } return(shipRateMatrix); } return(null); }
public static bool Delete(Int32 shipRateMatrixId) { ShipRateMatrix shipRateMatrix = new ShipRateMatrix(); if (shipRateMatrix.Load(shipRateMatrixId)) { return(shipRateMatrix.Delete()); } return(false); }