Esempio n. 1
0
        private void comboBoxRatingType_SelectedIndexChanged(object sender, System.EventArgs e)
        {
            if (!this.inConstruction)
            {
                ErrorMessage error = null;
                int          idx   = this.comboBoxRatingType.SelectedIndex;

                HXRatingModelShellAndTube ratingModel = heatExchanger.CurrentRatingModel as HXRatingModelShellAndTube;
                if (idx == HXRatingShellAndTubeEditor.INDEX_BELL_DELAWARE)
                {
                    error = ratingModel.SpecifyShellRatingType(ShellRatingType.BellDelaware);
                    if (error == null)
                    {
                        this.hxRatingShellAndTubeBellDelawareLabelsControl.Visible = true;
                        this.hxRatingShellAndTubeBellDelawareValuesControl.Visible = true;
                        this.hxRatingShellAndTubeDonohueLabelsControl.Visible      = false;
                        this.hxRatingShellAndTubeDonohueValuesControl.Visible      = false;
                        this.hxRatingShellAndTubeKernLabelsControl.Visible         = false;
                        this.hxRatingShellAndTubeKernValuesControl.Visible         = false;
                    }
                }
                else if (idx == HXRatingShellAndTubeEditor.INDEX_DONOHUE)
                {
                    error = ratingModel.SpecifyShellRatingType(ShellRatingType.Donohue);
                    if (error == null)
                    {
                        this.hxRatingShellAndTubeBellDelawareLabelsControl.Visible = false;
                        this.hxRatingShellAndTubeBellDelawareValuesControl.Visible = false;
                        this.hxRatingShellAndTubeDonohueLabelsControl.Visible      = true;
                        this.hxRatingShellAndTubeDonohueValuesControl.Visible      = true;
                        this.hxRatingShellAndTubeKernLabelsControl.Visible         = false;
                        this.hxRatingShellAndTubeKernValuesControl.Visible         = false;
                    }
                }
                else if (idx == HXRatingShellAndTubeEditor.INDEX_KERN)
                {
                    error = ratingModel.SpecifyShellRatingType(ShellRatingType.Kern);
                    if (error == null)
                    {
                        this.hxRatingShellAndTubeBellDelawareLabelsControl.Visible = false;
                        this.hxRatingShellAndTubeBellDelawareValuesControl.Visible = false;
                        this.hxRatingShellAndTubeDonohueLabelsControl.Visible      = false;
                        this.hxRatingShellAndTubeDonohueValuesControl.Visible      = false;
                        this.hxRatingShellAndTubeKernLabelsControl.Visible         = true;
                        this.hxRatingShellAndTubeKernValuesControl.Visible         = true;
                    }
                }

                if (error != null)
                {
                    UI.ShowError(error);
                    this.SetRatingType(ratingModel.ShellRatingType);
                }
            }
        }