コード例 #1
0
        public static SpecialGroupCollection LoadForGroup(Int32 groupId)
        {
            SpecialGroupCollection SpecialGroups = new SpecialGroupCollection();
            //CREATE THE DYNAMIC SQL TO LOAD OBJECT
            StringBuilder selectQuery = new StringBuilder();

            selectQuery.Append("SELECT SpecialId");
            selectQuery.Append(" FROM ac_SpecialGroups");
            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())
                {
                    SpecialGroup specialGroup = new SpecialGroup();
                    specialGroup.GroupId   = groupId;
                    specialGroup.SpecialId = dr.GetInt32(0);
                    SpecialGroups.Add(specialGroup);
                }
                dr.Close();
            }
            return(SpecialGroups);
        }
コード例 #2
0
 /// <summary>
 /// Loads the given SpecialGroup object from the given database data reader.
 /// </summary>
 /// <param name="specialGroup">The SpecialGroup object to load.</param>
 /// <param name="dr">The database data reader to read data from.</param>
 public static void LoadDataReader(SpecialGroup specialGroup, IDataReader dr)
 {
     //SET FIELDS FROM ROW DATA
     specialGroup.SpecialId = dr.GetInt32(0);
     specialGroup.GroupId   = dr.GetInt32(1);
     specialGroup.IsDirty   = false;
 }
コード例 #3
0
        public static SpecialGroup Load(Int32 specialId, Int32 groupId)
        {
            SpecialGroup specialGroup = new SpecialGroup();

            specialGroup.SpecialId = specialId;
            specialGroup.GroupId   = groupId;
            specialGroup.IsDirty   = false;
            return(specialGroup);
        }
コード例 #4
0
        public static bool Delete(Int32 specialId, Int32 groupId)
        {
            SpecialGroup specialGroup = new SpecialGroup();

            if (specialGroup.Load(specialId, groupId))
            {
                return(specialGroup.Delete());
            }
            return(false);
        }
コード例 #5
0
 public static SaveResult Insert(SpecialGroup specialGroup)
 {
     return(specialGroup.Save());
 }
コード例 #6
0
 public static bool Delete(SpecialGroup specialGroup)
 {
     return(specialGroup.Delete());
 }
コード例 #7
0
 public static SaveResult Update(SpecialGroup specialGroup)
 {
     return(specialGroup.Save());
 }