예제 #1
0
        public ActionResult Detail()
        {
            string orderNum = WebUtil.GetQueryStringValue<string>("orderNum", string.Empty);
            string flag = WebUtil.GetQueryStringValue<string>("flag", string.Empty);
            Bill<MoveOrderEntity, MoveOrderDetailEntity> bill = new MoveOrder();
            MoveOrderEntity entity = new MoveOrderEntity();
            entity.OrderNum = orderNum;
            entity = bill.GetOrder(entity);
            entity = entity.IsNull() ? new MoveOrderEntity() : entity;
            ViewBag.BadReport = entity;
            ViewBag.Status = EnumHelper.GetEnumDesc<EAudite>(entity.Status);

            MoveOrderDetailEntity detail = new MoveOrderDetailEntity();
            detail.OrderNum = orderNum;
            List<MoveOrderDetailEntity> listResult = bill.GetOrderDetail(detail);
            listResult = listResult.IsNull() ? new List<MoveOrderDetailEntity>() : listResult;
            ViewBag.Detail = listResult;
            ViewBag.Flag = flag;
            return View();
        }
예제 #2
0
 public static MoveOrderDetail_CE ToCE(MoveOrderDetailEntity item)
 {
     MoveOrderDetail_CE target = new MoveOrderDetail_CE();
     target.ID=item.ID;
     target.SnNum=item.SnNum;
     target.OrderNum=item.OrderNum;
     target.ProductName=item.ProductName;
     target.BarCode=item.BarCode;
     target.ProductNum=item.ProductNum;
     target.BatchNum=item.BatchNum;
     target.Num=item.Num;
     target.InPrice=item.InPrice;
     target.Amout=item.Amout;
     target.IsPick=item.IsPick;
     target.RealNum=item.RealNum;
     target.CreateTime=item.CreateTime;
     target.StorageNum=item.StorageNum;
     target.FromLocalNum=item.FromLocalNum;
     target.ToLocalNum=item.ToLocalNum;
     return target;
 }
예제 #3
0
        public ActionResult Edit()
        {
            string orderNum = WebUtil.GetQueryStringValue<string>("orderNum", string.Empty);
            if (orderNum.IsEmpty())
            {
                return Redirect("/Move/Product/List");
            }
            Bill<MoveOrderEntity, MoveOrderDetailEntity> bill = new MoveOrder();
            MoveOrderEntity entity = new MoveOrderEntity();
            entity.OrderNum = orderNum;
            entity = bill.GetOrder(entity);
            if (entity.IsNull())
            {
                return Redirect("/Move/Product/List");
            }
            ViewBag.Entity = entity;
            ViewBag.Status = EnumHelper.GetEnumDesc<EAudite>(entity.Status);
            ViewBag.MoveType = EnumHelper.GetOptions<EMoveType>(entity.MoveType, "请选择移库类型");
            ViewBag.ProductType = EnumHelper.GetOptions<EProductType>(entity.ProductType, "请选择入库产品类型");

            MoveOrderDetailEntity detail = new MoveOrderDetailEntity();
            detail.OrderNum = orderNum;
            List<MoveOrderDetailEntity> listResult = bill.GetOrderDetail(detail);
            Session[CacheKey.TEMPDATA_CACHE_MOVERODUCTDETAIL] = listResult;
            return View();
        }
예제 #4
0
 public ActionResult LoadProduct([ModelBinder(typeof(JsonBinder<List<MoveOrderDetailEntity>>))] List<MoveOrderDetailEntity> List)
 {
     List<MoveOrderDetailEntity> listResult = Session[CacheKey.TEMPDATA_CACHE_MOVERODUCTDETAIL] as List<MoveOrderDetailEntity>;
     listResult = listResult.IsNull() ? new List<MoveOrderDetailEntity>() : listResult;
     if (!List.IsNullOrEmpty())
     {
         string storageNum = this.DefaultStore;
         ProductProvider provider = new ProductProvider();
         List<ProductEntity> listProduct = provider.GetListByCache();
         LocationProvider localProvider = new LocationProvider();
         List<LocationEntity> listLocals = localProvider.GetList(storageNum);
         foreach (MoveOrderDetailEntity item in List)
         {
             ProductEntity product = listProduct.FirstOrDefault(a => a.BarCode == item.BarCode && a.SnNum == item.ProductNum);
             if (product != null)
             {
                 MoveOrderDetailEntity entity = new MoveOrderDetailEntity();
                 entity.SnNum = SequenceProvider.GetSequence(typeof(MoveOrderDetailEntity));
                 entity.ProductName = product.ProductName;
                 entity.BarCode = product.BarCode;
                 entity.ProductNum = product.SnNum;
                 entity.BatchNum = item.BatchNum;
                 entity.Num = item.Num;
                 entity.InPrice = product.InPrice;
                 entity.Amout = entity.InPrice * item.Num;
                 entity.IsPick = (int)EBool.Yes;
                 entity.RealNum = item.Num;
                 entity.CreateTime = DateTime.Now;
                 entity.StorageNum = storageNum;
                 entity.FromLocalNum = item.FromLocalNum;
                 entity.ToLocalNum = item.ToLocalNum;
                 LocationEntity local = listLocals.FirstOrDefault(a => a.LocalNum == item.FromLocalNum);
                 entity.FromLocalName = local != null ? local.LocalName : "";
                 local = listLocals.FirstOrDefault(a => a.LocalNum == item.ToLocalNum);
                 entity.ToLocalName = local != null ? local.LocalName : "";
                 listResult.Add(entity);
             }
         }
         Session[CacheKey.TEMPDATA_CACHE_MOVERODUCTDETAIL] = listResult;
     }
     return Content(string.Empty);
 }