Esempio n. 1
0
        private void CreateSOBom(List <UFIDA.U9.Cust.GS.FT.OrderBomBE.OrderBomHeadDTO> entityList)
        {
            using (ISession session = Session.Open())
            {
                foreach (UFIDA.U9.Cust.GS.FT.OrderBomBE.OrderBomHeadDTO dto in entityList)
                {
                    UFIDA.U9.Cust.GS.FT.OrderBomBE.OrderBomHead doc = UFIDA.U9.Cust.GS.FT.OrderBomBE.OrderBomHead.Create();

                    doc.Tier        = dto.Tier;
                    doc.SubKey      = dto.SubKey;
                    doc.SubkeyType  = dto.SubkeyType;
                    doc.ArrirmState = dto.ArrirmState;
                    doc.ParentPart  = dto.ParentPart;//母件
                    doc.BomMaster   = dto.BomMaster;
                    doc.BomCompont  = dto.BomCompont;
                    doc.Dosage      = dto.Dosage;     //用量
                    doc.DosageUnit  = dto.DosageUnit; //用量单位
                    doc.SellNumber  = dto.SellNumber; //销售数量
                    doc.SellUnit    = dto.SellUnit;   //销售单位
                    doc.Loss        = dto.Loss;       //固定损耗
                    doc.NeedNumber  = dto.NeedNumber; //需求数量
                    doc.SourceType  = dto.SourceType;
                    doc.OrderHead   = dto.OrderHead;
                    doc.OrderLine   = dto.OrderLine;
                    foreach (OrderBomBE.OrderBomLineDTO lineDto in dto.OrderBomLine)
                    {
                        OrderBomBE.OrderBomLine line = OrderBomBE.OrderBomLine.Create(doc);
                        line.SalesMan       = lineDto.SalesMan;
                        line.Department     = lineDto.Department;
                        line.SubKey         = lineDto.SubKey;
                        line.NeedNumber     = lineDto.NeedNumber;
                        line.NeedUom        = lineDto.NeedUom;
                        line.ProcurementQty = lineDto.ProcurementQty;
                    }
                }
                session.Commit();
            }
        }
        public override object Do(object obj)
        {
            SOBomAddOrRemoveBP bpObj = (SOBomAddOrRemoveBP)obj;

            if (bpObj.InParams == null || bpObj.InParams.Count <= 0)
            {
                throw new Exception("未选择数据,请确认!");
            }
            using (ISession sesion = Session.Open())
            {
                #region 新增
                if (bpObj.ActionType == 0)
                {
                    OrderBomBE.OrderBomHead head = OrderBomBE.OrderBomHead.Finder.Find("OrderLine='" + bpObj.SOLineID + "' order by Tier desc");
                    if (head == null)
                    {
                        throw new Exception("未找到对应的销售订单行,请刷新!");
                    }
                    int firstTier  = Convert.ToInt32(head.Tier.Substring(0, head.Tier.IndexOf('.')));
                    int secondTier = Convert.ToInt32(head.Tier.Substring(head.Tier.IndexOf('.') + 1, head.Tier.Length - 2));
                    foreach (ReturnUpDownLineDto returnDTO in bpObj.InParams)
                    {
                        UFIDA.U9.Cust.GS.FT.OrderBomBE.OrderBomHead doc = UFIDA.U9.Cust.GS.FT.OrderBomBE.OrderBomHead.Create();
                        secondTier = secondTier + 1;
                        doc.Tier   = firstTier + "." + secondTier;

                        ItemMaster item = ItemMaster.Finder.Find("ID='" + returnDTO.ItemInfo_ItemID + "'");
                        if (item == null)
                        {
                            throw new Exception("找不到对应的料品,请刷新!");
                        }
                        doc.SubKey      = item;
                        doc.SubkeyType  = ItemCategory.Finder.Find("Code='03'");
                        doc.ArrirmState = false;
                        doc.ParentPart  = head.ParentPart;//母件
                        //doc.BomMaster = head.BomMaster;
                        //doc.BomCompont = dto.BomCompont;
                        doc.Dosage     = returnDTO.Qty;     //用量
                        doc.DosageUnit = item.InventoryUOM; //用量单位
                        doc.SellNumber = returnDTO.Qty;     //销售数量
                        doc.SellUnit   = item.SalesUOM;     //销售单位
                        doc.Loss       = 1;                 //固定损耗
                        doc.NeedNumber = returnDTO.Qty;     //需求数量
                        doc.SourceType = AllEnumBE.SourceTypeEnum.HandWork;
                        doc.OrderLine  = head.OrderLine;
                        doc.OrderHead  = head.OrderHead;
                        OrderBomBE.OrderBomLine line = OrderBomBE.OrderBomLine.Create(doc);
                        line.SalesMan = item.PurchaseInfo.Buyer;
                        //line.Department = lineDto.Department;
                        line.SubKey         = item;
                        line.NeedNumber     = returnDTO.Qty;
                        line.NeedUom        = item.InventoryUOM;
                        line.ProcurementQty = returnDTO.Qty;
                    }
                }
                #endregion
                #region  除
                if (bpObj.ActionType == 1)
                {
                    foreach (ReturnUpDownLineDto returnDTO in bpObj.InParams)
                    {
                        OrderBomBE.OrderBomHead head = OrderBomBE.OrderBomHead.Finder.FindByID(returnDTO.SoID.ID);
                        head.Remove();
                    }
                }
                #endregion
                sesion.Commit();
            }
            return(null);
        }
Esempio n. 3
0
 /// <summary>
 /// Constructor with Full Argument
 /// </summary>
 public CostForecastDTO(System.Int64 iD, System.DateTime createdOn, System.String createdBy, System.DateTime modifiedOn, System.String modifiedBy, System.Int64 sysVersion, UFIDA.U9.Cust.GS.FT.AllEnumBE.CostForecastTypeEnum forecastType, UFIDA.U9.SM.SO.SO sONo, UFIDA.U9.SM.SO.SOLine sOLine, System.DateTime forecastTime, System.String forecastMan, System.Decimal brokerage, System.Decimal discount, System.Decimal oceanFreight, System.Decimal otherFee, System.Decimal taxCredits, System.Decimal procurementCost, System.Decimal labourCharges, System.Decimal productCost, System.Decimal administrativeFee, System.Decimal interest, System.Decimal mouldFee, System.Decimal labelling, System.Decimal creditInsurance, System.Decimal bankCharge, System.Decimal productForecastRate, System.Decimal listForecastRate, System.Decimal productRate, System.Decimal listRate, System.Decimal exchangeRate, UFIDA.U9.Base.FlexField.DescFlexField.DescFlexSegments descflexfield, System.String demo, UFIDA.U9.Base.Currency.Currency currency, System.Decimal domesticFee, System.Decimal otherDomesticFee, UFIDA.U9.Cust.GS.FT.OrderBomBE.OrderBomHead orderBomHead, System.Decimal managementFee, System.Decimal annualInterest, System.Decimal rMBProductCost, System.Decimal dollorProductCost)
 {
     this.ID                  = iD;
     this.CreatedOn           = createdOn;
     this.CreatedBy           = createdBy;
     this.ModifiedOn          = modifiedOn;
     this.ModifiedBy          = modifiedBy;
     this.SysVersion          = sysVersion;
     this.ForecastType        = forecastType;
     this.SONo                = sONo;
     this.SOLine              = sOLine;
     this.ForecastTime        = forecastTime;
     this.ForecastMan         = forecastMan;
     this.Brokerage           = brokerage;
     this.Discount            = discount;
     this.OceanFreight        = oceanFreight;
     this.OtherFee            = otherFee;
     this.TaxCredits          = taxCredits;
     this.ProcurementCost     = procurementCost;
     this.LabourCharges       = labourCharges;
     this.ProductCost         = productCost;
     this.AdministrativeFee   = administrativeFee;
     this.Interest            = interest;
     this.MouldFee            = mouldFee;
     this.Labelling           = labelling;
     this.CreditInsurance     = creditInsurance;
     this.BankCharge          = bankCharge;
     this.ProductForecastRate = productForecastRate;
     this.ListForecastRate    = listForecastRate;
     this.ProductRate         = productRate;
     this.ListRate            = listRate;
     this.ExchangeRate        = exchangeRate;
     this.Descflexfield       = descflexfield;
     this.Demo                = demo;
     this.Currency            = currency;
     this.DomesticFee         = domesticFee;
     this.OtherDomesticFee    = otherDomesticFee;
     this.OrderBomHead        = orderBomHead;
     this.ManagementFee       = managementFee;
     this.AnnualInterest      = annualInterest;
     this.RMBProductCost      = rMBProductCost;
     this.DollorProductCost   = dollorProductCost;
 }
Esempio n. 4
0
 private static OrderBomLine CreateDefault_Extend(UFIDA.U9.Cust.GS.FT.OrderBomBE.OrderBomHead parentEntity)
 {
     //TODO delete next code and add your custome code here
     throw new NotImplementedException();
 }