private void BuildNamesList(string type) { NameList.Items.Clear(); if (type == "staff") { StaffList stlist1 = new StaffList(); stlist1.LoadList(DateTime.Now, true); foreach (SimpleStaff s in stlist1.m_stafflist) { ListItem l = new ListItem(s.m_PersonGivenName + " " + s.m_PersonSurname + "-" + s.m_StaffCode, s.m_StaffId.ToString()); NameList.Items.Add(l); } Label_Year.Text = "Type to search on name or code."; TextBox_mask.Visible = true; Display_List.Items.FindByValue("Details").Enabled = true; Display_List.Items.FindByValue("Incidents Authored by").Enabled = true; } if (type == "room") { RoomList rmlist1 = new RoomList(); rmlist1.LoadList(); foreach (SimpleRoom r in rmlist1.m_roomlist) { ListItem l = new ListItem(r.m_roomcode, r.m_RoomID.ToString()); NameList.Items.Add(l); } Label_Year.Text = "Rooms"; RadioButtonList_StaffType.Visible = false; } if (type == "Currentstaff") { StaffList stlist1 = new StaffList(); stlist1.LoadList(DateTime.Now, false); foreach (SimpleStaff s in stlist1.m_stafflist) { ListItem l = new ListItem(s.m_PersonGivenName + " " + s.m_PersonSurname + "-" + s.m_StaffCode, s.m_StaffId.ToString()); NameList.Items.Add(l); } Label_Year.Text = "Type to search on name or code."; TextBox_mask.Visible = true; Display_List.Items.FindByValue("Details").Enabled = true; Display_List.Items.FindByValue("Incidents Authored by").Enabled = true; } if (type == "Allstaff") { StaffList stlist1 = new StaffList(); stlist1.LoadFullList(); foreach (SimpleStaff s in stlist1.m_stafflist) { ListItem l = new ListItem(s.m_PersonGivenName + " " + s.m_PersonSurname + "-" + s.m_StaffCode, s.m_StaffId.ToString()); NameList.Items.Add(l); } Label_Year.Text = "Type to search on name or code."; TextBox_mask.Visible = true; Display_List.Items.FindByValue("Details").Enabled = true; Display_List.Items.FindByValue("Incidents Authored by").Enabled = true; } }