public List <User> GetOrganizationUser(string orgID)
        {
            List <string> lstUserID = new RoleUserService().GenericService.GetAll(p => p.OrganizationID == orgID).Select(p => p.UserID).ToList();
            var           res       = userSetvice.GenericService.GetAll(p => lstUserID.Contains(p.ID)).OrderBy(p => p.Account);

            return(res.ToList());
        }
        public List <User> GetOrganizationUser(string orgID, int pageSize, int PageCurrent, out int PageCount)
        {
            List <string> lstUserID = new RoleUserService().GenericService.GetAll(p => p.OrganizationID == orgID).Select(p => p.UserID).ToList();
            var           res       = userSetvice.GenericService.GetAll(p => lstUserID.Contains(p.ID)).OrderBy(p => p.Account);

            PageCount = res.Count();
            return(res.Skip((PageCurrent - 1) * pageSize).Take(pageSize).ToList());
        }
示例#3
0
        void BindDropdownlist()
        {
            var curUserAccount = DZAFCPortal.Utility.UserInfo.Account;

            var curUser = new UserService().GenericService.FirstOrDefault(u => u.Account == curUserAccount);

            var roleIds = new RoleUserService().GenericService.GetAll(r => r.UserID == curUser.ID).Select(r => r.RoleID).ToList();

            var superAdminId = new RoleService().GenericService.FirstOrDefault(r => r.Code == "cjgly").ID;
            var sysAdminId   = new RoleService().GenericService.FirstOrDefault(r => r.Code == "sysadmin").ID;

            var types = typeService.GenericService.GetAll().OrderBy(t => t.Name).ToList();

            if (!roleIds.Contains(superAdminId) && !roleIds.Contains(sysAdminId))
            {
                for (int i = types.Count - 1; i >= 0; i--)
                {
                    var item = types[i];
                    var rIds = item.AssociatedRoles.Split(';').ToList();
                    if (rIds.Intersect(roleIds).Count() == 0)
                    {
                        types.Remove(item);
                    }
                }
            }


            Dictionary <string, string> d = new Dictionary <string, string>();

            if (types.Count == 0)
            {
                Response.Write("当前账户无权限访问任何字典类别,请联系管理员处理。");
                return;
            }

            types.ForEach(t =>
            {
                d.Add(t.ID, t.Name);
            });

            ddlSearchDicType.DataValueField = "key";
            ddlSearchDicType.DataTextField  = "value";
            ddlSearchDicType.DataSource     = d;
            ddlSearchDicType.DataBind();
        }