Exemple #1
0
        private void WriteEmployeesList()
        {
            StringBuilder htmlStr = new StringBuilder("");

            int numEmployees = db.CountEmployees();

            htmlStr.Append("<br>Total employees: <b>");
            htmlStr.Append(numEmployees.ToString());
            htmlStr.Append("</b><br><br>");

            EmployeeDetails[] employees = db.GetEmployees();
            foreach (EmployeeDetails emp in employees)
            {
                htmlStr.Append("<li>");
                htmlStr.Append(emp.EmployeeID);
                htmlStr.Append(" ");
                htmlStr.Append(emp.TitleOfCourtesy);
                htmlStr.Append(" <b>");
                htmlStr.Append(emp.FirstName);
                htmlStr.Append("</b>, ");
                htmlStr.Append(emp.LastName);
                htmlStr.Append("</li>");
            }
            htmlStr.Append("<br>");
            HtmlContent.Text += htmlStr.ToString();
        }