protected void LoadEmployees() { Database data = new Database(); grdEmployees.DataSource = data.GetEmployees(Convert.ToInt32(lstEmployeeType.SelectedValue)); grdEmployees.DataBind(); }
private void LoadMenu(DropDownList list) { Database data = new Database(); switch (list.ID) { case "lstRegion": list.DataSource = data.Regions; break; case "lstArea": list.DataSource = data.Areas; break; case "lstLSO": list.DataSource = data.LSOs; break; case "lstManagers": list.DataSource = data.GetEmployees((int)Database.EmployeeType.SalesManager); break; case "lstEmployeeType": lstEmployeeType.DataSource = data.EmployeeTypes; list.DataBind(); return; } list.DataBind(); data.Close(); data.Dispose(); list.Items.Insert(0, new ListItem("Select...", "")); list.SelectedIndex = 0; }