コード例 #1
0
        public static void AddPointOfSale(BaseSearchReq req, string appName)
        {
            BillingPointOfSaleInfo billSaleInfo = new BillingPointOfSaleInfo();

            billSaleInfo.OriginApplication = appName;
            req.BillingPointOfSaleInfo     = billSaleInfo;
        }
コード例 #2
0
ファイル: BLLExtension.cs プロジェクト: Liuzhangxi/maxliu
        public static SearchListResult <T> ToSearchList <T>(this IQueryable <T> query, BaseSearchReq req, bool isWithOrder = true)
        {
#if DEBUG
            //query.
            // query.Log = (log) => { System.Diagnostics.Debug.WriteLine(log); };
#endif
            if (req.rows == 0)
            {
                req.rows = 100000;
            }
            if (req.page <= 0)
            {
                req.page = 1;
            }
            if (isWithOrder)
            {
                query = OrderingHelper <T>(query, req.sidx, req.sord == "desc", false);
            }

            SearchListResult <T> retListResult = new SearchListResult <T>();
            retListResult.records = query.Count();
            retListResult.rows    = query.Skip((req.page - 1) * req.rows).Take(req.rows).ToList();
            retListResult.page    = req.page;
            retListResult.total   = (retListResult.records - 1) / req.rows + 1;


            return(retListResult);
        }
コード例 #3
0
 public static void AddPointOfSale(BaseSearchReq req, string appName)
 {
     BillingPointOfSaleInfo billSaleInfo = new BillingPointOfSaleInfo();
     billSaleInfo.OriginApplication = appName;
     req.BillingPointOfSaleInfo = billSaleInfo;
 }
コード例 #4
0
ファイル: BLLExtension.cs プロジェクト: Liuzhangxi/maxliu
        public static SearchListResult <ShouKuanInfo> ToSearchShouKuanInfoList(this IQueryable <ShouKuanInfo> query, BaseSearchReq req)
        {
#if DEBUG
            //query.
            //            query.Database.Log = (log) => { System.Diagnostics.Debug.WriteLine(log); };
#endif

            query = query.OrderByDescending(d => d.JMSShouKuan.id);
            SearchListResult <ShouKuanInfo> retListResult = new SearchListResult <ShouKuanInfo>();
            retListResult.records = query.Count();
            retListResult.rows    = query.Skip((req.page - 1) * req.rows).Take(req.rows).ToList();
            retListResult.page    = req.page;
            retListResult.total   = (retListResult.records - 1) / req.rows + 1;


            return(retListResult);
        }