Exemplo n.º 1
0
        public ActionResult Edit()
        {
            string           OrderNum      = WebUtil.GetFormValue <string>("OrderNum", string.Empty);
            int              Type          = WebUtil.GetFormValue <int>("Type", (int)ECheckType.Local);
            int              ProductType   = WebUtil.GetFormValue <int>("ProductType", (int)EProductType.Goods);
            string           ContractOrder = WebUtil.GetFormValue <string>("ContractOrder", string.Empty);
            DateTime         CreateTime    = WebUtil.GetFormValue <DateTime>("CreateTime", DateTime.Now);
            string           Remark        = WebUtil.GetFormValue <string>("Remark", string.Empty);
            string           TargetNum     = WebUtil.GetFormValue <string>("TargetNum", string.Empty);
            CheckStockEntity entity        = new CheckStockEntity();

            entity.OrderNum      = OrderNum;
            entity.Type          = Type;
            entity.ProductType   = ProductType;
            entity.ContractOrder = ContractOrder;
            entity.Status        = (int)EAudite.Wait;
            entity.IsDelete      = (int)EIsDelete.NotDelete;
            entity.CreateTime    = CreateTime;
            entity.CreateUser    = this.LoginUser.UserCode;
            entity.OperateType   = (int)EOpType.PC;
            entity.IsComplete    = (int)EBool.No;
            entity.Remark        = Remark;
            entity.StorageNum    = this.DefaultStore;

            List <ProductEntity> ListProducts = Session[CacheKey.JOOSHOW_CHECKDETAIL_CACHE] as List <ProductEntity>;

            ListProducts = ListProducts.IsNull() ? new List <ProductEntity>() : ListProducts;

            List <CheckStockInfoEntity> listDetail = new List <CheckStockInfoEntity>();
            string storageNum = this.DefaultStore;

            foreach (ProductEntity key in ListProducts)
            {
                CheckStockInfoEntity detail = new CheckStockInfoEntity();
                detail.OrderNum   = OrderNum;
                detail.TargetNum  = key.SnNum;
                detail.StorageNum = storageNum;
                detail.CreateTime = DateTime.Now;
                listDetail.Add(detail);
            }

            Bill <CheckStockEntity, CheckStockInfoEntity> bill = new CheckOrder();
            string returnValue = bill.EditOrder(entity, listDetail);

            if (returnValue == EnumHelper.GetEnumDesc <EReturnStatus>(EReturnStatus.Success))
            {
                this.ReturnJson.AddProperty("Key", "1000");
                this.ReturnJson.AddProperty("Value", "盘点单创建成功");
            }
            return(Content(this.ReturnJson.ToString()));
        }
Exemplo n.º 2
0
        /// <summary>
        /// 编辑盘点单
        /// </summary>
        /// <returns></returns>
        public ActionResult Edit()
        {
            string CompanyID = WebUtil.GetFormValue <string>("CompanyID", string.Empty);
            InventoryOrderEntity         entity = WebUtil.GetFormObject <InventoryOrderEntity>("Entity");
            List <InventoryDetailEntity> list   = WebUtil.GetFormObject <List <InventoryDetailEntity> >("List");

            Bill <InventoryOrderEntity, InventoryDetailEntity> bill = new CheckOrder(CompanyID);
            string     returnValue = bill.EditOrder(entity, list);
            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)));
        }
Exemplo n.º 3
0
        public ActionResult Edit()
        {
            string OrderNum = WebUtil.GetFormValue<string>("OrderNum", string.Empty);
            int Type = WebUtil.GetFormValue<int>("Type", (int)ECheckType.Local);
            int ProductType = WebUtil.GetFormValue<int>("ProductType", (int)EProductType.Goods);
            string ContractOrder = WebUtil.GetFormValue<string>("ContractOrder", string.Empty);
            DateTime CreateTime = WebUtil.GetFormValue<DateTime>("CreateTime", DateTime.Now);
            string Remark = WebUtil.GetFormValue<string>("Remark", string.Empty);
            string TargetNum = WebUtil.GetFormValue<string>("TargetNum", string.Empty);
            CheckStockEntity entity = new CheckStockEntity();

            entity.OrderNum = OrderNum;
            entity.Type = Type;
            entity.ProductType = ProductType;
            entity.ContractOrder = ContractOrder;
            entity.Status = (int)EAudite.Wait;
            entity.IsDelete = (int)EIsDelete.NotDelete;
            entity.CreateTime = CreateTime;
            entity.CreateUser = this.LoginUser.UserCode;
            entity.OperateType = (int)EOpType.PC;
            entity.IsComplete = (int)EBool.No;
            entity.Remark = Remark;
            entity.StorageNum = this.DefaultStore;

            List<ProductEntity> ListProducts = Session[CacheKey.JOOSHOW_CHECKDETAIL_CACHE] as List<ProductEntity>;
            ListProducts = ListProducts.IsNull() ? new List<ProductEntity>() : ListProducts;

            List<CheckStockInfoEntity> listDetail = new List<CheckStockInfoEntity>();
            string storageNum = this.DefaultStore;
            foreach (ProductEntity key in ListProducts)
            {
                CheckStockInfoEntity detail = new CheckStockInfoEntity();
                detail.OrderNum = OrderNum;
                detail.TargetNum = key.SnNum;
                detail.StorageNum = storageNum;
                detail.CreateTime = DateTime.Now;
                listDetail.Add(detail);
            }

            Bill<CheckStockEntity, CheckStockInfoEntity> bill = new CheckOrder();
            string returnValue = bill.EditOrder(entity, listDetail);
            if (returnValue == EnumHelper.GetEnumDesc<EReturnStatus>(EReturnStatus.Success))
            {
                this.ReturnJson.AddProperty("Key", "1000");
                this.ReturnJson.AddProperty("Value", "盘点单创建成功");
            }
            return Content(this.ReturnJson.ToString());
        }