Ejemplo n.º 1
0
        public ActionResult Edit()
        {
            int             InType        = WebUtil.GetFormValue <int>("InType", 0);
            int             ProductType   = WebUtil.GetFormValue <int>("ProductType", 0);
            string          ContractOrder = WebUtil.GetFormValue <string>("ContractOrder", string.Empty);
            string          SupNum        = WebUtil.GetFormValue <string>("SupNum", string.Empty);
            string          SupName       = WebUtil.GetFormValue <string>("SupName", string.Empty);
            string          ContactName   = WebUtil.GetFormValue <string>("ContactName", string.Empty);
            string          Phone         = WebUtil.GetFormValue <string>("Phone", string.Empty);
            DateTime        OrderTime     = WebUtil.GetFormValue <DateTime>("OrderTime", DateTime.Now);
            string          Remark        = WebUtil.GetFormValue <string>("Remark", string.Empty);
            string          orderNum      = WebUtil.GetFormValue <string>("OrderNum", string.Empty);
            InStorageEntity entity        = new InStorageEntity();

            entity.OrderNum      = orderNum;
            entity.InType        = InType;
            entity.ProductType   = ProductType;
            entity.SupNum        = SupNum;
            entity.SupName       = SupName;
            entity.ContactName   = ContactName;
            entity.Phone         = Phone;
            entity.Address       = "";
            entity.ContractOrder = ContractOrder;
            entity.Status        = (int)EAudite.Wait;
            entity.IsDelete      = (int)EIsDelete.NotDelete;
            entity.OrderTime     = OrderTime;
            entity.CreateTime    = DateTime.Now;
            entity.CreateUser    = this.LoginUserCode;
            entity.AuditUser     = string.Empty;
            entity.AuditeTime    = DateTime.MinValue;
            entity.PrintUser     = string.Empty;
            entity.PrintTime     = DateTime.MinValue;
            entity.Reason        = string.Empty;
            entity.OperateType   = (int)EOpType.PC;
            entity.EquipmentNum  = string.Empty;
            entity.EquipmentCode = string.Empty;
            entity.Remark        = Remark;
            entity.StorageNum    = this.DefaultStore;

            List <InStorDetailEntity> list = Session[CacheKey.TEMPDATA_CACHE_INSTORDETAIL] as List <InStorDetailEntity>;

            if (list.IsNullOrEmpty())
            {
                this.ReturnJson.AddProperty("Key", "1001");
                this.ReturnJson.AddProperty("Value", "入库单必须包含入库产品,请重新核对");
                return(Content(this.ReturnJson.ToString()));
            }
            Bill <InStorageEntity, InStorDetailEntity> bill = new InStorageOrder();
            string returnValue = bill.EditOrder(entity, list);

            if (returnValue == EnumHelper.GetEnumDesc <EReturnStatus>(EReturnStatus.Success))
            {
                Session[CacheKey.TEMPDATA_CACHE_INSTORDETAIL] = null;
                this.ReturnJson.AddProperty("Key", "1000");
                this.ReturnJson.AddProperty("Value", "入库单编辑成功");
            }
            return(Content(this.ReturnJson.ToString()));
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 编辑入库单的主体
        /// </summary>
        /// <returns></returns>
        public ActionResult EditOrder()
        {
            string          CompanyID = WebUtil.GetFormValue <string>("CompanyID", string.Empty);
            InStorageEntity entity    = WebUtil.GetFormObject <InStorageEntity>("Entity");

            Bill <InStorageEntity, InStorDetailEntity> bill = new InStorageOrder(CompanyID);
            string     returnValue = bill.EditOrder(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)));
        }
Ejemplo n.º 3
0
        public ActionResult Edit()
        {
            int InType = WebUtil.GetFormValue<int>("InType", 0);
            int ProductType = WebUtil.GetFormValue<int>("ProductType", 0);
            string ContractOrder = WebUtil.GetFormValue<string>("ContractOrder", string.Empty);
            string SupNum = WebUtil.GetFormValue<string>("SupNum", string.Empty);
            string SupName = WebUtil.GetFormValue<string>("SupName", string.Empty);
            string ContactName = WebUtil.GetFormValue<string>("ContactName", string.Empty);
            string Phone = WebUtil.GetFormValue<string>("Phone", string.Empty);
            DateTime OrderTime = WebUtil.GetFormValue<DateTime>("OrderTime", DateTime.Now);
            string Remark = WebUtil.GetFormValue<string>("Remark", string.Empty);
            string orderNum = WebUtil.GetFormValue<string>("OrderNum", string.Empty);
            InStorageEntity entity = new InStorageEntity();
            entity.OrderNum = orderNum;
            entity.InType = InType;
            entity.ProductType = ProductType;
            entity.SupNum = SupNum;
            entity.SupName = SupName;
            entity.ContactName = ContactName;
            entity.Phone = Phone;
            entity.Address = "";
            entity.ContractOrder = ContractOrder;
            entity.Status = (int)EAudite.Wait;
            entity.IsDelete = (int)EIsDelete.NotDelete;
            entity.OrderTime = OrderTime;
            entity.CreateTime = DateTime.Now;
            entity.CreateUser = this.LoginUserCode;
            entity.AuditUser = string.Empty;
            entity.AuditeTime = DateTime.MinValue;
            entity.PrintUser = string.Empty;
            entity.PrintTime = DateTime.MinValue;
            entity.Reason = string.Empty;
            entity.OperateType = (int)EOpType.PC;
            entity.EquipmentNum = string.Empty;
            entity.EquipmentCode = string.Empty;
            entity.Remark = Remark;
            entity.StorageNum = this.DefaultStore;

            List<InStorDetailEntity> list = Session[CacheKey.TEMPDATA_CACHE_INSTORDETAIL] as List<InStorDetailEntity>;
            if (list.IsNullOrEmpty())
            {
                this.ReturnJson.AddProperty("Key", "1001");
                this.ReturnJson.AddProperty("Value", "入库单必须包含入库产品,请重新核对");
                return Content(this.ReturnJson.ToString());
            }
            Bill<InStorageEntity, InStorDetailEntity> bill = new InStorageOrder();
            string returnValue = bill.EditOrder(entity, list);
            if (returnValue == EnumHelper.GetEnumDesc<EReturnStatus>(EReturnStatus.Success))
            {
                Session[CacheKey.TEMPDATA_CACHE_INSTORDETAIL] = null;
                this.ReturnJson.AddProperty("Key", "1000");
                this.ReturnJson.AddProperty("Value", "入库单编辑成功");
            }
            return Content(this.ReturnJson.ToString());
        }