本文整理汇总了C#中UserService.GetUserCount方法的典型用法代码示例。如果您正苦于以下问题:C# UserService.GetUserCount方法的具体用法?C# UserService.GetUserCount怎么用?C# UserService.GetUserCount使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UserService
的用法示例。
在下文中一共展示了UserService.GetUserCount方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetUsersToBeVerified
public ActionResult GetUsersToBeVerified(int numOnePage, int pageIndex)
{
EnumUserApproveStatus approveStatus = EnumUserApproveStatus.UnApproved;
UserService userService = new UserService();
List<User> list = new List<User>();
list = userService.FindUsersByApproveStatus(approveStatus, numOnePage, pageIndex);
UserViewModel uvm;
List<UserViewModel> uvmlist = new List<UserViewModel>();
for (int i = 0; i < list.Count; i++ )
{
uvm = new UserViewModel();
uvm.Id = list[i].Id;
uvm.NickName = list[i].NickName;
uvm.PersonalDescription = list[i].PersonalDescription;
uvm.RegisterName = list[i].RegisterName;
uvm.RealName = list[i].RealName;
uvm.Gender = list[i].Gender;
uvmlist.Add(uvm);
}
string result = JsonConvert.SerializeObject(uvmlist);//到这里获取当前所有待审核的用户并序列化
//以下获取所有待审核用户的总数
UserService userService2 = new UserService();
int n = userService2.GetUserCount(EnumUserApproveStatus.UnApproved);
string numberS = n.ToString();
result = result + "ContentAndCount" + numberS;
return Content(result);
}
示例2: GetMembers
//无参数传入,返回当前所有会员的序列化字符串和当前会员总数
public ActionResult GetMembers(int numOnePage, int pageIndex)
{
UserService userservice = new UserService();
List<User> list = new List<User>();
list = userservice.FindUsersByApproveStatus(EnumUserApproveStatus.Approved, numOnePage, pageIndex);
//因为需要返回的用户属性信息只是一部分,所以要新建一个类型来保存User的部分属性即可
List<MemberViewModel> memberList = new List<MemberViewModel>();
for (int i = 0; i < list.Count; i++)
{
if ((list[i].AuthorityCategory == EnumUserCategory.Superman && list[i].RealName != "雷磊") || (list[i].AuthorityCategory != EnumUserCategory.Superman) )
{
MemberViewModel member = new MemberViewModel(list[i]);
member.RealName = list[i].RealName;
member.AuthorityCategory = list[i].AuthorityCategory;
//member.ContentGroup = list[i].ContentGroup;
member.Id = list[i].Id;
memberList.Add(member);
}
}
string result = JsonConvert.SerializeObject(memberList);
//以下获取所有会员的总个数
UserService userservice1 = new UserService();
int number = userservice1.GetUserCount(EnumUserApproveStatus.Approved);
result = result + "ContentAndCount" + number;
return Content(result);
}