Ejemplo n.º 1
0
 /// <summary>
 /// 根据订单号查询所有订单相关联的的排产单号
 /// </summary>
 /// <param name="orderNum"></param>
 /// <returns></returns>
 public List<string> GetOrderPlan(string orderNum)
 {
     OrdersEntity entity = new OrdersEntity();
     entity.Include(a => new { a.OrderNum, a.ContractOrder });
     entity.Where("OrderNum", ECondition.Like, "%" + orderNum + "%");
     List<OrdersEntity> list = this.Orders.GetList(entity);
     if (!list.IsNullOrEmpty())
     {
         List<string> items = list.Select(a => a.ContractOrder).ToList();
         return items;
     }
     return null;
 }
Ejemplo n.º 2
0
        public ActionResult AutoOrder(string productName)
        {
            string orderNum = WebUtil.GetFormValue<string>("orderNum", string.Empty);
            PageInfo page = new PageInfo { PageIndex = 1, PageSize = 5 };
            Bill<OrdersEntity, OrderDetailEntity> bill = new OrderBill();
            OrdersEntity entity = new OrdersEntity();
            if (orderNum != string.Empty)
            {
                entity.Where("OrderNum", ECondition.Like, "%" + orderNum + "%");
            }
            entity.Where(a => a.AuditeStatus == (int)EAudite.Pass).And(a => a.Status != (int)EOrderStatus.AllDelivery);
            List<OrdersEntity> list = bill.GetList(entity, ref page);

            list = list.IsNull() ? new List<OrdersEntity>() : list;
            StringBuilder sb = new StringBuilder();
            JsonObject jsonObject = null;
            foreach (OrdersEntity t in list)
            {
                jsonObject = new JsonObject();
                jsonObject.AddProperty("OrderNum", t.OrderNum);
                jsonObject.AddProperty("CusName", t.CusName);
                sb.Append(jsonObject.ToString() + "\n");
            }
            if (sb.Length == 0)
            {
                sb.Append("\n");
            }
            return Content(sb.ToString());
        }