Exemplo n.º 1
0
        private void Department_Load(object sender, EventArgs e)
        {
            departments = dept.GetDepartments();
            dataGridView1.DataSource = departments;
            dataGridView1.Refresh();

            //load departmetns
            foreach (DAL.Model.Department item in departments)
            {
                comboBox1.Items.Add(item.Name);
                comboBox2.Items.Add(item.Name);
            }
        }
Exemplo n.º 2
0
        private void Employees_Load(object sender, EventArgs e)
        {
            // load employees
            dataGridView1.DataSource = emp.GetEmployees();


            //load departmetns
            departments = dept.GetDepartments();

            foreach (DAL.Model.Department item in departments)
            {
                cbbDept.Items.Add(item.Name);
                deptId = item.Id;
            }

            // load employees in edit
            foreach (Employee item in emp.GetEmployees())
            {
                cbbEditDSelectEmp.Items.Add(item.FirstName + " " + item.LastName);
                cbbDeleteEmp.Items.Add(item.FirstName + " " + item.LastName);
                editEmpId = item.Id;
            }
        }