Exemplo n.º 1
0
        /// <summary>
        /// 根据商品SysNo获取商品批号和历史备注
        /// </summary>
        /// <param name="productSysNo"></param>
        /// <returns></returns>
        public static ProductBatchManagementInfo GetProductBatchManagementInfo(int productSysNo)
        {
            DataCommand cmd = DataCommandManager.GetDataCommand("GetProductBatchManagementInfo");

            cmd.SetParameterValue("@ProductSysNo", productSysNo);
            var result = cmd.ExecuteEntity <ProductBatchManagementInfo>();

            if (result != null)
            {
                result.Logs = GetProductBatchManagementLogByBatchManagementSysNo(result.SysNo.Value);
                foreach (var item in result.Logs)
                {
                    result.Notes += item.InDate.ToString() + "," + item.InUser + "," + item.Note;
                }
            }
            else
            {
                result = new ProductBatchManagementInfo();
                result.ProductSysNo     = productSysNo;
                result.IsBatch          = false;
                result.IsCollectBatchNo = false;
                result.CollectType      = 0;
            }
            return(result);
        }
Exemplo n.º 2
0
        public void UpdateIsBatch(ProductBatchManagementInfo batchManagementInfo)
        {
            DataCommand cmd = DataCommandManager.GetDataCommand("UpdateProductBatchManagementInfo");

            cmd.SetParameterValue(batchManagementInfo);
            cmd.SetParameterValue("@IsBatch", batchManagementInfo.IsBatch.Value ? "Y" : "N");
            cmd.SetParameterValue("@IsCollectBatchNo", batchManagementInfo.IsCollectBatchNo.Value ? "Y" : "N");
            cmd.SetParameterValueAsCurrentUserAcct("@UserAcct");
            //cmd.SetParameterValue("@CompanyCode","8601");
            //cmd.SetParameterValue("@LanguageCode","zh-CN");
            //cmd.SetParameterValue("@StoreCompanyCode","8601");
            cmd.ExecuteNonQuery();
        }
Exemplo n.º 3
0
        /// <summary>
        /// 更新商品批号
        /// </summary>
        /// <param name="batchManagementInfo"></param>
        public static void UpdateIsBatch(ProductBatchManagementInfo batchManagementInfo)
        {
            DataCommand cmd = DataCommandManager.GetDataCommand("UpdateProductBatchManagementInfo");

            //cmd.SetParameterValue(batchManagementInfo);
            cmd.SetParameterValue("@IsBatch", batchManagementInfo.IsBatch.Value ? "Y" : "N");
            cmd.SetParameterValue("@ProductSysNo", batchManagementInfo.ProductSysNo);
            cmd.SetParameterValue("@CollectType", batchManagementInfo.CollectType == CollectDateType.ExpiredDate ? "E" : "P");
            cmd.SetParameterValue("@IsCollectBatchNo", batchManagementInfo.IsCollectBatchNo.Value ? "Y" : "N");
            cmd.SetParameterValue("@MinReceiptDays", batchManagementInfo.MinReceiptDays);
            cmd.SetParameterValue("@MaxDeliveryDays", batchManagementInfo.MaxDeliveryDays);
            cmd.SetParameterValue("@GuaranteePeriodYear", batchManagementInfo.GuaranteePeriodYear);
            cmd.SetParameterValue("@GuaranteePeriodMonth", batchManagementInfo.GuaranteePeriodMonth);
            cmd.SetParameterValue("@GuaranteePeriodDay", batchManagementInfo.GuaranteePeriodDay);
            cmd.SetParameterValue("@EidtUser", batchManagementInfo.EidtUser);
            cmd.ExecuteNonQuery();
        }
Exemplo n.º 4
0
        public ProductBatchManagementInfo UpdateIsBatch(ProductBatchManagementInfo batchManagementInfo)
        {
            using (var scope = TransactionScopeFactory.CreateTransactionScope())
            {
                productExtDA.UpdateIsBatch(batchManagementInfo);

                var batch = productExtDA.GetProductBatchManagementInfo(batchManagementInfo.ProductSysNo.Value);

                if (!string.IsNullOrEmpty(batchManagementInfo.Note) && batchManagementInfo.IsBatch.Value)
                {
                    var log = new ProductBatchManagementInfoLog {
                        Note = batchManagementInfo.Note, BatchManagementSysNo = batch.SysNo
                    };
                    productExtDA.InsertProductBatchManagementLog(log);
                }

                scope.Complete();
            }

            return(productExtDA.GetProductBatchManagementInfo(batchManagementInfo.ProductSysNo.Value));
        }
Exemplo n.º 5
0
 public virtual ProductBatchManagementInfo UpdateIsBatch(ProductBatchManagementInfo productExtInfo)
 {
     return(ObjectFactory <ProductExtAppService> .Instance.UpdateIsBatch(productExtInfo));
 }
Exemplo n.º 6
0
 public ProductBatchManagementInfo UpdateIsBatch(ProductBatchManagementInfo extInfo)
 {
     return(ObjectFactory <ProductExtProcessor> .Instance.UpdateIsBatch(extInfo));
 }