Esempio n. 1
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());
        }
Esempio n. 2
0
        /// <summary>
        /// 查询移库单详细
        /// </summary>
        /// <returns></returns>
        public ActionResult GetDetail()
        {
            string SnNum                 = WebUtil.GetFormValue <string>("SnNum");
            string CompanyID             = WebUtil.GetFormValue <string>("CompanyID", string.Empty);
            MoveOrderDetailEntity entity = new MoveOrderDetailEntity();

            entity.OrderSnNum = SnNum;
            entity.CompanyID  = CompanyID;
            Bill <MoveOrderEntity, MoveOrderDetailEntity> bill = new MoveOrder(CompanyID);
            List <MoveOrderDetailEntity> list = bill.GetOrderDetail(entity);

            DataResult <List <MoveOrderDetailEntity> > dataResult = new DataResult <List <MoveOrderDetailEntity> >();

            dataResult.Code    = (int)EResponseCode.Success;
            dataResult.Message = "响应成功";
            dataResult.Result  = list;
            return(Content(JsonHelper.SerializeObject(dataResult)));
        }
Esempio n. 3
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));
        }
Esempio n. 4
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);
        }
Esempio n. 5
0
        /// <summary>
        /// 查询移库单详细分页
        /// </summary>
        /// <returns></returns>
        public ActionResult GetDetailPage()
        {
            string CompanyID  = WebUtil.GetFormValue <string>("CompanyID");
            int    PageIndex  = WebUtil.GetFormValue <int>("PageIndex", 1);
            int    PageSize   = WebUtil.GetFormValue <int>("PageSize", 10);
            string OrderNum   = WebUtil.GetFormValue <string>("OrderNum");
            int    MoveType   = WebUtil.GetFormValue <int>("MoveType", 0);
            int    Status     = WebUtil.GetFormValue <int>("Status", 0);
            string BeginTime  = WebUtil.GetFormValue <string>("BeginTime");
            string EndTime    = WebUtil.GetFormValue <string>("EndTime");
            string StorageNum = WebUtil.GetFormValue <string>("StorageNum");
            Bill <MoveOrderEntity, MoveOrderDetailEntity> bill = new MoveOrder(CompanyID);
            MoveOrderDetailEntity entity = new MoveOrderDetailEntity();

            entity.CompanyID  = CompanyID;
            entity.OrderNum   = OrderNum;
            entity.MoveType   = MoveType;
            entity.Status     = Status;
            entity.BeginTime  = BeginTime;
            entity.EndTime    = EndTime;
            entity.StorageNum = StorageNum;

            PageInfo pageInfo = new PageInfo()
            {
                PageIndex = PageIndex, PageSize = PageSize
            };

            List <MoveOrderDetailEntity> listResult = bill.GetDetailList(entity, ref pageInfo);

            DataListResult <MoveOrderDetailEntity> dataResult = new DataListResult <MoveOrderDetailEntity>()
            {
                Code     = (int)EResponseCode.Success,
                Message  = "响应成功",
                Result   = listResult,
                PageInfo = pageInfo
            };

            return(Content(JsonHelper.SerializeObject(dataResult)));
        }
Esempio n. 6
0
        /// <summary>
        /// 编辑移库单详细
        /// </summary>
        /// <returns></returns>
        public ActionResult EditDetail()
        {
            string CompanyID = WebUtil.GetFormValue <string>("CompanyID", string.Empty);
            MoveOrderDetailEntity        entity = WebUtil.GetFormObject <MoveOrderDetailEntity>("Entity");
            List <MoveOrderDetailEntity> list   = WebUtil.GetFormObject <List <MoveOrderDetailEntity> >("List");

            Bill <MoveOrderEntity, MoveOrderDetailEntity> bill = new MoveOrder(CompanyID);
            string     returnValue = bill.EditDetail(entity);
            DataResult result      = new DataResult();

            if (EnumHelper.GetEnumDesc <EReturnStatus>(EReturnStatus.Success) == returnValue)
            {
                result.Code    = (int)EResponseCode.Success;
                result.Message = "移库单详细编辑成功";
            }
            else
            {
                result.Code    = (int)EResponseCode.Exception;
                result.Message = "移库单详细编辑失败";
            }
            return(Content(JsonHelper.SerializeObject(result)));
        }
Esempio n. 7
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());
        }