protected void LoadRoleDropDown() { using (SalesSystem.DataClassesSalesDataContext context = new DataClassesSalesDataContext()) { var role = (from rl in context.Roles select rl).ToList(); DropDownListRole.DataValueField = "RoleID"; DropDownListRole.DataTextField = "RoleDescription"; DropDownListRole.DataSource = role; DropDownListRole.DataBind(); } }
private void BindRoleList() { DropDownListRole.DataSource = EmployeeRole.GetAccountRoleListLimited(); DropDownListRole.DataTextField = "Description"; DropDownListRole.DataValueField = "Description"; DropDownListRole.DataBind(); if (DropDownListRole.Items.Count > 1) { DropDownListRole.Items.Insert(0, new ListItem("Please select", "0")); } string username = Page.User.Identity.Name.ToString(); if (username == "MatthewP" || username == "admin" || username == "AlidaP") { } else { DropDownListRole.Items.Remove("SUPPLIER"); } }