private void GrangeForm_Load(object sender, EventArgs e) { // initiate the parser to read from the current user profile directory excelParser = new ExcelParser(System.IO.Path.Combine(System.Environment.GetEnvironmentVariable("USERPROFILE"), "Metrics.xlsx")); // read the spreadsheet data into the employee list employeeList = excelParser.getEmployeeList(); totalScoreRanking = new TotalScoreRanking(); // add the employees from the list into the ranking object foreach (Employee employee in employeeList) { totalScoreRanking.addEmployee(employee); } // add the ranked employees to the listbox foreach (Employee employee in totalScoreRanking.getRanks()) { RanksListBox.Items.Add((totalScoreRanking.getRanks().IndexOf(employee) + 1).ToString() + " " + employee.getName()); } }
private void GrangeForm_Load(object sender, EventArgs e) { // initiate the parser to read from the current user profile directory excelParser = new ExcelParser(System.IO.Path.Combine(System.Environment.GetEnvironmentVariable("USERPROFILE"), "Metrics.xlsx")); // read the spreadsheet data into the employee list employeeList = excelParser.getEmployeeList(); totalScoreRanking = new TotalScoreRanking(); // add the employees from the list into the ranking object foreach(Employee employee in employeeList) { totalScoreRanking.addEmployee(employee); } // add the ranked employees to the listbox foreach(Employee employee in totalScoreRanking.getRanks()) { RanksListBox.Items.Add((totalScoreRanking.getRanks().IndexOf(employee) + 1).ToString() + " " +employee.getName()); } }