Exemplo n.º 1
0
        public static CouponShipMethodCollection LoadForCoupon(Int32 couponId)
        {
            CouponShipMethodCollection CouponShipMethods = new CouponShipMethodCollection();
            //CREATE THE DYNAMIC SQL TO LOAD OBJECT
            StringBuilder selectQuery = new StringBuilder();

            selectQuery.Append("SELECT ShipMethodId");
            selectQuery.Append(" FROM ac_CouponShipMethods");
            selectQuery.Append(" WHERE CouponId = @couponId");
            Database  database      = Token.Instance.Database;
            DbCommand selectCommand = database.GetSqlStringCommand(selectQuery.ToString());

            database.AddInParameter(selectCommand, "@couponId", System.Data.DbType.Int32, couponId);
            //EXECUTE THE COMMAND
            using (IDataReader dr = database.ExecuteReader(selectCommand))
            {
                while (dr.Read())
                {
                    CouponShipMethod couponShipMethod = new CouponShipMethod();
                    couponShipMethod.CouponId     = couponId;
                    couponShipMethod.ShipMethodId = dr.GetInt32(0);
                    CouponShipMethods.Add(couponShipMethod);
                }
                dr.Close();
            }
            return(CouponShipMethods);
        }
Exemplo n.º 2
0
        public static CouponShipMethod Load(Int32 couponId, Int32 shipMethodId)
        {
            CouponShipMethod couponShipMethod = new CouponShipMethod();

            couponShipMethod.CouponId     = couponId;
            couponShipMethod.ShipMethodId = shipMethodId;
            couponShipMethod.IsDirty      = false;
            return(couponShipMethod);
        }
Exemplo n.º 3
0
        public static bool Delete(Int32 couponId, Int32 shipMethodId)
        {
            CouponShipMethod couponShipMethod = new CouponShipMethod();

            if (couponShipMethod.Load(couponId, shipMethodId))
            {
                return(couponShipMethod.Delete());
            }
            return(false);
        }
Exemplo n.º 4
0
 public static SaveResult Insert(CouponShipMethod couponShipMethod)
 {
     return(couponShipMethod.Save());
 }
Exemplo n.º 5
0
 public static bool Delete(CouponShipMethod couponShipMethod)
 {
     return(couponShipMethod.Delete());
 }
Exemplo n.º 6
0
 public static SaveResult Update(CouponShipMethod couponShipMethod)
 {
     return(couponShipMethod.Save());
 }