Esempio n. 1
0
        public FrmAddProyect()
        {
            InitializeComponent();

            var logCompany = new Logic.Company();

            companies = logCompany.GetAllCompanies();

            WireUp();
        }
Esempio n. 2
0
        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);
        }