public static string GetGroupLink(int GroupID) { string GroupName = ""; using (IDataReader reader = UserReport.GetGroup(GroupID)) { if (reader.Read()) { GroupName = (string)reader["GroupName"]; } } return(GetGroupLink(GroupID, GroupName)); }
private void BindGroupStat(int iSGroupId, DateTime StartDate, DateTime EndDate) { using (IDataReader reader = UserReport.GetSecGroupStats(iSGroupId, StartDate, EndDate)) { if (reader.Read()) { int ActAcc = (int)reader["ActiveAccounts"]; int InActAcc = (int)reader["InactiveAccounts"]; lblActiveAccounts.Text = ActAcc.ToString(); lblDeActiveAccounts.Text = InActAcc.ToString(); lblNumberAccounts.Text = (ActAcc + InActAcc).ToString(); lblCalendarEntries.Text = reader["NewEventsCount"].ToString(); lblProjectsCreated.Text = reader["NewProjectsCount"].ToString(); lblIssuesCreated.Text = reader["NewIncidentsCount"].ToString(); lblTasksCreated.Text = reader["NewTasksCount"].ToString(); lblToDoCreated.Text = reader["NewToDosCount"].ToString(); lblIssuesReopen.Text = reader["ReOpenIncidentsCount"].ToString(); } } using (IDataReader reader = UserReport.GetGroup(iSGroupId)) { if (reader.Read()) { lblGroupName.Text = CommonHelper.GetResFileString(reader["GroupName"].ToString()); } } if (ddPeriod.Value != "0") { _header.Filter = LocRM.GetString("tPeriod") + ":<br/> " + StartDate.ToShortDateString() + " - " + EndDate.ToShortDateString(); } else { _header.Filter = ""; } if (ddPeriod.Value != "0") { lblInterval.Text = StartDate.ToShortDateString() + " - " + EndDate.ToShortDateString(); } else { lblInterval.Text = ""; } }
private void ProcessGroup2(int iGroup, TreeViewNode nodeParent) { TreeViewNode nodeGroup; nodeGroup = new TreeViewNode(); using (IDataReader reader = UserReport.GetGroup(iGroup)) { if (reader.Read()) { nodeGroup.Text = CommonHelper.GetResFileString(reader["GroupName"].ToString()); /*CommonHelper.GetGroupLinkUL(iGroup, reader["GroupName"].ToString())*/ nodeGroup.ImageUrl = Page.ResolveUrl("~/Layouts/Images/icons/regular.gif"); nodeGroup.Value = "Group"; nodeGroup.NavigateUrl = String.Format("GroupAndUserStat.aspx?SGroupID={0}&UserID=0", reader["GroupId"].ToString()); } } // Expanding if (aGroupPath.Contains(iGroup)) { nodeGroup.Expanded = true; } if (nodeParent == null) { GUTree.Nodes.Add(nodeGroup); } else { nodeParent.Nodes.Add(nodeGroup); } ArrayList children = new ArrayList(); using (IDataReader rdr = UserReport.GetListChildGroups(iGroup)) { while (rdr.Read()) { children.Add((int)rdr["GroupId"]); } } foreach (object obj in children) { ProcessGroup2((int)obj, nodeGroup); } DataTable dt = new DataTable(); dt.Columns.Add(new DataColumn("UserId", typeof(int))); dt.Columns.Add(new DataColumn("UserName", typeof(string))); dt.Columns.Add(new DataColumn("sortUserName", typeof(string))); DataRow dr; using (IDataReader rdr = UserReport.GetListActiveUsersInGroup(iGroup)) { while (rdr.Read()) { dr = dt.NewRow(); int iUserId = (int)rdr["UserId"]; dr["UserId"] = iUserId; using (IDataReader reader = UserReport.GetUserInfo(iUserId, false)) { if (reader.Read()) { dr["UserName"] = /*"<img src='../Layouts/Images/Status/status_online.gif ' border=0 align='absmiddle'> " +*/ (string)reader["FirstName"] + " " + (string)reader["LastName"]; dr["sortUserName"] = reader["FirstName"].ToString() + " " + reader["LastName"].ToString(); } } dt.Rows.Add(dr); } } DataView dv = dt.DefaultView; dv.Sort = "sortUserName"; foreach (DataRowView _dr in dv) { ProcessUser2(iGroup, _dr, nodeGroup); } }