Ejemplo n.º 1
0
 public ActionResult <JsonResponses> GetPageList([FromQuery] PageModel page, [FromQuery] QueryBaseFrom query)
 {
     try
     {
         List <long> currentPlatformNos = this.GetCurrentUserPlatfromNos();
         query.InitQuery();
         string QueryNo  = "_" + query.queryNo;
         string keywords = query.keywords;
         Expression <Func <PsMenu, bool> > where = null;
         where = o => o.Name.Contains(keywords) && (o.TreeLevelNo.Contains(QueryNo) || o.MenuNo == query.queryNo) &&
                 currentPlatformNos.Contains(o.PlatformNo);
         page.setTotalCount(Convert.ToInt32(DataHandleManager.Instance().PsMenuHandle.Count(where)));//取记录数
         List <PsMenu>         list     = DataHandleManager.Instance().PsMenuHandle.GetDefaultPagedList(page.PageIndex, page.PageSize, where).ToList();
         PageResponse <PsMenu> response = new PageResponse <PsMenu>
         {
             page     = page,
             dataList = list
         };
         return(new JsonResponses(response));
     }
     catch (Exception ex)
     {
         Console.WriteLine(ex.ToString());
     }
     return(JsonResponses.Failed);
 }
Ejemplo n.º 2
0
        public ActionResult <JsonResponses> GetPageList([FromQuery] PageModel page, [FromQuery] QueryBaseFrom query)
        {
            query.InitQuery();
            string QueryNo  = "_" + query.queryNo;
            string keywords = query.keywords;

            Expression <Func <RtMessage, bool> > where = o => o.AppId.Contains(keywords);
            page.setTotalCount(Convert.ToInt32(DataHandleManager.Instance().RtMessageHandle.Count(where)));//取记录数
            List <RtMessage>         list     = DataHandleManager.Instance().RtMessageHandle.GetDefaultPagedList(page.PageIndex, page.PageSize, where).ToList();
            PageResponse <RtMessage> response = new PageResponse <RtMessage>
            {
                page     = page,
                dataList = list
            };

            return(new JsonResponses(response));
        }
        public ActionResult <JsonResponses> GetPageList([FromQuery] PageModel page, [FromQuery] QueryBaseFrom query)
        {
            query.InitQuery();
            string QueryNo  = "_" + query.queryNo;
            string keywords = query.keywords;

            Expression <Func <BsDictionaryType, bool> > where = null;
            if (!String.IsNullOrEmpty(keywords))
            {
                where = (o => o.DicType.Contains(keywords) || (o.Descriptions.Contains(keywords)));
            }
            page.setTotalCount(Convert.ToInt32(DataHandleManager.Instance().BsDictionaryTypeHandle.Count(where)));//取记录数
            List <BsDictionaryType>         list     = DataHandleManager.Instance().BsDictionaryTypeHandle.GetDefaultPagedList(page.PageIndex, page.PageSize, where).ToList();
            PageResponse <BsDictionaryType> response = new PageResponse <BsDictionaryType>
            {
                page     = page,
                dataList = list
            };

            return(new JsonResponses(response));
        }