Exemple #1
0
        /// <summary>
        /// 获取出入库记录
        /// </summary>
        /// <returns></returns>
        public List <GoodsChangeDto> GetGoodsChange(GoodsChangeApo pageDataApo, out int totalCount)
        {
            totalCount = 0;
            List <GoodsChangeDto> data;

            //查询语句
            var queryable = Db.Queryable <GoodsChageOrderdtl, GoodsChageOrder>((ordtl, orl) => new object[] { JoinType.Left, ordtl.related_order_id == orl.id })
                            .Where((ordtl, orl) => ordtl.operate_type == pageDataApo.operate_type)
                            .WhereIF(pageDataApo.startTime.HasValue, (ordtl, orl) => orl.create_time >= pageDataApo.startTime)
                            .WhereIF(pageDataApo.endTime.HasValue, (ordtl, orl) => orl.create_time <= pageDataApo.endTime)
                            .WhereIF((!string.IsNullOrEmpty(pageDataApo.name) && !string.IsNullOrWhiteSpace(pageDataApo.name)), (ordtl, orl) => ordtl.name.Contains(pageDataApo.name))

                            .OrderBy((ordtl, orl) => orl.create_time, OrderByType.Desc)
                            .Select((ordtl, orl) => new GoodsChangeDto
            {
                id = ordtl.id,
                related_order_id = ordtl.related_order_id,
                goods_id         = ordtl.goods_id,
                name             = ordtl.name,
                goods_code       = ordtl.goods_code,
                code             = ordtl.code,
                batch_number     = ordtl.batch_number,
                birth_date       = ordtl.birth_date,
                expire_date      = ordtl.expire_date,
                create_time      = orl.create_time,
                business_type    = orl.business_type,
                operate_type     = ordtl.operate_type
            });


            //如果小于0,默认查全部
            if (pageDataApo.PageSize > 0)
            {
                data = queryable.ToPageList(pageDataApo.PageIndex, pageDataApo.PageSize, ref totalCount);
            }
            else
            {
                data       = queryable.ToList();
                totalCount = data.Count();
            }
            return(data);
        }
Exemple #2
0
 /// <summary>
 /// 库存记录查询
 /// </summary>
 /// <param name="pageDataApo"></param>
 /// <param name="totalCount"></param>
 /// <returns></returns>
 public List <GoodsChangeDto> GetGoodsChange(GoodsChangeApo pageDataApo, out int totalCount)
 {
     return(goodsChageOrderDal.GetGoodsChange(pageDataApo, out totalCount));
 }