Exemplo n.º 1
0
        /// <summary>
        /// Gets an IList with page of instances of UserGroup.
        /// </summary>
        /// <param name="pageNumber">The page number.</param>
        /// <param name="pageSize">Size of the page.</param>
        /// <param name="itemCount">total items</param>
        public static IList <UserGroup> GetListPage(int pageNumber, int pageSize, int pid, out int itemCount)
        {
            itemCount = 1;
            IDataReader reader = DBUserGroup.GetListPage(pageNumber, pageSize, pid, out itemCount);

            return(LoadListFromReader(reader));
        }
Exemplo n.º 2
0
 //增加
 public static UserGroup GetGroupTopOne()
 {
     using (IDataReader reader = DBUserGroup.GetTopOne())
     {
         return(PopulateFromReader(reader));
     }
 }
Exemplo n.º 3
0
 /// <summary>
 /// Updates this instance of UserGroup. Returns true on success.
 /// </summary>
 /// <returns>bool</returns>
 private static bool Update(UserGroup userGroup)
 {
     return(DBUserGroup.Update(
                userGroup.Id,
                userGroup.GroupName,
                userGroup.GroupId,
                userGroup.OrderId));
 }
Exemplo n.º 4
0
        /// <summary>
        /// Gets an IList with some instances of UserGroup.
        /// </summary>
        public static IList <UserGroup> GetTopList(
            int id)
        {
            IDataReader reader = DBUserGroup.GetTopList(
                id);

            return(LoadListFromReader(reader));
        }
Exemplo n.º 5
0
 /// <summary>
 /// Gets an instance of UserGroup.
 /// </summary>
 /// <param name="id"> id </param>
 private static UserGroup GetUserGroup(
     int id)
 {
     using (IDataReader reader = DBUserGroup.GetOne(
                id))
     {
         return(PopulateFromReader(reader));
     }
 }
Exemplo n.º 6
0
        /// <summary>
        /// Persists a new instance of UserGroup. Returns true on success.
        /// </summary>
        /// <returns></returns>
        private static bool Create(UserGroup userGroup)
        {
            int newID = 0;

            newID = DBUserGroup.Create(
                userGroup.GroupName,
                userGroup.GroupId,
                userGroup.OrderId);

            userGroup.Id = newID;

            return(newID > 0);
        }
Exemplo n.º 7
0
        /// <summary>
        /// Gets an IList with all instances of UserGroup.
        /// </summary>
        public static IList <UserGroup> GetAll()
        {
            IDataReader reader = DBUserGroup.GetAll();

            return(LoadListFromReader(reader));
        }
Exemplo n.º 8
0
 /// <summary>
 /// Gets a count of UserGroup.
 /// </summary>
 public static int GetCount()
 {
     return(DBUserGroup.GetCount());
 }
Exemplo n.º 9
0
 /// <summary>
 /// Deletes an instance of UserGroup. Returns true on success.
 /// </summary>
 /// <param name="id"> id </param>
 /// <returns>bool</returns>
 public static bool Delete(
     int id)
 {
     return(DBUserGroup.Delete(
                id));
 }