示例#1
0
        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;
 }
示例#3
0
        public static ShipMethodWarehouse Load(Int32 shipMethodId, Int32 warehouseId)
        {
            ShipMethodWarehouse shipMethodWarehouse = new ShipMethodWarehouse();

            shipMethodWarehouse.ShipMethodId = shipMethodId;
            shipMethodWarehouse.WarehouseId  = warehouseId;
            shipMethodWarehouse.IsDirty      = false;
            return(shipMethodWarehouse);
        }
示例#4
0
        public static bool Delete(Int32 shipMethodId, Int32 warehouseId)
        {
            ShipMethodWarehouse shipMethodWarehouse = new ShipMethodWarehouse();

            if (shipMethodWarehouse.Load(shipMethodId, warehouseId))
            {
                return(shipMethodWarehouse.Delete());
            }
            return(false);
        }
示例#5
0
 public static SaveResult Insert(ShipMethodWarehouse shipMethodWarehouse)
 {
     return(shipMethodWarehouse.Save());
 }
示例#6
0
 public static bool Delete(ShipMethodWarehouse shipMethodWarehouse)
 {
     return(shipMethodWarehouse.Delete());
 }
示例#7
0
 public static SaveResult Update(ShipMethodWarehouse shipMethodWarehouse)
 {
     return(shipMethodWarehouse.Save());
 }