public static ShipMethodWarehouseCollection LoadForShipMethod(Int32 shipMethodId) { ShipMethodWarehouseCollection ShipMethodWarehouses = new ShipMethodWarehouseCollection(); //CREATE THE DYNAMIC SQL TO LOAD OBJECT StringBuilder selectQuery = new StringBuilder(); selectQuery.Append("SELECT WarehouseId"); selectQuery.Append(" FROM ac_ShipMethodWarehouses"); selectQuery.Append(" WHERE ShipMethodId = @shipMethodId"); Database database = Token.Instance.Database; DbCommand selectCommand = database.GetSqlStringCommand(selectQuery.ToString()); database.AddInParameter(selectCommand, "@shipMethodId", System.Data.DbType.Int32, shipMethodId); //EXECUTE THE COMMAND using (IDataReader dr = database.ExecuteReader(selectCommand)) { while (dr.Read()) { ShipMethodWarehouse shipMethodWarehouse = new ShipMethodWarehouse(); shipMethodWarehouse.ShipMethodId = shipMethodId; shipMethodWarehouse.WarehouseId = dr.GetInt32(0); ShipMethodWarehouses.Add(shipMethodWarehouse); } dr.Close(); } return(ShipMethodWarehouses); }
/// <summary> /// Loads the given ShipMethodWarehouse object from the given database data reader. /// </summary> /// <param name="shipMethodWarehouse">The ShipMethodWarehouse object to load.</param> /// <param name="dr">The database data reader to read data from.</param> public static void LoadDataReader(ShipMethodWarehouse shipMethodWarehouse, IDataReader dr) { //SET FIELDS FROM ROW DATA shipMethodWarehouse.ShipMethodId = dr.GetInt32(0); shipMethodWarehouse.WarehouseId = dr.GetInt32(1); shipMethodWarehouse.IsDirty = false; }
public static ShipMethodWarehouse Load(Int32 shipMethodId, Int32 warehouseId) { ShipMethodWarehouse shipMethodWarehouse = new ShipMethodWarehouse(); shipMethodWarehouse.ShipMethodId = shipMethodId; shipMethodWarehouse.WarehouseId = warehouseId; shipMethodWarehouse.IsDirty = false; return(shipMethodWarehouse); }
public static bool Delete(Int32 shipMethodId, Int32 warehouseId) { ShipMethodWarehouse shipMethodWarehouse = new ShipMethodWarehouse(); if (shipMethodWarehouse.Load(shipMethodId, warehouseId)) { return(shipMethodWarehouse.Delete()); } return(false); }
public static SaveResult Insert(ShipMethodWarehouse shipMethodWarehouse) { return(shipMethodWarehouse.Save()); }
public static bool Delete(ShipMethodWarehouse shipMethodWarehouse) { return(shipMethodWarehouse.Delete()); }
public static SaveResult Update(ShipMethodWarehouse shipMethodWarehouse) { return(shipMethodWarehouse.Save()); }