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); }
public static CouponShipMethod Load(Int32 couponId, Int32 shipMethodId) { CouponShipMethod couponShipMethod = new CouponShipMethod(); couponShipMethod.CouponId = couponId; couponShipMethod.ShipMethodId = shipMethodId; couponShipMethod.IsDirty = false; return(couponShipMethod); }
public static bool Delete(Int32 couponId, Int32 shipMethodId) { CouponShipMethod couponShipMethod = new CouponShipMethod(); if (couponShipMethod.Load(couponId, shipMethodId)) { return(couponShipMethod.Delete()); } return(false); }
public static SaveResult Insert(CouponShipMethod couponShipMethod) { return(couponShipMethod.Save()); }
public static bool Delete(CouponShipMethod couponShipMethod) { return(couponShipMethod.Delete()); }
public static SaveResult Update(CouponShipMethod couponShipMethod) { return(couponShipMethod.Save()); }