public static Departement GiveCollegeData() { Departement collegeLeNil = new Departement { Name = "College Charles de Gaulles" , Parent = null }; //Ajout Principaux sous-departements; Departement classrooms = new Departement { Name = "Les Salle de classes" }; for (int i = 0; i < 5; i++) { Departement classe = new Departement { Name = "CM " + i, }; classe.AddELeves(getEleves(20, classe.Name)); classrooms.AddDepartement(classe); } collegeLeNil.AddDepartement(classrooms); return(collegeLeNil); }
public void AddDepartement(Departement _departement) { if (_departement != null) { _departement.Parent = this; subDepartements.Add(_departement); if (_departement.Eleves != null) { eleves.AddRange(_departement.Eleves); } } }
public Departement GetDepartementFromDatabase() { imsdbDataSet.departmentRow row = departments.Where(x => x.masterid == 0).First(); Departement rootDept = null; if (row != null) { rootDept = new Departement { Name = row.deptname }; } foreach (imsdbDataSet.departmentRow dptRow in departments.Rows) { } return(rootDept); }