Ejemplo n.º 1
0
        public override BaseTable[] cloneBaseTables()
        {
            MaterialTable[] copy = new MaterialTable[_o_items.Length];
            for (int i = 0; i < _o_items.Length; i++)
            {
                copy[i] = (MaterialTable)_o_items[i].copyWithSupplier();
            }

            return(copy);
        }
Ejemplo n.º 2
0
        public virtual object clone(bool cloneAssembly, bool cloneMaterial)
        {
            AssemblyMaterialTable obj = new AssemblyMaterialTable();

            obj.AssemblyMaterialId = AssemblyMaterialId;
            obj.LastUpdate         = LastUpdate;
            //obj.setFinalRate(getFinalRate());
            obj.Factor1 = Factor1;
            obj.Factor2 = Factor2;
            obj.Factor3 = Factor3;

            obj.QuantityPerUnit             = QuantityPerUnit;
            obj.QuantityPerUnitFormula      = QuantityPerUnitFormula;
            obj.QuantityPerUnitFormulaState = QuantityPerUnitFormulaState;

            obj.LocalFactor        = LocalFactor;
            obj.LocalCountry       = LocalCountry;
            obj.LocalStateProvince = LocalStateProvince;
            obj.ExchangeRate       = ExchangeRate;
            obj.MaterialTableId    = MaterialTableId;
            obj.ProjectId          = ProjectId;
            obj.FixedCost          = FixedCost;
            obj.Comment            = Comment;

            obj.PvVars = PvVars;

            try
            {
                obj.FinalRate      = calculateFinalRate();
                obj.FinalFixedCost = calculateFinalFixedCost();
            }
            catch (System.NullReferenceException)
            {
                // ignore!
            }

            if (AssemblyTable != null && cloneAssembly)
            {
                obj.AssemblyTable = (AssemblyTable)AssemblyTable.clone();
            }

            if (MaterialTable != null && cloneMaterial)
            {
                obj.MaterialTable = (MaterialTable)MaterialTable.Clone();
            }

            return(obj);
        }
Ejemplo n.º 3
0
        public virtual SupplierTable copyWithMaterials()
        {
            SupplierTable obj = (SupplierTable)clone();

            if (MaterialSet != null)
            {
                obj.materialSet = new HashSet <object>();
                System.Collections.IEnumerator iter = materialSet.GetEnumerator();
                while (iter.MoveNext())
                {
                    MaterialTable curMat = (MaterialTable)iter.Current;
                    obj.materialSet.Add((MaterialTable)curMat.Clone());
                }
            }

            return(obj);
        }