Beispiel #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;
 }
Beispiel #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);
        }
Beispiel #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);
        }
Beispiel #4
0
        public static bool Delete(Int32 shipMethodId, Int32 groupId)
        {
            ShipMethodGroup shipMethodGroup = new ShipMethodGroup();

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