Exemplo n.º 1
0
        public static void AddPointOfSale(BaseSearchReq req, string appName)
        {
            BillingPointOfSaleInfo billSaleInfo = new BillingPointOfSaleInfo();

            billSaleInfo.OriginApplication = appName;
            req.BillingPointOfSaleInfo     = billSaleInfo;
        }
Exemplo n.º 2
0
        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);
        }
 public static void AddPointOfSale(BaseSearchReq req, string appName)
 {
     BillingPointOfSaleInfo billSaleInfo = new BillingPointOfSaleInfo();
     billSaleInfo.OriginApplication = appName;
     req.BillingPointOfSaleInfo = billSaleInfo;
 }
Exemplo n.º 4
0
        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);
        }