本文整理汇总了C#中UserService.FindUsersByGroupId方法的典型用法代码示例。如果您正苦于以下问题:C# UserService.FindUsersByGroupId方法的具体用法?C# UserService.FindUsersByGroupId怎么用?C# UserService.FindUsersByGroupId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UserService
的用法示例。
在下文中一共展示了UserService.FindUsersByGroupId方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GeTeamRank
public string GeTeamRank()
{
UserGroupService usergSerivice = new UserGroupService();
UserService userService = new UserService();
List<UserGroup> usergList = usergSerivice.FindAll();
List<RankListTeam> rankListTeam = new List<RankListTeam>();
List<User> userList = new List<User>();
for (int i = 2; i < usergList.Count; i++) {
userList = userService.FindUsersByGroupId(usergList[i].Id);
int count = 0;
for (int j = 0; j < userList.Count; j++) {
//获取每个用户的发表的知识数量,并求和
AriticleService ariticleService = new AriticleService();
int n = ariticleService.GetAriticleCount(userList[j].Id);
count += n;
}
RankListTeam rlt = new RankListTeam();
rlt.Title = usergList[i].Title;
rlt.AriticleCount = count;
rankListTeam.Add(rlt);
}
//对结果排序
var queryResults =
from n in rankListTeam
orderby n.AriticleCount descending
select n;
List<RankListTeam> rktList = new List<RankListTeam>();
foreach (var n in queryResults)
{
rktList.Add(n);
}
string result = JsonConvert.SerializeObject(rktList);
return result;
}
示例2: GetTaskByProjIdAndGroupId
/// <summary>
/// 传入项目ID 分组ID 得到此条件下的全部任务 列表
/// </summary>
/// <param name="projId"></param>
/// <param name="groupId"></param>
/// <returns></returns>
public ActionResult GetTaskByProjIdAndGroupId(int projId, int groupId)
{
RRWMEntities er = new RRWMEntities();
//获取这个groupID下的全部的用户ID
List<string> idString = new List<string>();
UserService us = new UserService();
List<User> userList = us.FindUsersByGroupId(groupId);
foreach (var u in userList)
{
idString.Add(u.Id);
}
//过滤结果
TaskService ts = new TaskService(er);
List<Task> list = ts.FindByProjectID(projId).ToList();
List<Task> resultList = new List<Task>();
foreach (var l in list)
{
if (idString.Contains(l.TaskerID) && l.TaskProcessStatus == EnumTaskProcessStatus.None)
{
resultList.Add(l);
}
}
List<ComplexTask> comList = ConvertToComplexTaskList(resultList);
return Json(comList);
}
示例3: GetAllMembersByGroupId
/// <summary>
///传入用户所属组,返回这个组内所有成员(实际上,RRDL的UserService里有)
/// </summary>
/// <param name="groupId"></param>
/// <returns></returns>
public JsonResult GetAllMembersByGroupId(int groupId)
{
UserService us = new UserService();
List<User> list = us.FindUsersByGroupId(groupId);
List<string> userNameList = new List<string>();
for (int i = 0; i < list.Count; i++)
{
userNameList.Add(list[i].RealName + "," + list[i].Id);
}
return Json(userNameList);
}