public SBRole(int role_id = 0) : base() { this.roles_table = new SBTableRol(); this._capabilities = new Hashtable(); if (role_id != 0) { this.GetDbData(role_id); } }
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"])); }
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); }