Beispiel #1
0
 /// <summary>
 /// Updates this instance of RoleGroup. Returns true on success.
 /// </summary>
 /// <returns>bool</returns>
 private static bool Update(RoleGroup RoleGroup)
 {
     return(DBRoleGroup.Update(
                RoleGroup.Id,
                RoleGroup.GroupName,
                RoleGroup.GroupId,
                RoleGroup.OrderId));
 }
Beispiel #2
0
 /// <summary>
 /// Saves this instance of RoleGroup. Returns true on success.
 /// </summary>
 /// <returns>bool</returns>
 public static bool Save(RoleGroup RoleGroup)
 {
     if (RoleGroup.Id > 0)
     {
         return(Update(RoleGroup));
     }
     else
     {
         return(Create(RoleGroup));
     }
 }
Beispiel #3
0
        private static RoleGroup PopulateFromReader(IDataReader reader)
        {
            RoleGroup RoleGroup = new RoleGroup();

            if (reader.Read())
            {
                RoleGroup.Id        = Convert.ToInt32(reader["Id"]);
                RoleGroup.GroupName = reader["GroupName"].ToString();
                RoleGroup.GroupId   = Convert.ToInt32(reader["GroupId"]);
                RoleGroup.OrderId   = Convert.ToInt32(reader["OrderId"]);
            }
            return(RoleGroup);
        }
Beispiel #4
0
        /// <summary>
        /// Persists a new instance of RoleGroup. Returns true on success.
        /// </summary>
        /// <returns></returns>
        private static bool Create(RoleGroup RoleGroup)
        {
            int newID = 0;

            newID = DBRoleGroup.Create(
                RoleGroup.GroupName,
                RoleGroup.GroupId,
                RoleGroup.OrderId);

            RoleGroup.Id = newID;

            return(newID > 0);
        }
Beispiel #5
0
        private static IList <RoleGroup> LoadListFromReader(IDataReader reader)
        {
            IList <RoleGroup> RoleGroupList = new List <RoleGroup>();

            try
            {
                while (reader.Read())
                {
                    RoleGroup RoleGroup = new RoleGroup();
                    RoleGroup.Id        = Convert.ToInt32(reader["Id"]);
                    RoleGroup.GroupName = reader["GroupName"].ToString();
                    RoleGroup.GroupId   = Convert.ToInt32(reader["GroupId"]);
                    RoleGroup.OrderId   = Convert.ToInt32(reader["OrderId"]);
                    RoleGroupList.Add(RoleGroup);
                }
            }
            finally
            {
                reader.Close();
            }

            return(RoleGroupList);
        }