コード例 #1
0
        // on load, fill the listboxes and labels with the first employee in the list
        private void AdminView_Load(object sender, EventArgs e)
        {
            qualityRanking    = new QualityRanking();
            ahtRanking        = new AhtRanking();
            adherenceRanking  = new AdherenceRanking();
            knowledgeRanking  = new KnowledgeRanking();
            totalScoreRanking = new TotalScoreRanking();

            // add employees to each ranking object
            foreach (Employee employee in employeeList)
            {
                EmployeeListBox.Items.Add(employee.getName());
                qualityRanking.addEmployee(employee);
                ahtRanking.addEmployee(employee);
                adherenceRanking.addEmployee(employee);
                knowledgeRanking.addEmployee(employee);
                totalScoreRanking.addEmployee(employee);
            }

            // the next foreach loops add to the listboxes based on the ranking objects
            foreach (Employee employee in qualityRanking.getRanks())
            {
                QualityListBox.Items.Add(employee.getName() + "   " + employee.getQuality() + "%");
            }

            foreach (Employee employee in ahtRanking.getRanks())
            {
                AhtListBox.Items.Add(employee.getName() + "   " + employee.getAht() + " seconds");
            }

            foreach (Employee employee in adherenceRanking.getRanks())
            {
                AdherenceListBox.Items.Add(employee.getName() + "   " + employee.getAdherence() + "%");
            }

            foreach (Employee employee in knowledgeRanking.getRanks())
            {
                KnowledgeListBox.Items.Add(employee.getName() + "   " + employee.getKnowledge() + "%");
            }

            foreach (Employee employee in totalScoreRanking.getRanks())
            {
                TotalScoreListBox.Items.Add(employee.getName() + "   " + employee.getTotalScore());
            }

            //set first employee to be the selected one
            EmployeeListBox.SetSelected(0, true);
        }
コード例 #2
0
ファイル: AdminView.cs プロジェクト: Mayme123/GrangeScoreCard
        // on load, fill the listboxes and labels with the first employee in the list
        private void AdminView_Load(object sender, EventArgs e)
        {
            qualityRanking = new QualityRanking();
            ahtRanking = new AhtRanking();
            adherenceRanking = new AdherenceRanking();
            knowledgeRanking = new KnowledgeRanking();
            totalScoreRanking = new TotalScoreRanking();

            // add employees to each ranking object
            foreach(Employee employee in employeeList)
            {
                EmployeeListBox.Items.Add(employee.getName());
                qualityRanking.addEmployee(employee);
                ahtRanking.addEmployee(employee);
                adherenceRanking.addEmployee(employee);
                knowledgeRanking.addEmployee(employee);
                totalScoreRanking.addEmployee(employee);
            }

            // the next foreach loops add to the listboxes based on the ranking objects
            foreach(Employee employee in qualityRanking.getRanks())
            {
                QualityListBox.Items.Add(employee.getName() + "   " + employee.getQuality() + "%");
            }

            foreach (Employee employee in ahtRanking.getRanks())
            {
                AhtListBox.Items.Add(employee.getName() + "   " + employee.getAht() + " seconds");
            }

            foreach (Employee employee in adherenceRanking.getRanks())
            {
                AdherenceListBox.Items.Add(employee.getName() + "   " + employee.getAdherence() + "%");
            }

            foreach (Employee employee in knowledgeRanking.getRanks())
            {
                KnowledgeListBox.Items.Add(employee.getName() + "   " + employee.getKnowledge() + "%");
            }

            foreach (Employee employee in totalScoreRanking.getRanks())
            {
                TotalScoreListBox.Items.Add(employee.getName() + "   " + employee.getTotalScore());
            }

            //set first employee to be the selected one
            EmployeeListBox.SetSelected(0,true);
        }
コード例 #3
0
        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());
            }
        }
コード例 #4
0
        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());

            }
        }