实现随机抽签模板中的人员 
 
        public void sjs(DataSet set,int [] a)
        {
            textBox1.Text = "";
            if (s == null)
            {
                s = new DataTable();
                s.TableName = "table1";
                s.Columns.Add("序号");
                s.Columns.Add("姓名");
                s.Columns.Add("部门");
            }
            else
            {
                s.Rows.Clear();
            }
            for (int i = 0; i < a.Length;i  )
            {
                DataRow dw = s.NewRow();
                dw[0] =(i 1) "";
                dw[1] = set.Tables[0].Rows[a[i]]["姓名"].ToString();
                dw[2] = set.Tables[0].Rows[a[i]]["部门"].ToString();
                textBox1.Text = (i  1)  "  "  set.Tables[0].Rows[a[i]]["姓名"].ToString()  " 部门:"  set.Tables[0].Rows[a[i]]["部门"].ToString() "\r\n";
                s.Rows.Add(dw);
            }        

 
  
					
				
评论