Пример #1
0
        public void InsertRMAInventoryLog(RMAInventoryLog entity)
        {
            var insertCommand = DataCommandManager.GetDataCommand("InsertRMAInventoryLog");

            insertCommand.SetParameterValue <RMAInventoryLog>(entity);

            insertCommand.ExecuteNonQuery();
        }
Пример #2
0
        private bool UpdateInventory(List <RMARegisterInfo> registers, bool isRecv)
        {
            registers.ForEach(r =>
            {
                if (r.BasicInfo.SOItemType != SOProductType.ExtendWarranty)
                {
                    var InventoryMemo     = string.Empty;
                    var tempInventoryMemo = requestDA.GetInventoryMemo(TrimIntNull(r.BasicInfo.LocationWarehouse),
                                                                       r.BasicInfo.ProductSysNo,
                                                                       r.CompanyCode);

                    registerDA.UpdateInventory(
                        Convert.ToInt32(r.BasicInfo.LocationWarehouse), r.BasicInfo.ProductSysNo.Value, isRecv, r.CompanyCode
                        );

                    RMAInventoryLog rmaInventoryLogEntity = new RMAInventoryLog();

                    rmaInventoryLogEntity.WarehouseSysNo = TrimIntNull(r.BasicInfo.LocationWarehouse);
                    rmaInventoryLogEntity.ProductSysNo   = TrimIntNull(r.BasicInfo.ProductSysNo);
                    rmaInventoryLogEntity.SysNo          = TrimIntNull(r.BasicInfo.SysNo);

                    rmaInventoryLogEntity.RMAOnVendorQty = 0;
                    rmaInventoryLogEntity.ShiftQty       = 0;
                    rmaInventoryLogEntity.OwnbyNeweggQty = 0;
                    rmaInventoryLogEntity.OperationTime  = DateTime.Now;

                    if (isRecv)
                    {
                        rmaInventoryLogEntity.OperationType    = ResouceManager.GetMessageString("RMA.Request", "RMARequestMsgOne");
                        rmaInventoryLogEntity.RMAStockQty      = 1;
                        rmaInventoryLogEntity.OwnbyCustomerQty = 1;
                        InventoryMemo = ResouceManager.GetMessageString("RMA.Request", "RMARequestMsgTwo") + tempInventoryMemo;
                    }
                    else
                    {
                        rmaInventoryLogEntity.OperationType    = ResouceManager.GetMessageString("RMA.Request", "RMARequestMsgThree");
                        rmaInventoryLogEntity.RMAStockQty      = -1;
                        rmaInventoryLogEntity.OwnbyCustomerQty = -1;
                        InventoryMemo = ResouceManager.GetMessageString("RMA.Request", "RMARequestMsgFour") + tempInventoryMemo;
                    }

                    rmaInventoryLogEntity.Memo = InventoryMemo;
                    requestDA.InsertRMAInventoryLog(rmaInventoryLogEntity);
                }
            });
            return(true);
        }