public FrmAssignaments() { InitializeComponent(); var logStu = new Logic.Student(); students = logStu.GetAllStudents(); }
public List <Entities.Assignament> AddAssignament() { var logStu = new Logic.Student(); var logCom = new Logic.Company(); var assignaments = new List <Entities.Assignament>(); var students = logStu.GetAllStudents(); var companies = logCom.GetAllCompanies(); // TODO - arreglar cuando traigo las preferencias del foreach (var s in students) { foreach (var pr in s.Preferences) { foreach (var c in companies) { foreach (var pro in c.Proyects) { if (!s.Assigned && pr == pro.KindPro && pro.Slots != 0) { s.Assigned = true; pro.Slots--; assignaments.Add(new Entities.Assignament { Company = c, Proyect = pro, Student = s }); } } } } } return(assignaments); }