public override ACRole[] ListRoles(RoleListingOptions pListingOptions) { List <ACRole> lstResult = new List <ACRole>(); using (ConnectionWrapper cnn = ((DBManager)_dbManager).GetConnection()) { using (SQLiteCommand cmd = cnn.CreateCommand()) { cmd.CommandText = "SELECT [id],[name],[is_system],[is_deletable],[is_hidden] FROM [mlac_tbl_roles]"; if (pListingOptions != RoleListingOptions.All) { cmd.CommandText += " WHERE [is_hidden]=@pListHidden;"; if (pListingOptions == RoleListingOptions.Hidden) { cmd.Parameters.Add(new SQLiteParameter("@pListHidden", true)); } else if (pListingOptions == RoleListingOptions.Non_Hidden) { cmd.Parameters.Add(new SQLiteParameter("@pListHidden", false)); } } cnn.Open(); using (SQLiteDataReader reader = cmd.ExecuteReader()) { while (reader.Read()) { lstResult.Add(new ACRole() { Id = reader.GetInt32(0), Name = reader.GetString(1), IsSystem = reader.GetBoolean(2), IsDeletable = reader.GetBoolean(3), IsHidden = reader.GetBoolean(4) }); } } } } return(lstResult.ToArray()); }
public override ACRole[] ListRoles(RoleListingOptions pListingOptions) { List <ACRole> lstResult = new List <ACRole>(); using (ConnectionWrapper cnn = ((DBManager)_dbManager).GetConnection()) { using (SqlCommand cmd = cnn.CreateCommand()) { cmd.CommandType = System.Data.CommandType.StoredProcedure; cmd.CommandText = "mlac_sp_rol_ListRoles"; if (pListingOptions != RoleListingOptions.All) { if (pListingOptions == RoleListingOptions.Hidden) { cmd.Parameters.Add(new SqlParameter("@pListHidden", true)); } else if (pListingOptions == RoleListingOptions.Non_Hidden) { cmd.Parameters.Add(new SqlParameter("@pListHidden", false)); } } cnn.Open(); using (SqlDataReader reader = cmd.ExecuteReader()) { while (reader.Read()) { lstResult.Add(new ACRole() { Id = reader.GetInt32(0), Name = reader.GetString(1), IsSystem = reader.GetBoolean(2), IsDeletable = reader.GetBoolean(3), IsHidden = reader.GetBoolean(4) }); } } } } return(lstResult.ToArray()); }
public override ACRole[] ListRoles(RoleListingOptions pListingOptions) { List<ACRole> lstResult = new List<ACRole>(); using (ConnectionWrapper cnn = ((DBManager)_dbManager).GetConnection()) { using (SQLiteCommand cmd = cnn.CreateCommand()) { cmd.CommandText = "SELECT [id],[name],[is_system],[is_deletable],[is_hidden] FROM [mlac_tbl_roles]"; if (pListingOptions != RoleListingOptions.All) { cmd.CommandText += " WHERE [is_hidden]=@pListHidden;"; if (pListingOptions == RoleListingOptions.Hidden) cmd.Parameters.Add(new SQLiteParameter("@pListHidden", true)); else if (pListingOptions == RoleListingOptions.Non_Hidden) cmd.Parameters.Add(new SQLiteParameter("@pListHidden", false)); } cnn.Open(); using (SQLiteDataReader reader = cmd.ExecuteReader()) { while(reader.Read()) { lstResult.Add(new ACRole() { Id = reader.GetInt32(0), Name = reader.GetString(1), IsSystem = reader.GetBoolean(2), IsDeletable = reader.GetBoolean(3), IsHidden = reader.GetBoolean(4) }); } } } } return lstResult.ToArray(); }
public override ACRole[] ListRoles(RoleListingOptions pListingOptions) { List<ACRole> lstResult = new List<ACRole>(); using (ConnectionWrapper cnn = ((DBManager)_dbManager).GetConnection()) { using (SqlCommand cmd = cnn.CreateCommand()) { cmd.CommandType = System.Data.CommandType.StoredProcedure; cmd.CommandText = "mlac_sp_rol_ListRoles"; if (pListingOptions != RoleListingOptions.All) { if (pListingOptions == RoleListingOptions.Hidden) cmd.Parameters.Add(new SqlParameter("@pListHidden", true)); else if (pListingOptions == RoleListingOptions.Non_Hidden) cmd.Parameters.Add(new SqlParameter("@pListHidden", false)); } cnn.Open(); using (SqlDataReader reader = cmd.ExecuteReader()) { while (reader.Read()) { lstResult.Add(new ACRole() { Id = reader.GetInt32(0), Name = reader.GetString(1), IsSystem = reader.GetBoolean(2), IsDeletable = reader.GetBoolean(3), IsHidden = reader.GetBoolean(4) }); } } } } return lstResult.ToArray(); }
internal ACRole[] ListRoles(RoleListingOptions pListingOptions) { return _dbManager.Roles.ListRoles(pListingOptions); }
public abstract ACRole[] ListRoles(RoleListingOptions pListingOptions);
internal ACRole[] ListRoles(RoleListingOptions pListingOptions) { return(_dbManager.Roles.ListRoles(pListingOptions)); }