예제 #1
0
        public JsonResult GetPointTxnDetailGrid(int limit, int offset, string sort, string sortOrder)
        {
            TablePageParameter gp = new TablePageParameter()
            {
                Limit = limit, Offset = offset, SortName = sort, SortOrder = sortOrder
            };
            List <PointTxnDetail> pointTxnDetails = Service.GetPointTxnDetailGrid(gp);

            return(Json(new { total = gp.TotalCount, rows = pointTxnDetails }, JsonRequestBehavior.AllowGet));
        }
예제 #2
0
        public JsonResult GetCompanyGrid(int limit, int offset, string sort, string sortOrder)
        {
            TablePageParameter gp = new TablePageParameter()
            {
                Limit = limit, Offset = offset, SortName = sort, SortOrder = sortOrder
            };
            List <CompanyDto> companyDtos = Service.GetCompanyGrid(gp);

            return(Json(new { total = gp.TotalCount }, JsonRequestBehavior.AllowGet));
        }
예제 #3
0
        /// <summary>
        /// 列表查询
        /// </summary>
        /// <param name="gp"></param>
        /// <returns></returns>
        public List <MenuTree> GetMenuGrid(TablePageParameter gp)
        {
            var sysMenu = sysMenuRepository.Entities;

            if (gp == null)
            {
                return(Mapper.Map <List <SysMenu>, List <MenuTree> >(sysMenu.ToList()));
            }
            return(Mapper.Map <List <SysMenu>, List <MenuTree> >(GetTablePagedList(sysMenu, gp)));
        }
예제 #4
0
        public JsonResult GetStoreGrid(int limit, int offset, string sort, string sortOrder)
        {
            TablePageParameter gp = new TablePageParameter()
            {
                Limit = limit, Offset = offset, SortName = sort, SortOrder = sortOrder
            };
            List <StoreReportDto> storeReportDtos = Service.GetStoreReportGrid(gp);

            return(Json(new { total = gp.TotalCount, rows = storeReportDtos }, JsonRequestBehavior.AllowGet));
        }
예제 #5
0
        public JsonResult GetMenuGrid(int limit = 0, int offset = 0, string sort = "", string sortOrder = "")
        {
            TablePageParameter gp = new TablePageParameter()
            {
                Limit = limit, Offset = offset, SortName = sort, SortOrder = sortOrder
            };
            List <Model.Dto.MenuTree> menuDtoDtos = Service.GetMenuGrid(gp);

            return(Json(new { total = gp.TotalCount, rows = menuDtoDtos }, JsonRequestBehavior.AllowGet));
        }
예제 #6
0
        /// <summary>
        /// 获取StoreReport列表
        /// </summary>
        /// <param name="gp"></param>
        /// <returns></returns>
        public List <CompanyDto> GetCompanyGrid(TablePageParameter gp)
        {
            Expression <Func <Company, bool> > ex = t => true;

            ex = ex.And(t => !t.IsDelete);
            var CompanyList = CompanyRepository.GetEntities(ex);

            if (gp == null)
            {
                return(Mapper.Map <List <Company>, List <CompanyDto> >(CompanyList.ToList()));
            }
            else
            {
                return(Mapper.Map <List <Company>, List <CompanyDto> >(GetTablePagedList(CompanyList, gp)));
            }
        }
예제 #7
0
        /// <summary>
        /// 获取StoreReport列表
        /// </summary>
        /// <param name="gp"></param>
        /// <returns></returns>
        public List <StoreReportDto> GetStoreReportGrid(TablePageParameter gp)
        {
            Expression <Func <StoreReport, bool> > ex = t => true;

            ex = ex.And(t => !t.IsDelete);
            var storeReportList = storeReportRepository.GetEntities(ex);

            if (gp == null)
            {
                return(Mapper.Map <List <StoreReport>, List <StoreReportDto> >(storeReportList.ToList()));
            }
            else
            {
                return(Mapper.Map <List <StoreReport>, List <StoreReportDto> >(GetTablePagedList(storeReportList, gp)));
            }
        }
예제 #8
0
 /// <summary>
 /// 分页
 /// </summary>
 /// <param name="entitys"></param>
 /// <param name="gp"></param>
 /// <returns></returns>
 public List <T> GetTablePagedList <T>(IQueryable <T> entitys, TablePageParameter gp)
 {
     gp.PageParameterInit(entitys);
     if (!gp.NotSort)
     {
         if (string.IsNullOrEmpty(gp.SortName))
         {
             entitys = entitys.OrderBy("Id");
         }
         else
         {
             try
             {
                 entitys = entitys.OrderBy(gp.SortName + " " + gp.SortOrder); //排序
             }
             catch (Exception)
             {
                 entitys = entitys.OrderBy("Id");
             }
         }
     }
     entitys = entitys.Skip(gp.Offset).Take(gp.PageSize); //分页
     return(entitys.ToList());
 }
예제 #9
0
        /// <summary>
        /// 获取PointTxnDetail列表
        /// </summary>
        /// <param name="gp"></param>
        /// <returns></returns>
        public List <PointTxnDetail> GetPointTxnDetailGrid(TablePageParameter gp)
        {
            var storeReportList = pointTxnDetailtRepository.Entities;

            return(GetTablePagedList(storeReportList, gp));
        }