Ejemplo n.º 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));
 }
Ejemplo n.º 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));
     }
 }
Ejemplo n.º 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);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 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);
        }