Exemplo n.º 1
0
 public ActionResult Audite()
 {
     string orderNum = WebUtil.GetQueryStringValue<string>("OrderNum", string.Empty);
     Bill<CheckStockEntity, CheckStockInfoEntity> bill = new CheckOrder();
     CheckStockEntity entity = new CheckStockEntity();
     entity.OrderNum = orderNum;
     entity = bill.GetOrder(entity);
     if (entity.IsNull())
     {
         return Redirect("/Check/Product/List");
     }
     entity.CheckTypeLable = EnumHelper.GetEnumDesc<ECheckType>(entity.Type);
     entity.ProductTypeLable = EnumHelper.GetEnumDesc<EProductType>(entity.ProductType);
     entity.StatusLable = EnumHelper.GetEnumDesc<EAudite>(entity.Status);
     ViewBag.Entity = entity;
     return View();
 }
Exemplo n.º 2
0
        public ActionResult Edit()
        {
            string orderNum = WebUtil.GetQueryStringValue<string>("OrderNum", string.Empty);
            Bill<CheckStockEntity, CheckStockInfoEntity> bill = new CheckOrder();
            CheckStockEntity entity = new CheckStockEntity();
            entity.OrderNum = orderNum;
            entity = bill.GetOrder(entity);
            if (entity.IsNull())
            {
                return Redirect("/Check/Product/List");
            }
            string checkType = EnumHelper.GetOptions<ECheckType>(entity.Type);
            ViewBag.CheckType = checkType;
            ViewBag.ProductType = EnumHelper.GetOptions<EProductType>(entity.ProductType);
            ViewBag.Entity = entity;
            CheckStockInfoEntity info = new CheckStockInfoEntity();
            info.OrderNum = orderNum;
            List<CheckStockInfoEntity> list = bill.GetOrderDetail(info);

            List<ProductEntity> ListProducts = new List<ProductEntity>();
            List<ProductEntity> ListSource = new ProductProvider().GetListByCache();
            if (!list.IsNullOrEmpty())
            {
                Parallel.ForEach(list, item =>
                {
                    if (ListSource.Exists(a => a.SnNum == item.TargetNum))
                    {
                        ProductEntity target = ListSource.FirstOrDefault(a => a.SnNum == item.TargetNum);
                        ListProducts.Add(target);
                    }
                });
            }
            Session[CacheKey.JOOSHOW_CHECKDETAIL_CACHE] = ListProducts;
            return View();
        }