Esempio n. 1
0
        /// <summary>
        /// 根据角色ID取得角色信息
        /// </summary>
        /// <param name="RoleId"></param>
        /// <returns></returns>
        public RoleInfo GetRoleById(string RoleId)
        {
            RoleInfo info = new RoleInfo();

            using (DbDataReader reader = DataBaseManage.ExecuteReader(_SelectSql + " where roleid='" + RoleId + "'"))
            {
                if (reader.Read())
                {
                    info = BuilderEntity(reader);
                }
            }
            return info;
        }
Esempio n. 2
0
File: Role.cs Progetto: qq5013/JXNG
 /// <summary>
 /// 
 /// </summary>
 /// <param name="role"></param>
 /// <returns></returns>
 public bool ModifyRole(RoleInfo role)
 {
     return _role.ModifyRole(role);
 }
Esempio n. 3
0
File: Role.cs Progetto: qq5013/JXNG
 /// <summary>
 /// 
 /// </summary>
 /// <param name="role"></param>
 /// <returns></returns>
 public bool CreateRole(RoleInfo role)
 {
     return _role.CreateRole(role);
 }
Esempio n. 4
0
        private RoleInfo BuilderEntity(DbDataReader reader)
        {
            RoleInfo info = new RoleInfo();

            info.RoleId = (reader.IsDBNull(reader.GetOrdinal("roleid"))) ? int.Parse("0") : int.Parse(reader["roleid"].ToString());
            info.RoleName = (reader.IsDBNull(reader.GetOrdinal("rolename"))) ? "" : reader["rolename"].ToString();
            info.Remark = (reader.IsDBNull(reader.GetOrdinal("remark"))) ? "" : reader["remark"].ToString();

            return info;
        }
Esempio n. 5
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="role"></param>
 /// <returns></returns>
 public bool ModifyRole(RoleInfo role)
 {
     string Sql = string.Format("Update roleinfo  Set rolename = '{0}',remark = '{1}' Where roleid = '{2}'", role.RoleName,role.Remark, role.RoleId);
     return DataBaseManage.ExecuteSql(Sql) > 0;
 }
Esempio n. 6
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="role"></param>
        /// <returns></returns>
        public bool CreateRole(RoleInfo role)
        {
            string Sql = string.Format("Insert Into roleinfo(rolename,remark)Values('{0}','{1}')", role.RoleName,role.Remark);

            return DataBaseManage.ExecuteSql(Sql) > 0;
        }