示例#1
0
        public virtual object clone(bool cloneAssembly, bool cloneLabor)
        {
            AssemblyLaborTable obj = new AssemblyLaborTable();

            obj.AssemblyLaborId = AssemblyLaborId;
            obj.LastUpdate      = LastUpdate;

            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.LaborTableId       = LaborTableId;
            obj.ProjectId          = ProjectId;
            obj.FixedCost          = FixedCost;
            obj.Comment            = Comment;
            obj.PvVars             = PvVars;

            obj.UnitHours = UnitHours;

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

            try
            {
                obj.FinalIKARate = calculateFinalIKARate();
            }
            catch (System.NullReferenceException)
            {
                // ignore!
            }

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

            if (LaborTable != null && cloneLabor)
            {
                obj.LaborTable = (LaborTable)LaborTable.Clone();
            }

            return(obj);
        }
        public virtual AssemblyTable[] getAssemblysDeepCopy(bool removeIds)
        {
            AssemblyTable[] copy = new AssemblyTable[_o_items.Length];
            for (int i = 0; i < _o_items.Length; i++)
            {
                copy[i] = (AssemblyTable)_o_items[i].deepCopy(removeIds);
            }

            return(copy);
        }
        public virtual object clone(bool cloneAssembly, bool cloneEquipment)
        {
            AssemblyEquipmentTable obj = new AssemblyEquipmentTable();

            obj.AssemblyEquipmentId = AssemblyEquipmentId;
            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.EnergyPrice        = EnergyPrice;
            obj.ExchangeRate       = ExchangeRate;
            obj.FuelRate           = FuelRate;
            obj.EquipmentTableId   = EquipmentTableId;
            obj.ProjectId          = ProjectId;
            obj.FixedCost          = FixedCost;
            obj.Comment            = Comment;

            obj.PvVars = PvVars;

            obj.UnitHours = UnitHours;

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

            try
            {
                obj.FinalFuelRate = calculateFinalFuelRate();
            }
            catch (System.NullReferenceException)
            {
                // ignore!
            }

            try
            {
                obj.FinalDepreciationRate = calculateFinalDepreciationRate();
            }
            catch (System.NullReferenceException)
            {
                // ignore!
            }

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

            if (EquipmentTable != null && cloneEquipment)
            {
                obj.EquipmentTable = (EquipmentTable)EquipmentTable.Clone();
            }

            return(obj);
        }