本文整理汇总了C#中UserGroup.GetUserGroup方法的典型用法代码示例。如果您正苦于以下问题:C# UserGroup.GetUserGroup方法的具体用法?C# UserGroup.GetUserGroup怎么用?C# UserGroup.GetUserGroup使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UserGroup
的用法示例。
在下文中一共展示了UserGroup.GetUserGroup方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: BindUser
private void BindUser()
{
if (Application["online"] == null)
{
bl_top.InnerHtml = "IM";
}
else
{
hidSender.Value = StringHelper.DesDecrypt(Request.Params["login"]);
Users users = new Users();
DataTable userTree = users.GetUserTree();
UserGroup userGroup = new UserGroup();
DataTable groupList = userGroup.GetUserGroup(hidSender.Value);
DataRow[] userRow = userTree.Select(
string.Format("id = '{0}'", hidSender.Value)
);
if (userRow.Length == 0)
{
hidCnSender.Attributes["outter"] = "1";
changepassword.Attributes["outter"] = "1";
hidCnSender.Value = StringHelper.DesDecrypt(Request.Params["userName"]);
hidCnSender.Attributes["lname"] = StringHelper.DesDecrypt(Request.Params["loginName"]);
}
else
{
if (userRow[0]["theme"].ToString().Length > 0)
{
theme = userRow[0]["theme"].ToString();
}
hidCnSender.Value = userRow[0]["username"].ToString();
hidrevertMessage.Value = userRow[0]["revertMessage"].ToString();
hidCnSender.Attributes["lname"] = userRow[0]["loginname"].ToString();
hidCnSender.Attributes["outter"] = userRow[0]["isoutter"].ToString();
changepassword.Attributes["outter"] = userRow[0]["isoutter"].ToString();
}
GroupRelation groupRelation = new GroupRelation();
DataTable relationList = groupRelation.GetGroupRelation(hidSender.Value);
userTreeBuilder = new StringBuilder();
OnLineUser onLineUser = new OnLineUser();
foreach (DataRow group in groupList.Rows)
{
bool flag = false;
if (group["groupname"].ToString().Equals(Profile.unknowGroup))
{
flag = true;
hidSender.Attributes["unknow"] = group["id"].ToString();
}
CreateGroupTop(group["id"].ToString(), group["groupname"].ToString(), true, flag);
DataRow[] relationshiperList = relationList.Select(
string.Format("usergroup = '{0}'", group["id"])
);
userTreeBuilder.AppendFormat(
"<ul class=\"group\" id=\"ul{0}Group\" groupid=\"{0}\" style=\"display : none;\">",
group["id"]
);
foreach (DataRow relationshiper in relationshiperList)
{
DataRow[] user = userTree.Select(
string.Format("id = '{0}'", relationshiper["relationshiper"]),
"username"
);
if (user.Length == 1)
{
int userStatus = onLineUser.GetUserStatus(user[0]["id"].ToString(), Application["online"]);
CreateBuddyList(
user[0]["id"].ToString(),
user[0]["username"].ToString(),
user[0]["scratch"].ToString(),
user[0]["headImg"].ToString(),
userStatus,
true
);
}
}
userTreeBuilder.Append("</ul>");
}
//����Ԥ�����Լ�����
CreateGroupTop("owner", Profile.ownerGroup, true, true);
userTreeBuilder.Append("<ul class=\"group\" id=\"ulownerGroup\" groupid=\"owner\" style=\"display : none;\">");
int status = onLineUser.GetUserStatus(hidSender.Value, Application["online"]);
statusSettings.Attributes["userstatus"] = status.ToString();
//.........这里部分代码省略.........
示例2: GenerateUserGroups
/// <summary>
/// �����������б�div
/// </summary>
public void GenerateUserGroups()
{
string userId = Request.Params["userId"];
UserGroup userGroup = new UserGroup();
DataTable groupList = userGroup.GetUserGroup(userId.Trim());
StringBuilder groupTreeBuilder = new StringBuilder("<div class=\"itemList\" id=\"divUserGroups\" style=\"padding:1px;width:110px;\">");
for (int i = 0; i < groupList.Rows.Count; i++)
{
DataRow group = groupList.Rows[i];
if (i == 0)
{
groupTreeBuilder.AppendFormat("<a href=\"#\" id='aDefaultUserGroup' groupId='{1}' onmousedown=\"Effect.setUserGroup('{0}','{1}'); return false;\" style=\"font-size: 12px;\">{0}</a>"
, group["groupName"], group["id"]);
}
else
{
groupTreeBuilder.AppendFormat("<a href=\"#\" groupId='{1}' onmousedown=\"Effect.setUserGroup('{0}','{1}'); return false;\" style=\"font-size: 12px;\">{0}</a>"
, group["groupName"], group["id"]);
}
}
groupTreeBuilder.Append("</div>");
WriteMessage(groupTreeBuilder.ToString());
}