private void RefreshListBox() { ProjectAddcheckedListBox.Items.Clear(); foreach (var Employee in EmployeesList.GetAllEmployees()) { ProjectAddcheckedListBox.Items.Add(Employee); } }
private void RefreshEmployeesListBox() { EmployeeMenucheckedListBox.Items.Clear(); foreach (var employee in EmployeesList.GetAllEmployees()) { EmployeeMenucheckedListBox.Items.Add(employee); } }
private void RefreshEmployeesListBox() { EmployeeStatsListView.Items.Clear(); AddEmployeeInBox(EmployeeStatsListView); foreach (var employee in EmployeesList.GetAllEmployees()) { var EmployeeProperties = new ListViewItem(employee.Name); AddEmployeeColors(EmployeeProperties, employee); AddEmployeeProperties(EmployeeProperties, employee); AddEmployeeProjects(EmployeeProperties, employee); EmployeeStatsListView.Items.Add(EmployeeProperties); } }
private void RefreshEmployeeInfo() { EmployeeListslistView.Items.Clear(); EmployeeListslistView.Columns.Add("Ime:", -1, HorizontalAlignment.Left); EmployeeListslistView.Columns.Add("Prezime:", -1, HorizontalAlignment.Left); EmployeeListslistView.Columns.Add("Datum rođenja:", -1, HorizontalAlignment.Left); EmployeeListslistView.Columns.Add("OIB:", -1, HorizontalAlignment.Left); EmployeeListslistView.Columns.Add("Pozicija:", -1, HorizontalAlignment.Left); EmployeeListslistView.Columns.Add("Radni sati(ovaj tjedan);", -1, HorizontalAlignment.Left); EmployeeListslistView.Columns.Add("Zavrsenih projekata:", -1, HorizontalAlignment.Left); EmployeeListslistView.Columns.Add("Trenutno aktivnih projekata:", -1, HorizontalAlignment.Left); EmployeeListslistView.Columns.Add("Nadolazeci projekti:", -1, HorizontalAlignment.Left); foreach (var Employee in EmployeesList.GetAllEmployees()) { var EmployeeProperty = new ListViewItem(Employee.Name); if (EmployeesOnProject.EmployeeThisWeeksWorkHours(Employee.OIB) > 40) { EmployeeProperty.BackColor = Color.DarkSlateGray; //stavi novu } else if (EmployeesOnProject.EmployeeThisWeeksWorkHours(Employee.OIB) < 30) { EmployeeProperty.BackColor = Color.Goldenrod; } else { EmployeeProperty.BackColor = Color.Aquamarine; } EmployeeProperty.SubItems.Add(Employee.Surname); EmployeeProperty.SubItems.Add($"{Employee.BirthDay:d}"); EmployeeProperty.SubItems.Add(Employee.OIB); EmployeeProperty.SubItems.Add(Employee.Rank.ToString()); EmployeeProperty.SubItems.Add(EmployeesOnProject.EmployeeThisWeeksWorkHours(Employee.OIB).ToString()); var FinishedProjects = 0; var ActiveProjects = 0; var FutureProjects = 0; foreach (var Project in EmployeesOnProject.GetProjectsByEmployee(Employee.OIB)) { if (Project.Finished()) { FinishedProjects++; } if (Project.Started() && !Project.Finished()) { ActiveProjects++; } if (Project.Started()) { FutureProjects++; } } EmployeeProperty.SubItems.Add(FinishedProjects.ToString()); EmployeeProperty.SubItems.Add(ActiveProjects.ToString()); EmployeeProperty.SubItems.Add(FutureProjects.ToString()); EmployeeListslistView.Items.Add(EmployeeProperty); } }