Example #1
0
 /// <summary>
 /// Loads the given ShipMethodGroup object from the given database data reader.
 /// </summary>
 /// <param name="shipMethodGroup">The ShipMethodGroup object to load.</param>
 /// <param name="dr">The database data reader to read data from.</param>
 public static void LoadDataReader(ShipMethodGroup shipMethodGroup, IDataReader dr)
 {
     //SET FIELDS FROM ROW DATA
     shipMethodGroup.ShipMethodId = dr.GetInt32(0);
     shipMethodGroup.GroupId      = dr.GetInt32(1);
     shipMethodGroup.IsDirty      = false;
 }
Example #2
0
        public static ShipMethodGroupCollection LoadForGroup(Int32 groupId)
        {
            ShipMethodGroupCollection ShipMethodGroups = new ShipMethodGroupCollection();
            //CREATE THE DYNAMIC SQL TO LOAD OBJECT
            StringBuilder selectQuery = new StringBuilder();

            selectQuery.Append("SELECT ShipMethodId");
            selectQuery.Append(" FROM ac_ShipMethodGroups");
            selectQuery.Append(" WHERE GroupId = @groupId");
            Database  database      = Token.Instance.Database;
            DbCommand selectCommand = database.GetSqlStringCommand(selectQuery.ToString());

            database.AddInParameter(selectCommand, "@groupId", System.Data.DbType.Int32, groupId);
            //EXECUTE THE COMMAND
            using (IDataReader dr = database.ExecuteReader(selectCommand))
            {
                while (dr.Read())
                {
                    ShipMethodGroup shipMethodGroup = new ShipMethodGroup();
                    shipMethodGroup.GroupId      = groupId;
                    shipMethodGroup.ShipMethodId = dr.GetInt32(0);
                    ShipMethodGroups.Add(shipMethodGroup);
                }
                dr.Close();
            }
            return(ShipMethodGroups);
        }
Example #3
0
        public static ShipMethodGroup Load(Int32 shipMethodId, Int32 groupId)
        {
            ShipMethodGroup shipMethodGroup = new ShipMethodGroup();

            shipMethodGroup.ShipMethodId = shipMethodId;
            shipMethodGroup.GroupId      = groupId;
            shipMethodGroup.IsDirty      = false;
            return(shipMethodGroup);
        }
Example #4
0
        public static bool Delete(Int32 shipMethodId, Int32 groupId)
        {
            ShipMethodGroup shipMethodGroup = new ShipMethodGroup();

            if (shipMethodGroup.Load(shipMethodId, groupId))
            {
                return(shipMethodGroup.Delete());
            }
            return(false);
        }
Example #5
0
 public static SaveResult Insert(ShipMethodGroup shipMethodGroup)
 {
     return(shipMethodGroup.Save());
 }
Example #6
0
 public static bool Delete(ShipMethodGroup shipMethodGroup)
 {
     return(shipMethodGroup.Delete());
 }
Example #7
0
 public static SaveResult Update(ShipMethodGroup shipMethodGroup)
 {
     return(shipMethodGroup.Save());
 }