protected void Repeater1_DataBound(object sender, RepeaterItemEventArgs e) { Label lab1 = e.Item.FindControl("labDepart") as Label; if (lab1 != null) { U_UserNameBU user1 = new U_UserNameBU(); string[] arr1 = user1.GetAllPerson(lab1.Text); DataList datalist1 = e.Item.FindControl("DataListForPerson") as DataList; if (datalist1 != null) { datalist1.ItemDataBound += new DataListItemEventHandler(datalist1_ItemDataBound); datalist1.DataSource = arr1; datalist1.DataBind(); } datalist1.Dispose(); } }
//设置责任人 public static void SetZeRen(ListControl drop1, string depart, string blankValue) { drop1.Items.Clear(); U_UserNameBU user1 = new U_UserNameBU(); string[] arr = user1.GetAllPerson(depart); if (arr != null) { for (int i = 0; i < arr.Length; i++) { ListItem list1 = new ListItem(arr[i], arr[i]); drop1.Items.Add(list1); } } if (blankValue != null && blankValue != "") { ListItem list1 = new ListItem(blankValue, ""); drop1.Items.Insert(0, list1); } }