|  //confirm selection to be included in stafflist
        protected void ConfirmBtn_Click(object sender, EventArgs e)
        {       
                int sel = 0;
                for (int i = 0; i < SearchLB.Items.Count; i++)
                {
                    if (SearchLB.Items[i].Selected == true)
                    {
                        sel++;
                        if (!ListBox1.Items.Contains(SearchLB.Items[i]))
                        {
                            SQL dbAdapter = new SQL();
                            dbAdapter.insertStafflist(SearchLB.Items[i].Text, (string)Session["userName"]);
                        }
                    }
                }
                if (sel == 0)
                {
                    MessageBox.Show("There is no selected staff to be added.", "Error!");
                }
                
                SearchTB.Text = string.Empty;
                SearchLB.Visible = false;
                //generate listbox items
                populateStafflist();        
        }
        //close popup
        protected void CancelBtn_Click(object sender, EventArgs e)
        {
            SearchTB.Text = string.Empty;
            SearchLB.Visible = false;
        }
 |