/// <summary>
        /// 记录报废物资
        /// </summary>
        /// <returns></returns>
        public ActionResult SaveScrapOverdueMaterial()
        {
            int StorageCode = -3; //报废入库为报废库-3

            List<I_DeliveryDetail> relist = new List<I_DeliveryDetail>();

            I_DeliveryDetail info = new I_DeliveryDetail();
            info.RealBatchNo = Request.Form["RealBatchNo"].ToString();
            info.BatchNo = Request.Form["BatchNo"].ToString();
            info.MaterialID = Convert.ToInt32(Request.Form["MaterialID"]);
            info.DeliveryCounts = Convert.ToInt32(Request.Form["DeliveryCounts"]);
            info.EntryStorageCode = int.Parse(Request.Form["StorageCode"]); //来源仓库编码
            info.Remark = Request.Form["Remark"].ToString();
            info.TargetStorageCode = StorageCode;

            relist.Add(info);

            I_Delivery delivery = new I_Delivery();
            delivery.DeliveryCode = DateTime.Now.AddSeconds(1).ToString("yyyyMMddHHmmss") + UserOperateContext.Current.Session_UsrInfo.ID;    //生成入库编码
            delivery.ConsigneeID = UserOperateContext.Current.Session_UsrInfo.ID.ToString();
            delivery.DeliveryTime = DateTime.Now;
            delivery.Remark = info.Remark;
            delivery.OperatorCode = UserOperateContext.Current.Session_UsrInfo.ID;
            delivery.OperationTime = DateTime.Now;
            delivery.ReceivingStoreID = StorageCode;
            delivery.DeliveryType = "MatertalOutType-6";

            string errorMsg = "";
            if (new I_DeliveryBLL().DeliveryOerate(delivery, relist, ref errorMsg))
                return this.JsonResult(Utility.E_JsonResult.OK, "报废物资成功!", null, null);
            else
                return this.JsonResult(Utility.E_JsonResult.Error, errorMsg, null, null);
        }
Ejemplo n.º 2
0
        public ActionResult SaveStocking()
        {
            bool StockingType = Convert.ToBoolean(Request.Form["StockingType"]); //true为盘盈  false为盘亏
            int DeliveryCounts = Convert.ToInt32(Request.Form["DeliveryCounts"]);
            int StorageCode = -2; //盘库入库为盘点库-2
            string StockingTypeInfo = "";
            if (StockingType)
            {
                StockingTypeInfo = "MatertalOutType-4";  //盘盈出库单
                DeliveryCounts = -DeliveryCounts;
            }
            else
            {
                StockingTypeInfo = "MatertalOutType-5";  //盘亏出库单
            }
            List<I_DeliveryDetail> relist = new List<I_DeliveryDetail>();

            I_DeliveryDetail info = new I_DeliveryDetail();
            info.RealBatchNo = Request.Form["RealBatchNo"].ToString();
            info.BatchNo = Request.Form["BatchNo"].ToString();
            info.MaterialID = Convert.ToInt32(Request.Form["MaterialID"]);
            info.DeliveryCounts = DeliveryCounts;
            info.EntryStorageCode = int.Parse(Request.Form["StorageCode"]); //来源仓库编码
            info.Remark = Request.Form["Remark"].ToString();
            info.TargetStorageCode = StorageCode;
            relist.Add(info);

            I_Delivery delivery = new I_Delivery();
            delivery.DeliveryCode = DateTime.Now.AddSeconds(1).ToString("yyyyMMddHHmmss") + UserOperateContext.Current.Session_UsrInfo.ID;    //生成入库编码
            delivery.ConsigneeID = UserOperateContext.Current.Session_UsrInfo.ID.ToString();
            delivery.DeliveryTime = DateTime.Now;
            delivery.Remark = info.Remark;
            delivery.OperatorCode = UserOperateContext.Current.Session_UsrInfo.ID;
            delivery.OperationTime = DateTime.Now;
            delivery.ReceivingStoreID = StorageCode;
            delivery.DeliveryType = StockingTypeInfo;

            string errorMsg = "";
            if (new I_DeliveryBLL().DeliveryOerate(delivery, relist, ref errorMsg))
                return this.JsonResult(Utility.E_JsonResult.OK, "盘点物资仓库成功!", null, null);
            else
                return this.JsonResult(Utility.E_JsonResult.Error, errorMsg, null, null);
        }