private void BindData() { Sections sectda = new Sections(Globals.CurrentIdentity); Section sect = sectda.GetInfo(GetSectionID()); User.UserList secs = sectda.GetMembers(sect.ID); lstSectionUsers.Items.Clear(); foreach (User user in secs) lstSectionUsers.Items.Add( new ListItem(user.FullName + " (" + user.UserName + ")", user.UserName)); User.UserList mems = new Courses(Globals.CurrentIdentity).GetMembers(sect.CourseID, null); lstAllUsers.Items.Clear(); foreach (User user in mems) lstAllUsers.Items.Add( new ListItem(user.FullName + " (" + user.UserName + ")", user.UserName)); lnkSecExpl.Attributes.Add("onClick", @"window.open('sectionexpl.aspx?CourseID=" + sect.CourseID + @"', '"+sect.CourseID+@"', 'width=430, height=530')"); }
private string HarvestSelectedUsers() { string userstr=""; Label lblType, lblID; Sections sectda = new Sections(Globals.CurrentIdentity); Users userda = new Users(Globals.CurrentIdentity); foreach (DataGridItem row in dgUsers.Items) { if ((row.FindControl("chkSelect") as CheckBox).Checked) { lblType = (Label) row.FindControl("lblType"); lblID = (Label) row.FindControl("lblID"); string sid = lblID.Text; if (lblType.Text == "S") { int id = Convert.ToInt32(sid); User.UserList users = sectda.GetMembers(id); foreach (User user in users) userstr += user.UserName + "|"; } else userstr += sid + "|"; } } return userstr; }
private string[] HarvestSelectedUsers(System.Web.UI.WebControls.DataGrid sgrid) { string userstr="", prinstr=""; Label lblType, lblID; Sections sectda = new Sections(Globals.CurrentIdentity); Users userda = new Users(Globals.CurrentIdentity); foreach (DataGridItem row in sgrid.Items) { if ((row.FindControl("chkSelect") as CheckBox).Checked) { lblType = (Label) row.FindControl("lblType"); lblID = (Label) row.FindControl("lblID"); string sid = lblID.Text; if (lblType.Text == "S") { int id = Convert.ToInt32(sid); User.UserList users = sectda.GetMembers(id); foreach (User user in users) { userstr += user.UserName + "|"; prinstr += user.PrincipalID.ToString() + " "; } } else { userstr += sid + "|"; User user = userda.GetInfo(sid, null); prinstr += user.PrincipalID.ToString() + " "; } } } string[] retarr = new string[2]; retarr[0] = userstr; retarr[1] = prinstr; return retarr; }