当前位置: 首页>>代码示例>>C#>>正文


C# OpenEnvironmentEntities.AddToT_WQX_IMPORT_TEMP_RESULT方法代码示例

本文整理汇总了C#中OpenEnvironment.App_Logic.DataAccessLayer.OpenEnvironmentEntities.AddToT_WQX_IMPORT_TEMP_RESULT方法的典型用法代码示例。如果您正苦于以下问题:C# OpenEnvironmentEntities.AddToT_WQX_IMPORT_TEMP_RESULT方法的具体用法?C# OpenEnvironmentEntities.AddToT_WQX_IMPORT_TEMP_RESULT怎么用?C# OpenEnvironmentEntities.AddToT_WQX_IMPORT_TEMP_RESULT使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在OpenEnvironment.App_Logic.DataAccessLayer.OpenEnvironmentEntities的用法示例。


在下文中一共展示了OpenEnvironmentEntities.AddToT_WQX_IMPORT_TEMP_RESULT方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: InsertWQX_IMPORT_TEMP_RESULT_New


//.........这里部分代码省略.........
                            a.LOWER_QUANT_LIMIT = rco.DEFAULT_LOWER_QUANT_LIMIT;

                        //if still null, then error
                        if (a.LOWER_QUANT_LIMIT == null)
                        { a.IMPORT_STATUS_CD = "F"; a.IMPORT_STATUS_DESC += "No Lower Quantification limit reported or default value specified. "; }
                    }

                    if (string.IsNullOrEmpty(a.BIO_INTENT_NAME) != string.IsNullOrEmpty(a.BIO_SUBJECT_TAXONOMY))
                        if (string.IsNullOrEmpty(a.BIO_SUBJECT_TAXONOMY)) { a.IMPORT_STATUS_CD = "F"; a.IMPORT_STATUS_DESC += "Taxonomy must be reported when bio intent is reported. "; }

                    //analysis method
                    if (a.ANALYTIC_METHOD_IDX == null)
                    {
                        //if ID is supplied but Context is not, set context to org id
                        if (!string.IsNullOrEmpty(a.ANALYTIC_METHOD_ID) && string.IsNullOrEmpty(a.ANALYTIC_METHOD_CTX))
                            a.ANALYTIC_METHOD_CTX = orgID;

                        //if we now have values for the ID and context
                        if (!string.IsNullOrEmpty(a.ANALYTIC_METHOD_ID) && !string.IsNullOrEmpty(a.ANALYTIC_METHOD_CTX))
                        {
                            //see if matching collection method exists
                            T_WQX_REF_ANAL_METHOD am = db_Ref.GetT_WQX_REF_ANAL_METHODByIDandContext(a.ANALYTIC_METHOD_ID, a.ANALYTIC_METHOD_CTX);
                            if (am != null)
                                a.ANALYTIC_METHOD_IDX = am.ANALYTIC_METHOD_IDX;
                            else  //no matching anal method lookup found
                                { a.IMPORT_STATUS_CD = "F"; a.IMPORT_STATUS_DESC += "No matching Analysis Method found - please add it at the Reference Data screen first. "; }
                        }
                        else
                        {
                            //if IDX, ID, and Context not supplied, lookup the method from the default Org Char reference list
                            T_WQX_REF_CHAR_ORG rco = db_Ref.GetT_WQX_REF_CHAR_ORGByName(orgID, a.CHAR_NAME);
                            if (rco != null)
                            {
                                a.ANALYTIC_METHOD_IDX = rco.DEFAULT_ANAL_METHOD_IDX;
                                if (rco.DEFAULT_ANAL_METHOD_IDX != null)
                                {
                                    T_WQX_REF_ANAL_METHOD anal = db_Ref.GetT_WQX_REF_ANAL_METHODByIDX(rco.DEFAULT_ANAL_METHOD_IDX.ConvertOrDefault<int>());
                                    if (anal != null)
                                    {
                                        a.ANALYTIC_METHOD_ID = anal.ANALYTIC_METHOD_ID;
                                        a.ANALYTIC_METHOD_NAME = anal.ANALYTIC_METHOD_NAME;
                                        a.ANALYTIC_METHOD_CTX = anal.ANALYTIC_METHOD_CTX;
                                    }
                                }
                            }
                        }
                    }

                    if (!string.IsNullOrEmpty(a.LAB_NAME))
                    {
                        T_WQX_REF_LAB lab = db_Ref.GetT_WQX_REF_LAB_ByIDandContext(a.LAB_NAME, orgID);
                        if (lab != null)
                            a.LAB_IDX = lab.LAB_IDX;
                        else
                        { a.IMPORT_STATUS_CD = "F"; a.IMPORT_STATUS_DESC += "No matching Lab Name found - please add it at the Reference Data screen first. "; }
                    }

                    //if result is PAQL, but no value has been reported for MDL, LRL, PQL, or Lower Quant Limit, then grab from Org Char default
                    if (a.RESULT_DETECT_CONDITION == "Present Above Quantification Limit" && string.IsNullOrEmpty(a.METHOD_DETECTION_LEVEL) && string.IsNullOrEmpty(a.LAB_REPORTING_LEVEL) && string.IsNullOrEmpty(a.PQL) && string.IsNullOrEmpty(a.UPPER_QUANT_LIMIT))
                    {
                        T_WQX_REF_CHAR_ORG rco = db_Ref.GetT_WQX_REF_CHAR_ORGByName(orgID, a.CHAR_NAME);
                        if (rco != null)
                            a.UPPER_QUANT_LIMIT = rco.DEFAULT_UPPER_QUANT_LIMIT;

                        //if still null, then error
                        if (a.UPPER_QUANT_LIMIT == null)
                        { a.IMPORT_STATUS_CD = "F"; a.IMPORT_STATUS_DESC += "No Upper Quantification limit reported. "; }
                    }

                    //put in Timezone if missing
                    if (a.LAB_ANALYSIS_START_DT != null || a.LAB_ANALYSIS_END_DT != null)
                        a.LAB_ANALYSIS_TIMEZONE = Utils.GetWQXTimeZoneByDate(a.LAB_ANALYSIS_START_DT.ConvertOrDefault<DateTime>());

                    //********** LAB SAMPLE PREP*************************
                    if (a.LAB_SAMP_PREP_IDX == null && !string.IsNullOrEmpty(a.LAB_SAMP_PREP_ID))
                    {
                        //set context to org id if none is provided
                        if (string.IsNullOrEmpty(a.LAB_SAMP_PREP_CTX))
                            a.LAB_SAMP_PREP_CTX = orgID;

                        //see if matching lab prep method exists for this org
                        T_WQX_REF_SAMP_PREP ppp = db_Ref.GetT_WQX_REF_SAMP_PREP_ByIDandContext(a.LAB_SAMP_PREP_ID, a.LAB_SAMP_PREP_CTX);
                        if (ppp != null)
                            a.LAB_SAMP_PREP_IDX = ppp.SAMP_PREP_IDX;
                        else
                        { a.IMPORT_STATUS_CD = "F"; a.IMPORT_STATUS_DESC += "No matching Lab Sample Prep ID found - please add it at the Reference Data screen first. ";  }
                    }

                    a.IMPORT_STATUS_DESC = a.IMPORT_STATUS_DESC.SubStringPlus(0, 200);
                    ctx.AddToT_WQX_IMPORT_TEMP_RESULT(a);
                    ctx.SaveChanges();

                    return a.TEMP_RESULT_IDX;
                }
                catch (Exception ex)
                {
                    return 0;
                }
            }
        }
开发者ID:open-environment,项目名称:open-waters,代码行数:101,代码来源:db_WQX.cs

示例2: InsertOrUpdateWQX_IMPORT_TEMP_RESULT


//.........这里部分代码省略.........
                    if (rESULT_DETECT_CONDITION == "Present Below Quantification Limit" && string.IsNullOrEmpty(mETHOD_DETECTION_LEVEL) && string.IsNullOrEmpty(lAB_REPORTING_LEVEL) && string.IsNullOrEmpty(pQL) && string.IsNullOrEmpty(lOWER_QUANT_LIMIT))
                    {
                        T_WQX_REF_CHAR_ORG rco = db_Ref.GetT_WQX_REF_CHAR_ORGByName(orgID, cHAR_NAME);
                        if (rco != null)
                            a.LOWER_QUANT_LIMIT = rco.DEFAULT_LOWER_QUANT_LIMIT;

                        //if still null, then error
                        if (a.LOWER_QUANT_LIMIT == null)
                            { sTATUS_CD = "F"; sTATUS_DESC += "No Lower Quantification limit reported or default value specified. "; }
                    }

                    if (!string.IsNullOrEmpty(uPPER_QUANT_LIMIT))
                        a.UPPER_QUANT_LIMIT = uPPER_QUANT_LIMIT.Trim().SubStringPlus(0, 12);

                    //if result is PAQL, but no value has been reported for MDL, LRL, PQL, or Lower Quant Limit, then grab from Org Char default
                    if (rESULT_DETECT_CONDITION == "Present Above Quantification Limit" && string.IsNullOrEmpty(mETHOD_DETECTION_LEVEL) && string.IsNullOrEmpty(lAB_REPORTING_LEVEL) && string.IsNullOrEmpty(pQL) && string.IsNullOrEmpty(uPPER_QUANT_LIMIT))
                    {
                        T_WQX_REF_CHAR_ORG rco = db_Ref.GetT_WQX_REF_CHAR_ORGByName(orgID, cHAR_NAME);
                        if (rco != null)
                            a.UPPER_QUANT_LIMIT = rco.DEFAULT_UPPER_QUANT_LIMIT;

                        //if still null, then error
                        if (a.UPPER_QUANT_LIMIT == null)
                        { sTATUS_CD = "F"; sTATUS_DESC += "No Upper Quantification limit reported. "; }
                    }

                    if (!string.IsNullOrEmpty(dETECTION_LIMIT_UNIT))
                    {
                        if (db_Ref.GetT_WQX_REF_DATA_ByKey("MeasureUnit", dETECTION_LIMIT_UNIT.Trim()) == false) { sTATUS_CD = "F"; sTATUS_DESC += "Detection Level Unit not valid. "; }
                        a.DETECTION_LIMIT_UNIT = dETECTION_LIMIT_UNIT.Trim().SubStringPlus(0, 12);
                    }

                    //********** LAB SAMPLE PREP
                    if (lAB_SAMP_PREP_IDX != null)
                        a.LAB_SAMP_PREP_IDX = lAB_SAMP_PREP_IDX;
                    else
                    {
                        if (!string.IsNullOrEmpty(lAB_SAMP_PREP_ID))
                        {
                            //set context to org id if none is provided
                            if (string.IsNullOrEmpty(lAB_SAMP_PREP_CTX))
                                lAB_SAMP_PREP_CTX = orgID;

                            a.LAB_SAMP_PREP_ID = lAB_SAMP_PREP_ID.Trim().SubStringPlus(0, 20);
                            a.LAB_SAMP_PREP_CTX = lAB_SAMP_PREP_CTX.Trim().SubStringPlus(0, 120);

                            //see if matching lab prep method exists for this org
                            T_WQX_REF_SAMP_PREP ppp = db_Ref.GetT_WQX_REF_SAMP_PREP_ByIDandContext(lAB_SAMP_PREP_ID, lAB_SAMP_PREP_CTX);
                            if (ppp == null) //no match found
                            {
                                if (autoImportRefDataInd == true)
                                {
                                    db_Ref.InsertOrUpdateT_WQX_REF_SAMP_PREP(null, lAB_SAMP_PREP_ID.Trim(), lAB_SAMP_PREP_CTX.Trim(), lAB_SAMP_PREP_ID.Trim(), "", true);
                                }
                                else
                                { sTATUS_CD = "F"; sTATUS_DESC += "No matching Lab Sample Prep ID found - please add it at the Reference Data screen first. "; }
                            }
                            else  //match found
                                a.LAB_SAMP_PREP_IDX = ppp.SAMP_PREP_IDX;

                        }
                    }

                    if (lAB_SAMP_PREP_START_DT != null)
                    {
                        //fix improperly formatted datetime
                        if (lAB_SAMP_PREP_START_DT.ConvertOrDefault<DateTime>().Year < 1900)
                            lAB_SAMP_PREP_START_DT = null;

                        a.LAB_SAMP_PREP_START_DT = lAB_SAMP_PREP_START_DT;
                    }

                    if (lAB_SAMP_PREP_END_DT != null)
                    {
                        //fix improperly formatted datetime
                        if (lAB_SAMP_PREP_END_DT.ConvertOrDefault<DateTime>().Year < 1900)
                            lAB_SAMP_PREP_END_DT = null;

                        a.LAB_SAMP_PREP_END_DT = lAB_SAMP_PREP_END_DT;
                    }

                    if (!string.IsNullOrEmpty(dILUTION_FACTOR))
                        a.DILUTION_FACTOR = dILUTION_FACTOR.Trim().SubStringPlus(0, 12);

                    if (sTATUS_CD != null) a.IMPORT_STATUS_CD = sTATUS_CD;
                    if (sTATUS_DESC != null) a.IMPORT_STATUS_DESC = sTATUS_DESC.SubStringPlus(0,100);

                    if (insInd) //insert case
                        ctx.AddToT_WQX_IMPORT_TEMP_RESULT(a);

                    ctx.SaveChanges();

                    return a.TEMP_RESULT_IDX;
                }
                catch (Exception ex)
                {
                    return 0;
                }
            }
        }
开发者ID:open-environment,项目名称:open-waters,代码行数:101,代码来源:db_WQX.cs


注:本文中的OpenEnvironment.App_Logic.DataAccessLayer.OpenEnvironmentEntities.AddToT_WQX_IMPORT_TEMP_RESULT方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。