private void SetupAdminPage() { RoleSelect.DataSource = RoleUtil.GetRoles(); RoleSelect.DataTextField = "roleName"; RoleSelect.DataValueField = "roleId"; RoleSelect.DataBind(); RoleSelect.SelectedIndex = 0; UserRole.DataSource = RoleUtil.GetRoles(); UserRole.DataTextField = "roleName"; UserRole.DataValueField = "roleId"; UserRole.DataBind(); CompanySelect.DataSource = CompanyUtil.GetCompanies(); CompanySelect.DataTextField = "companyName"; CompanySelect.DataValueField = "companyId"; CompanySelect.DataBind(); CompanySelect.SelectedIndex = 0; LockedAccountSelect.DataSource = UserUtil.GetLockedUsers(); LockedAccountSelect.DataTextField = "Identity"; LockedAccountSelect.DataValueField = "UserId"; LockedAccountSelect.DataBind(); LockedAccountSelect.SelectedIndex = 0; MakeUserTable(); MakeCompanyTable(); }
protected void MakeCompanyTable() { List <Company> companies = CompanyUtil.GetCompanies(); CompanyTable.InnerHtml = ""; var companyTable = ""; companyTable += "<table class=\"ui orange table\"><thead><tr><th>Company Name</th></tr></thead>"; companyTable += "<tbody>"; foreach (Company company in companies) { if (company.CompanyId != -1 && company.CompanyId != -2) { companyTable += "<tr><td>" + company.CompanyName + "</td></tr>"; } } companyTable += "</tbody></table>"; CompanyTable.InnerHtml += companyTable; }