当前位置: 首页>>代码示例>>C#>>正文


C# UserService.FindAll方法代码示例

本文整理汇总了C#中UserService.FindAll方法的典型用法代码示例。如果您正苦于以下问题:C# UserService.FindAll方法的具体用法?C# UserService.FindAll怎么用?C# UserService.FindAll使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在UserService的用法示例。


在下文中一共展示了UserService.FindAll方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: SearchAllUser

        public ActionResult SearchAllUser(string key)
        {
            string newkey = System.Web.HttpUtility.UrlDecode(key).ToLower().Trim();
            R2.RRDL.BusinessModel.UserService us = new UserService();
            List<User> lists = new List<User>();
            lists = us.FindAll();
            
            List<UserViewModel> list = new List<UserViewModel>();
            for (int i = 0; i < lists.Count; i++)
            {
                UserViewModel uvm = new UserViewModel();
                uvm.Id = lists[i].Id;
                uvm.ApproveStatus = lists[i].ApproveStatus;
                uvm.RealName = lists[i].RealName;
                uvm.RegisterName = lists[i].RegisterName;
                uvm.ReplyContent = lists[i].ReplyContent;
                uvm.NickName = lists[i].NickName;
                uvm.Gender = lists[i].Gender;
                uvm.AuthorityCategory = lists[i].AuthorityCategory;
                uvm.PersonalDescription = lists[i].PersonalDescription;

                if ((R2.RRDL.Models.EnumAriticleApproveStatus)uvm.ApproveStatus == R2.RRDL.Models.EnumAriticleApproveStatus.UnApproved && uvm.RealName.ToLower().Contains(newkey))
                {
                    list.Add(uvm);
                }
            }

            string result = JsonConvert.SerializeObject(list);
            result = result + "ContentAndCount" + list.Count.ToString();
            return Content(result);
        }
开发者ID:hiyouth,项目名称:R2.RRDL,代码行数:31,代码来源:SearchUsersController.cs

示例2: GetAllMembers

 /// <summary>
 /// 后台返回:所有成员名称和成员ID
 /// </summary>
 /// <returns></returns>
 public JsonResult GetAllMembers()
 {
     RRDLEntities rr = new RRDLEntities();
     UserService us = new UserService(rr);
     rr.Configuration.ProxyCreationEnabled = false;
     List<User> list  = us.FindAll();
     return Json(list);
 }
开发者ID:hiyouth,项目名称:R2.RRDL,代码行数:12,代码来源:WMTaskController.cs

示例3: SearchPorformUser

        public ActionResult SearchPorformUser(string key)
        {
            int groupId = 0;
            string newkey = System.Web.HttpUtility.UrlDecode(key).ToLower().Trim();
            R2.RRDL.BusinessModel.UserService us = new UserService();
            UserGroupService ugs = new UserGroupService();

            List<User> lists = new List<User>();
            List<UserGroup> listsgroup = new List<UserGroup>();
            listsgroup = ugs.FindAll();
            lists = us.FindAll();

            List<UserViewModel> listuvm = new List<UserViewModel>();
            for (int i = 0; i < listsgroup.Count; i++)
            {
                UserGroup ug = new UserGroup();
                ug = listsgroup[i];
                if (ug.Title.ToLower().Contains(newkey))
                {
                    groupId = ug.Id;
                    for (int j = 0; j < lists.Count; j++)
                    {
                        UserViewModel uvm = new UserViewModel();
                        uvm.Id = lists[j].Id;
                        uvm.ApproveStatus = lists[j].ApproveStatus;
                        uvm.RealName = lists[j].RealName;
                        uvm.RegisterName = lists[j].RegisterName;
                        uvm.ReplyContent = lists[j].ReplyContent;
                        uvm.NickName = lists[j].NickName;
                        uvm.Gender = lists[j].Gender;
                        uvm.AuthorityCategory = lists[j].AuthorityCategory;
                        uvm.PersonalDescription = lists[j].PersonalDescription;

                        if ((R2.RRDL.Models.EnumAriticleApproveStatus)uvm.ApproveStatus == R2.RRDL.Models.EnumAriticleApproveStatus.Approved && lists[j].ContentGroupId == groupId)
                        {
                            if (!isExtence(listuvm, uvm))
                            {
                                listuvm.Add(uvm);
                            }
                        }
                    }
                }
            }
            if (listuvm.Count <= 0)
            {
                for (int j = 0; j < lists.Count; j++)
                {
                    UserViewModel uvm1 = new UserViewModel();
                    uvm1.Id = lists[j].Id;
                    uvm1.ApproveStatus = lists[j].ApproveStatus;
                    uvm1.RealName = lists[j].RealName;
                    uvm1.RegisterName = lists[j].RegisterName;
                    uvm1.ReplyContent = lists[j].ReplyContent;
                    uvm1.NickName = lists[j].NickName;
                    uvm1.Gender = lists[j].Gender;
                    uvm1.AuthorityCategory = lists[j].AuthorityCategory;
                    uvm1.PersonalDescription = lists[j].PersonalDescription;

                    if ((R2.RRDL.Models.EnumAriticleApproveStatus)uvm1.ApproveStatus == R2.RRDL.Models.EnumAriticleApproveStatus.Approved && uvm1.RealName.Contains(newkey))
                    {
                        if (!isExtence(listuvm, uvm1))
                        {
                            listuvm.Add(uvm1);
                        }
                    }
                }
            }
            if (newkey.ToLower().Contains("管理员") || newkey.ToLower().Contains("管理") || newkey.ToLower().Contains("管") || newkey.ToLower().Contains("理"))
            {
                for (int k = 0; k < lists.Count; k++)
                {
                    UserViewModel uvm2 = new UserViewModel();
                    uvm2.Id = lists[k].Id;
                    uvm2.ApproveStatus = lists[k].ApproveStatus;
                    uvm2.RealName = lists[k].RealName;
                    uvm2.RegisterName = lists[k].RegisterName;
                    uvm2.ReplyContent = lists[k].ReplyContent;
                    uvm2.NickName = lists[k].NickName;
                    uvm2.Gender = lists[k].Gender;
                    uvm2.AuthorityCategory = lists[k].AuthorityCategory;
                    uvm2.PersonalDescription = lists[k].PersonalDescription;

                    if ((R2.RRDL.Models.EnumAriticleApproveStatus)uvm2.ApproveStatus == R2.RRDL.Models.EnumAriticleApproveStatus.Approved && uvm2.AuthorityCategory == R2.RRDL.Models.EnumUserCategory.Administrator)
                    {
                        if (!isExtence(listuvm, uvm2))
                        {
                            listuvm.Add(uvm2);
                        }
                    }
                }
            }

            string result = JsonConvert.SerializeObject(listuvm);
            result = result + "ContentAndCount" + listuvm.Count.ToString();
            return Content(result);
        }
开发者ID:hiyouth,项目名称:R2.RRDL,代码行数:96,代码来源:SearchUsersController.cs


注:本文中的UserService.FindAll方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。