Exemplo n.º 1
0
        private void btnCopy_Click(object sender, EventArgs e)
        {
            if (lvOptimizerScenario.SelectedItems.Count == 0)
            {
                return;
            }
            int          x      = 0;
            string       strMsg = "Copy scenario properties\r\n\r\nFROM\r\n-------\r\n" + lvOptimizerScenario.SelectedItems[0].SubItems[1].Text.Trim() + "\r\n\r\nTO\r\n-------\r\n" + ReferenceCurrentScenarioItem.ScenarioId;
            DialogResult result = MessageBox.Show(strMsg, "FIA Biosum", MessageBoxButtons.YesNo, MessageBoxIcon.Question);

            if (result == DialogResult.Yes)
            {
                CheckIfScenarioLoaded(lvOptimizerScenario.SelectedItems[0].SubItems[1].Text.Trim(), out x);

                this.m_oOptimizerScenarioItem = m_oOptimizerScenarioItem_Collection.Item(x);

                ReferenceCurrentScenarioItem.Description           = m_oOptimizerScenarioItem.Description;
                ReferenceCurrentScenarioItem.Notes                 = m_oOptimizerScenarioItem.Notes;
                ReferenceCurrentScenarioItem.m_oCondTableSQLFilter = m_oOptimizerScenarioItem.m_oCondTableSQLFilter;
                ReferenceCurrentScenarioItem.m_oEffectiveVariablesItem_Collection.Copy(m_oOptimizerScenarioItem.m_oEffectiveVariablesItem_Collection, ref ReferenceCurrentScenarioItem.m_oEffectiveVariablesItem_Collection, true);
                ReferenceCurrentScenarioItem.m_oOptimizationVariableItem_Collection.Copy(m_oOptimizerScenarioItem.m_oOptimizationVariableItem_Collection, ref ReferenceCurrentScenarioItem.m_oOptimizationVariableItem_Collection, true);
                ReferenceCurrentScenarioItem.m_oProcessingSiteItem_Collection.Copy(m_oOptimizerScenarioItem.m_oProcessingSiteItem_Collection, ref ReferenceCurrentScenarioItem.m_oProcessingSiteItem_Collection, true);
                ReferenceCurrentScenarioItem.m_oLastTieBreakRankItem_Collection.Copy(m_oOptimizerScenarioItem.m_oLastTieBreakRankItem_Collection, ref ReferenceCurrentScenarioItem.m_oLastTieBreakRankItem_Collection, true);
                ReferenceCurrentScenarioItem.m_oTieBreaker_Collection.Copy(m_oOptimizerScenarioItem.m_oTieBreaker_Collection, ref ReferenceCurrentScenarioItem.m_oTieBreaker_Collection, true);
                ReferenceCurrentScenarioItem.m_oTranCosts.Copy(m_oOptimizerScenarioItem.m_oTranCosts, ReferenceCurrentScenarioItem.m_oTranCosts);
                ReferenceCurrentScenarioItem.m_oProcessorScenarioItem_Collection.Copy(m_oOptimizerScenarioItem.m_oProcessorScenarioItem_Collection, ref ReferenceCurrentScenarioItem.m_oProcessorScenarioItem_Collection, true);
                ReferenceCurrentScenarioItem.OwnerGroupCodeList = m_oOptimizerScenarioItem.OwnerGroupCodeList;
                ReferenceCurrentScenarioItem.PlotTableSQLFilter = m_oOptimizerScenarioItem.PlotTableSQLFilter;

                _frmDialog.DialogResult = DialogResult.OK;
                _frmDialog.Close();
            }
        }
Exemplo n.º 2
0
        private void btnCopy_Click(object sender, EventArgs e)
        {
            if (lvProcessorScenario.SelectedItems.Count == 0)
            {
                return;
            }
            int          x      = 0;
            string       strMsg = "Copy scenario properties\r\n\r\nFROM\r\n-------\r\n" + lvProcessorScenario.SelectedItems[0].SubItems[1].Text.Trim() + "\r\n\r\nTO\r\n-------\r\n" + ReferenceCurrentScenarioItem.ScenarioId;
            DialogResult result = MessageBox.Show(strMsg, "FIA Biosum", MessageBoxButtons.YesNo, MessageBoxIcon.Question);

            if (result == DialogResult.Yes)
            {
                CheckIfScenarioLoaded(lvProcessorScenario.SelectedItems[0].SubItems[1].Text.Trim(), out x);

                this.m_oProcessorScenarioItem = m_oProcessorScenarioItem_Collection.Item(x);

                ReferenceCurrentScenarioItem.Description      = m_oProcessorScenarioItem.Description;
                ReferenceCurrentScenarioItem.Notes            = m_oProcessorScenarioItem.Notes;
                ReferenceCurrentScenarioItem.SourceScenarioId = m_oProcessorScenarioItem.ScenarioId;

                ReferenceCurrentScenarioItem.m_oTreeDiamGroupsItem_Collection.Copy(m_oProcessorScenarioItem.m_oTreeDiamGroupsItem_Collection,
                                                                                   ref ReferenceCurrentScenarioItem.m_oTreeDiamGroupsItem_Collection, true);

                ReferenceCurrentScenarioItem.m_oEscalators.Copy(m_oProcessorScenarioItem.m_oEscalators, ReferenceCurrentScenarioItem.m_oEscalators);

                ReferenceCurrentScenarioItem.m_oHarvestCostItem_Collection.Copy(
                    m_oProcessorScenarioItem.m_oHarvestCostItem_Collection,
                    ref ReferenceCurrentScenarioItem.m_oHarvestCostItem_Collection, true);

                ReferenceCurrentScenarioItem.m_oHarvestMethod.Copy(m_oProcessorScenarioItem.m_oHarvestMethod, ReferenceCurrentScenarioItem.m_oHarvestMethod);

                ReferenceCurrentScenarioItem.m_oMoveInCosts.Copy(m_oProcessorScenarioItem.m_oMoveInCosts, ReferenceCurrentScenarioItem.m_oMoveInCosts);

                ReferenceCurrentScenarioItem.m_oTreeSpeciesAndDbhDollarValuesItem_Collection.Copy(
                    m_oProcessorScenarioItem.m_oTreeSpeciesAndDbhDollarValuesItem_Collection,
                    ref ReferenceCurrentScenarioItem.m_oTreeSpeciesAndDbhDollarValuesItem_Collection, true);

                ReferenceCurrentScenarioItem.m_oTreeDiamGroupsItem_Collection.Copy(
                    m_oProcessorScenarioItem.m_oTreeDiamGroupsItem_Collection,
                    ref ReferenceCurrentScenarioItem.m_oTreeDiamGroupsItem_Collection, true);

                ReferenceCurrentScenarioItem.m_oSpcGroupItem_Collection.Copy(
                    m_oProcessorScenarioItem.m_oSpcGroupItem_Collection,
                    ref ReferenceCurrentScenarioItem.m_oSpcGroupItem_Collection, true);

                ReferenceCurrentScenarioItem.m_oSpcGroupListItem_Collection.Copy(
                    m_oProcessorScenarioItem.m_oSpcGroupListItem_Collection,
                    ref ReferenceCurrentScenarioItem.m_oSpcGroupListItem_Collection, true);

                _frmDialog.DialogResult = DialogResult.OK;
                _frmDialog.Close();
            }
        }