Exemplo n.º 1
0
        public async Task <List <MessageEntity> > GetLookList(SoulPage <MessageEntity> pagination, string keyword = "")
        {
            //反格式化显示只能用"等于",其他不支持
            Dictionary <string, Dictionary <string, string> > dic = new Dictionary <string, Dictionary <string, string> >();
            var setList = await itemsApp.GetItemList("MessageType");

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

            foreach (var item in setList)
            {
                messageTypeTemp.Add(item.F_ItemName, item.F_ItemCode);
            }
            dic.Add("F_MessageType", messageTypeTemp);
            pagination = ChangeSoulData(dic, pagination);
            //获取数据权限
            var query = repository.IQueryable().Where(a => a.F_EnabledMark == true);

            if (!string.IsNullOrEmpty(keyword))
            {
                //此处需修改
                query = query.Where(t => t.F_MessageInfo.Contains(keyword) || t.F_CreatorUserName.Contains(keyword));
            }
            query = GetDataPrivilege("u", "", query);
            return(await repository.OrderList(query, pagination));
        }
Exemplo n.º 2
0
        public async Task <List <RoleExtend> > GetLookList(SoulPage <RoleExtend> pagination, string keyword = "")
        {
            //反格式化显示只能用"等于",其他不支持
            Dictionary <string, Dictionary <string, string> > dic = new Dictionary <string, Dictionary <string, string> >();
            Dictionary <string, string> enabledTemp = new Dictionary <string, string>();

            enabledTemp.Add("有效", "1");
            enabledTemp.Add("无效", "0");
            dic.Add("F_EnabledMark", enabledTemp);
            var setList = await itemsApp.GetItemList("RoleType");

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

            foreach (var item in setList)
            {
                messageTypeTemp.Add(item.F_ItemName, item.F_ItemCode);
            }
            dic.Add("F_Type", messageTypeTemp);
            pagination = ChangeSoulData(dic, pagination);
            //获取数据权限
            var query = GetQuery();

            if (!string.IsNullOrEmpty(keyword))
            {
                query = query.Where(u => u.F_FullName.Contains(keyword) || u.F_EnCode.Contains(keyword));
            }
            query = GetDataPrivilege("u", "", query);
            return(await repository.OrderList(query, pagination));
        }