Beispiel #1
0
 /// <summary>
 /// 根据订单详细唯一编码号获取该订单详细信息以及产品信息
 /// </summary>
 /// <param name="sn"></param>
 /// <returns></returns>
 public OrderDetailEntity GetOrderDetailBySnNum(string snNum)
 {
     OrderDetailEntity entity = new OrderDetailEntity();
     entity.IncludeAll();
     ProductEntity ProEntity = new ProductEntity();
     ProEntity.Include(a => new { Size = a.Size});
     entity.Left<ProductEntity>(ProEntity, new Params<string, string>() { Item1 = "ProductNum", Item2 = "SnNum" });
     entity.Where("SnNum", ECondition.Eth, snNum);
     entity = this.OrderDetail.GetSingle(entity);
     return entity;
 }
        public ActionResult Print()
        {
            string orderNum = WebUtil.GetQueryStringValue<string>("orderNum", string.Empty);
            Bill<OutStorageEntity, OutStoDetailEntity> bill = new OutStorageOrder();
            OutStorageEntity entity = new OutStorageEntity();
            entity.OrderNum = orderNum;
            entity = bill.GetOrder(entity);
            entity = entity.IsNull() ? new OutStorageEntity() : entity;
            ViewBag.Entity = entity;

            OutStoDetailEntity detail = new OutStoDetailEntity();
            detail.OrderNum = orderNum;
            List<OutStoDetailEntity> listResult = bill.GetOrderDetail(detail);
            listResult = listResult.IsNull() ? new List<OutStoDetailEntity>() : listResult;
            OrderProvider orderProvider = new OrderProvider();
            foreach (OutStoDetailEntity item in listResult)
            {
                OrderDetailEntity orderDetail = new OrderDetailEntity();
                orderDetail.Where(a => a.SnNum == item.ContractSn).And(a => a.OrderNum == item.ContractOrder);
                orderDetail = orderProvider.GetOrderDetail(orderDetail);
                if (orderDetail != null)
                {
                    item.Qty = orderDetail.Num;
                }
            }
            ViewBag.Detail = listResult;
            return View();
        }