Exemplo n.º 1
0
        private void OKBtn_Click(object sender, EventArgs e)
        {
            // first, select priorities
            IDDSelectPrimaryAM x = new IDDSelectPrimaryAM(am);

            if (x.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                AnalysisMethods original;
                bool            found = NC.App.DB.DetectorMaterialAnalysisMethods.TryGetValue(am.selector, out original);
                if (found)
                {
                    if (!am.Equals(original)) // an existing has changed,
                    {
                        // copy updated changes back to original on the map
                        original.CopySettings(am);
                        NC.App.DB.UpdateAnalysisMethods(original.selector, am);
                        NC.App.DB.UpdateAnalysisMethodSpecifics(original.selector.detectorid, original.selector.material);
                        original.modified = false;
                    }
                    else if (am.modified) //  or created new one
                    {
                        NC.App.DB.UpdateAnalysisMethods(original.selector, am);
                        NC.App.DB.UpdateAnalysisMethodSpecifics(original.selector.detectorid, original.selector.material);
                        original.modified = false;
                    }

                    this.Close();
                }
            }
        }
Exemplo n.º 2
0
        private void OKBtn_Click(object sender, EventArgs e)
        {
            // First, check if selections changed.
            AnalysisMethods original;
            bool            found = NC.App.DB.DetectorMaterialAnalysisMethods.TryGetValue(am.selector, out original);

            if (found)
            {
                if (original.selector == null) // empty initial value, copy the selector here
                {
                    original.selector = new INCCSelector(am.selector);
                }
                if (!am.Equals(original)) // an existing has changed,
                {
                    // copy updated changes back to original on the map
                    original.CopySettings(am);
                    NC.App.DB.UpdateAnalysisMethods(original.selector, am);
                    NC.App.DB.UpdateAnalysisMethodSpecifics(original.selector.detectorid, original.selector.material);
                    original.modified = false;
                }
                else if (am.modified) //  or created new one
                {
                    NC.App.DB.UpdateAnalysisMethods(original.selector, am);
                    NC.App.DB.UpdateAnalysisMethodSpecifics(original.selector.detectorid, original.selector.material);
                    original.modified = false;
                }
            }

            // first, select priorities
            if (am.AnySelected())
            {
                IDDSelectPrimaryAM x = new IDDSelectPrimaryAM(ref am);

                if (x.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                {
                    if (am.modified)
                    {
                        NC.App.DB.UpdateAnalysisMethods(am.selector, am);
                        NC.App.DB.UpdateAnalysisMethodSpecifics(am.selector.detectorid, original.selector.material);
                    }
                    AnalysisMethods original2;
                    bool            found2 = NC.App.DB.DetectorMaterialAnalysisMethods.TryGetValue(am.selector, out original2);
                    if (found2)
                    {
                        if (original2.selector == null) // empty initial value, copy the selector here
                        {
                            original2.selector = new INCCSelector(am.selector);
                        }
                        if (!am.Equals(original2)) // an existing has changed,
                        {
                            // copy updated changes back to original on the map
                            original2.CopySettings(am);
                            NC.App.DB.UpdateAnalysisMethods(original2.selector, am);
                            NC.App.DB.UpdateAnalysisMethodSpecifics(original2.selector.detectorid, original.selector.material);
                            original2.modified = false;
                        }
                        else if (am.modified) //  or created new one
                        {
                            NC.App.DB.UpdateAnalysisMethods(original2.selector, am);
                            NC.App.DB.UpdateAnalysisMethodSpecifics(original2.selector.detectorid, original.selector.material);
                            original2.modified = false;
                        }
                    }
                }
            }
            this.Close();
        }
Exemplo n.º 3
0
        private void OKBtn_Click(object sender, EventArgs e)
        {
            // first, select priorities
            IDDSelectPrimaryAM x = new IDDSelectPrimaryAM(am);
            if (x.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                AnalysisMethods original;
                bool found = NC.App.DB.DetectorMaterialAnalysisMethods.TryGetValue(am.selector, out original);
                if (found)
                {
                    if (!am.Equals(original)) // an existing has changed,
                    {
                        // copy updated changes back to original on the map
                        original.CopySettings(am);
                        NC.App.DB.UpdateAnalysisMethods(original.selector, am);
                        NC.App.DB.UpdateAnalysisMethodSpecifics(original.selector.detectorid,original.selector.material);
                        original.modified = false;
                    }
                    else if (am.modified) //  or created new one
                    {
                        NC.App.DB.UpdateAnalysisMethods(original.selector, am);
                        NC.App.DB.UpdateAnalysisMethodSpecifics(original.selector.detectorid, original.selector.material);
                        original.modified = false;
                    }

                    this.Close();
                }
            }
        }