public EmployeesForm() : base(columns, false, true, false, true, false)
        {
            accountService = new AccountService();
            companyService = new CompanySystemService();
            FillTable(accountService.GetAllUsers());

            this.Text = "Employees";

            //pravljenje cbox-a samo za ovu formu
            var cBoxDepartments = new ComboBox();

            cBoxDepartments.Location      = new Point(800, 14);
            cBoxDepartments.DropDownStyle = ComboBoxStyle.DropDownList;

            var listOfDepartmentNames = new List <string>();

            foreach (var department in companyService.GetAllDepartments())
            {
                if (department.IsDepartmentActive)
                {
                    listOfDepartmentNames.Add(department.Name);
                }
            }

            listOfDepartmentNames.Insert(0, "All");

            cBoxDepartments.DataSource = listOfDepartmentNames;

            cBoxDepartments.SelectionChangeCommitted += CBoxDepartments_SelectionChangeCommitted;

            this.Controls.Add(cBoxDepartments);
        }
Exemple #2
0
 private void SetDepartments()
 {
     foreach (Department department in companyService.GetAllDepartments())
     {
         if (department.ToString() == "Undefined")
         {
             department_combobx.Items.Add(department);
         }
     }
 }
Exemple #3
0
 private void SetDepartments()
 {
     foreach (Department department in companyService.GetAllDepartments())
     {
         if (department.IsDepartmentActive == true && !department.Name.Equals("Undefined"))
         {
             cmbbxDepartments.Items.Add(department);
         }
     }
 }
Exemple #4
0
        private void SetDepartments(User user)
        {
            foreach (Department department in companyService.GetAllDepartments())
            {
                if (department.IsDepartmentActive == true)
                {
                    cmbbxDepartment.Items.Add(department);

                    if (user.Department.Id == department.Id)
                    {
                        cmbbxDepartment.SelectedItem = department;
                    }
                }
            }
        }
        public DepartmentsForm() : base(columns, true, true, true, false, false)
        {
            FillTable(compService.GetAllDepartments());

            this.Text = "Departments";
        }