Beispiel #1
0
        // can use IList interface on this
        public DataTable GetACollection(Pieces p, String did = null)
        {
            DataTable dt = new DataTable();

            try
            {
                switch (p)
                {
                    default:
                        break;

                    case Pieces.HVParams:
                        HVParams hv = new HVParams();
                        dt = hv.Get(did);
                        break;
                    case Pieces.HVResults:
                        HVPlateauResults hvr = new HVPlateauResults();
                        dt = hvr.AllHVPlateauResults(did);
                        break;
                    case Pieces.Measurements:
                        Measurements ms = new Measurements();
                        dt = ms.AllMeasurements(did);
                        break;
                    case Pieces.CountingAnalyzers:
                        CountingAnalysisParameters cap = new CountingAnalysisParameters();
                        dt = cap.AnalyzerParamsForDetector(did);
                        break;

                    case Pieces.AnalysisMethodSpecifiers:
                        using(AnalysisMethodSpecifiers am = new AnalysisMethodSpecifiers())
                        {
                            dt = am.MethodsForDetector(did);
                        }
                        
                        break;

                    case Pieces.Detectors:
                        Detectors clsD = new Detectors();
                        dt = clsD.getDetectors(true);
                        break;
                    case Pieces.LMParams:
                        LMNetCommParams blue = new LMNetCommParams();
                        dt = blue.Get(did);
                        break;
                    case Pieces.LMMultParams:
                        LMMultiplicityParams purple = new LMMultiplicityParams();
                        dt = purple.Get(did);
                        break;
                    case Pieces.DetectorTypes:
                        Descriptors clsDT = new Descriptors("detector_types");
                        dt = clsDT.getDescs();
                        break;
                    case Pieces.Materials:
                        Descriptors clsMtl = new Descriptors("material_types");
                        dt = clsMtl.getDescs();
                        break;
                    case Pieces.TestParams:
                        TestParams tp = new TestParams();
                        dt = tp.Get();
                        break;
                    case Pieces.NormParams:
                        NormParams np = new NormParams();
                        dt = np.Get(did);
                        break;
                    case Pieces.AASSetupParams:
                        AASSetupParams aass = new AASSetupParams();
                        dt = aass.Get(did);
                        break;
                    case Pieces.BackgroundParams:
                        BackgroundParams clsB = new BackgroundParams();
                        TruncatedBackgroundParams clsTB = new TruncatedBackgroundParams();
                        dt = clsB.Get(did);
                        DataTable dt2 = clsTB.Get(did);
                        dt.Merge(dt2);
                        break;  // next: caution, should use select/join
                    case Pieces.Facilities:
                        Descriptors clsF = new Descriptors("facility_names");
                        dt = clsF.getDescs();
                        break;
                    case Pieces.MBAs:
                        Descriptors MBA = new Descriptors(p.ToString());
                        dt = MBA.getDescs();
                        break;
                    case Pieces.Items:
                        Items clsI = new Items();
                        dt = clsI.getItems();
                        break;
                    case Pieces.CollarItems:
                        CollarItems clsCI = new CollarItems();
                        dt = clsCI.getItems();
                        break;
                    case Pieces.Isotopics:
                        Isotopics clsIs = new Isotopics();
                        dt = clsIs.getIsotopics();
                        break;
                    case Pieces.Strata:
                        Strata s = new Strata();
                        dt = s.Get();
                        break;
                    case Pieces.StrataWithAssoc:
                        Strata ss = new Strata();
                        dt = ss.GetAssociations(did);
                        break;
                    case Pieces.AcquireParams:
                        AcquireParams aq = new AcquireParams();
                        dt = aq.Get(did);
                        break;
                    case Pieces.IOCodes:
                        Descriptors ioc = new Descriptors("io_code");
                        dt = ioc.getDescs();
                        break;
                    case Pieces.InvChangeCodes:
                        Descriptors icc = new Descriptors("inventory_change_code");
                        dt = icc.getDescs();    
                        break;
                    case Pieces.UnattendedParams:
                        UnattendParams u = new UnattendParams();
                        dt = u.Get(did);
                        break;
                    case Pieces.CmPuRatioParams:
                        cm_pu_ratio_rec cpu = new cm_pu_ratio_rec();
                        dt = cpu.Get();
                        break;
                    case Pieces.Results:
                        Results rr = new Results();
                        dt = rr.AllResults(did);
                        break;

                }
            }
            catch (Exception caught)
            {
                DBMain.AltLog(LogLevels.Warning, 70191, "Get Collection  '" + caught.Message + "' ");
            }
            return dt;
        }
Beispiel #2
0
        // can use IList interface on this
        public DataTable GetACollection(Pieces p, String did = null)
        {
            DataTable dt = new DataTable();

            try
            {
                switch (p)
                {
                default:
                    break;

                case Pieces.HVParams:
                    HVParams hv = new HVParams();
                    dt = hv.Get(did);
                    break;

                case Pieces.HVResults:
                    HVPlateauResults hvr = new HVPlateauResults();
                    dt = hvr.AllHVPlateauResults(did);
                    break;

                case Pieces.Measurements:
                    Measurements ms = new Measurements();
                    dt = ms.AllMeasurements(did);
                    break;

                case Pieces.CountingAnalyzers:
                    CountingAnalysisParameters cap = new CountingAnalysisParameters();
                    dt = cap.AnalyzerParamsForDetector(did);
                    break;

                case Pieces.AnalysisMethodSpecifiers:
                    using (AnalysisMethodSpecifiers am = new AnalysisMethodSpecifiers())
                    {
                        dt = am.MethodsForDetector(did);
                    }

                    break;

                case Pieces.Detectors:
                    Detectors clsD = new Detectors();
                    dt = clsD.getDetectors(true);
                    break;

                case Pieces.LMParams:
                    LMNetCommParams blue = new LMNetCommParams();
                    dt = blue.Get(did);
                    break;

                case Pieces.LMMultParams:
                    LMMultiplicityParams purple = new LMMultiplicityParams();
                    dt = purple.Get(did);
                    break;

                case Pieces.DetectorTypes:
                    Descriptors clsDT = new Descriptors("detector_types");
                    dt = clsDT.getDescs();
                    break;

                case Pieces.Materials:
                    Descriptors clsMtl = new Descriptors("material_types");
                    dt = clsMtl.getDescs();
                    break;

                case Pieces.TestParams:
                    TestParams tp = new TestParams();
                    dt = tp.Get();
                    break;

                case Pieces.NormParams:
                    NormParams np = new NormParams();
                    dt = np.Get(did);
                    break;

                case Pieces.AASSetupParams:
                    AASSetupParams aass = new AASSetupParams();
                    dt = aass.Get(did);
                    break;

                case Pieces.BackgroundParams:
                    BackgroundParams          clsB  = new BackgroundParams();
                    TruncatedBackgroundParams clsTB = new TruncatedBackgroundParams();
                    dt = clsB.Get(did);
                    DataTable dt2 = clsTB.Get(did);
                    dt.Merge(dt2);
                    break;      // NEXT: caution, should use a select/join in the DB layer, instead of this datatable merge

                case Pieces.Facilities:
                    Descriptors clsF = new Descriptors("facility_names");
                    dt = clsF.getDescs();
                    break;

                case Pieces.MBAs:
                    Descriptors MBA = new Descriptors(p.ToString());
                    dt = MBA.getDescs();
                    break;

                case Pieces.Items:
                    Items clsI = new Items();
                    dt = clsI.getItems();
                    break;

                case Pieces.CollarItems:
                    CollarItems clsCI = new CollarItems();
                    dt = clsCI.getItems();
                    break;

                case Pieces.Isotopics:
                    Isotopics clsIs = new Isotopics();
                    dt = clsIs.getIsotopics();
                    break;

                case Pieces.Strata:
                    Strata s = new Strata();
                    dt = s.Get();
                    break;

                case Pieces.StrataWithAssoc:
                    Strata ss = new Strata();
                    dt = ss.GetAssociations(did);
                    break;

                case Pieces.AcquireParams:
                    AcquireParams aq = new AcquireParams();
                    dt = aq.Get(did);
                    break;

                case Pieces.IOCodes:
                    Descriptors ioc = new Descriptors("io_code");
                    dt = ioc.getDescs();
                    break;

                case Pieces.InvChangeCodes:
                    Descriptors icc = new Descriptors("inventory_change_code");
                    dt = icc.getDescs();
                    break;

                case Pieces.UnattendedParams:
                    UnattendParams u = new UnattendParams();
                    dt = u.Get(did);
                    break;

                case Pieces.CmPuRatioParams:
                    cm_pu_ratio_rec cpu = new cm_pu_ratio_rec();
                    dt = cpu.Get();
                    break;

                case Pieces.CollarParams:
                    collar_combined_rec combine = new collar_combined_rec();
                    dt = combine.GetCollar();
                    break;

                case Pieces.CollarDetectorParams:
                    combine = new collar_combined_rec();
                    dt      = combine.GetCollarDet();
                    break;

                case Pieces.CollarK5Params:
                    combine = new collar_combined_rec();
                    dt      = combine.GetK5();
                    break;

                case Pieces.Results:
                    Results rr = new Results();
                    dt = rr.AllResults(did);
                    break;

                case Pieces.CompositeIsotopics:
                    CompositeIsotopics clsCIs = new CompositeIsotopics();
                    dt = clsCIs.getCompositeIsotopics();
                    break;

                case Pieces.HoldupConfigs:
                    holdup_config_rec hc = new holdup_config_rec();
                    dt = hc.Get();
                    break;

                case Pieces.PoisonRods:
                    poison_rod_type_rec prt = new poison_rod_type_rec();
                    dt = prt.Get();
                    break;
                }
            }
            catch (Exception caught)
            {
                DBMain.AltLog(LogLevels.Warning, 70191, "Get Collection  '" + caught.Message + "' ");
            }
            return(dt);
        }