Example #1
0
 public SBRole(int role_id = 0) : base()
 {
     this.roles_table   = new SBTableRol();
     this._capabilities = new Hashtable();
     if (role_id != 0)
     {
         this.GetDbData(role_id);
     }
 }
Example #2
0
        public static int getRolIdByName(string name)
        {
            SBTableRol tr    = new SBTableRol();
            string     query = "SELECT rol_id, role_name FROM " + tr.TableName + " WHERE LOWER(role_name) = '" + name.ToLower() + "'";
            Hashtable  row   = SBFactory.getDbh().QueryRow(query);

            if (row == null)
            {
                return(0);
            }
            return(Convert.ToInt32(row["role_id"]));
        }
Example #3
0
        public static SBRole getRolByName(string name)
        {
            SBTableRol tr  = new SBTableRol();
            Hashtable  row = tr.getRow("role_name = '" + name + "'");

            if (row == null)
            {
                return(null);
            }
            SBRole rol = new SBRole(Convert.ToInt32(row["role_id"]));

            return(rol);
        }