Exemple #1
0
 private void GenerateProdBom()
 {
     //using (UnitOfWork uow = (UnitOfWork)Session)
     //{
     if (Item != null)
     {
         foreach (BomLine bomLine in Item.BomLines)
         {
             //ProdBom prodBom = new ProdBom(uow);
             ProdBom prodBom = new ProdBom(Session);
             prodBom.bomItem = bomLine.BomItem;
             prodBom.ConstantScrap = bomLine.ConstantScrap;
             prodBom.LineType = bomLine.LineType;
             prodBom.PerSeries = bomLine.PerSeries;
             prodBom.ProdOrder = this;
             prodBom.Qty = bomLine.Qty;
             prodBom.Unit = bomLine.Unit;
             prodBom.VariableScrap = bomLine.VariableScrap;
             prodBom.Warehouse = this.Warehouse;
             prodBom.Save();
         }
     }
     //uow.CommitChanges();
     //}
 }
Exemple #2
0
 public WIPProdBom(Session session, ProdBom pBom)
     : base(session)
 {
     _ProdBom = pBom;
     OnChanged("ProdBom");
 }
        public void SetProdBom(ProdBom prodBom)
        {
            _ProdBom = prodBom;

            if (_ProdOrder != _ProdBom.ProdOrder)
            {
                _ProdOrder = _ProdBom.ProdOrder;
                OnChanged("ProdOrder");
            }

            if (_Item != _ProdBom.bomItem)
            {
                _Item = _ProdBom.bomItem;
                OnChanged("Item");
            }

            Warehouse = prodBom.Warehouse;
            this.Qty = prodBom.RemainReturnQty;
        }