//RESULTS HANDLING ************************************************************************************ private void PopulateResultsGrid() { try { //display metrics grid pnlMetrics.Visible = grdMetrics.Rows.Count > 0 || ddlEntryType.SelectedValue == "H" || ddlEntryType.SelectedValue == "T"; //allow edit for some (last column) grdResults.Columns[grdResults.Columns.Count-1].Visible = btnSave.Visible; //taxon counts display grdResults.Columns[2].Visible = ddlEntryType.SelectedValue == "T"; grdResults.Columns[14].Visible = ddlEntryType.SelectedValue == "T"; grdResults.Columns[15].Visible = ddlEntryType.SelectedValue == "T"; grdResults.ShowFooter = true; grdResults.DataSource = db_WQX.GetT_WQX_RESULT(Session["ActivityIDX"].ConvertOrDefault<int>()); grdResults.DataBind(); //if there is no data, then fill in an empty row and hide the footer (stupid work around) if (grdResults.Rows.Count == 0) { List<T_WQX_RESULT> rows = new List<T_WQX_RESULT>(); T_WQX_RESULT row = new T_WQX_RESULT(); row.ACTIVITY_IDX = Session["ActivityIDX"].ConvertOrDefault<int>(); row.CHAR_NAME = ""; row.DETECTION_LIMIT = ""; row.RESULT_MSR = ""; row.RESULT_MSR_UNIT = ""; rows.Add(row); grdResults.ShowFooter = false; grdResults.DataSource = rows; grdResults.DataBind(); } } catch { lblMsg.Text = "Error displaying results."; } }
/// <summary> /// Create a new T_WQX_RESULT object. /// </summary> /// <param name="rESULT_IDX">Initial value of the RESULT_IDX property.</param> /// <param name="aCTIVITY_IDX">Initial value of the ACTIVITY_IDX property.</param> public static T_WQX_RESULT CreateT_WQX_RESULT(global::System.Int32 rESULT_IDX, global::System.Int32 aCTIVITY_IDX) { T_WQX_RESULT t_WQX_RESULT = new T_WQX_RESULT(); t_WQX_RESULT.RESULT_IDX = rESULT_IDX; t_WQX_RESULT.ACTIVITY_IDX = aCTIVITY_IDX; return t_WQX_RESULT; }
public static int DeleteT_WQX_RESULT(int ResultIDX) { using (OpenEnvironmentEntities ctx = new OpenEnvironmentEntities()) { try { T_WQX_RESULT r = new T_WQX_RESULT(); r = (from c in ctx.T_WQX_RESULT where c.RESULT_IDX == ResultIDX select c).FirstOrDefault(); ctx.DeleteObject(r); ctx.SaveChanges(); return 1; } catch { return 0; } } }
/// <summary> /// Deprecated Method for adding a new object to the T_WQX_RESULT EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToT_WQX_RESULT(T_WQX_RESULT t_WQX_RESULT) { base.AddObject("T_WQX_RESULT", t_WQX_RESULT); }
public static int InsertOrUpdateT_WQX_RESULT(global::System.Int32? rESULT_IDX, global::System.Int32 aCTIVITY_IDX, global::System.String rESULT_DETECT_CONDITION, global::System.String cHAR_NAME, global::System.String rESULT_SAMP_FRACTION, global::System.String rESULT_MSR, global::System.String rESULT_MSR_UNIT, global::System.String rESULT_STATUS, global::System.String rESULT_VALUE_TYPE, global::System.String rESULT_COMMENT, global::System.String bIO_INTENT_NAME, global::System.String bIO_INDIVIDUAL_ID, global::System.String bIO_TAXONOMY, global::System.String bIO_SAMPLE_TISSUE_ANATOMY, global::System.Int32? aNALYTIC_METHOD_IDX, int? lAB_IDX, DateTime? lAB_ANALYSIS_START_DT, global::System.String dETECTION_LIMIT, global::System.String pQL, global::System.String lOWER_QUANT_LIMIT, global::System.String uPPER_QUANT_LIMIT, int? lAB_SAMP_PREP_IDX, DateTime? lAB_SAMP_PREP_START_DT, string dILUTION_FACTOR, string fREQ_CLASS_CODE, string fREQ_CLASS_UNIT, String cREATE_USER = "******") { using (OpenEnvironmentEntities ctx = new OpenEnvironmentEntities()) { Boolean insInd = false; try { T_WQX_RESULT a = new T_WQX_RESULT(); if (rESULT_IDX != null) a = (from c in ctx.T_WQX_RESULT where c.RESULT_IDX == rESULT_IDX select c).FirstOrDefault(); if (a == null) a = new T_WQX_RESULT(); if (a.RESULT_IDX == 0) //insert case insInd = true; a.ACTIVITY_IDX = aCTIVITY_IDX; if (rESULT_DETECT_CONDITION != null) a.RESULT_DETECT_CONDITION = rESULT_DETECT_CONDITION; if (cHAR_NAME != null) a.CHAR_NAME = cHAR_NAME; if (rESULT_SAMP_FRACTION != null) a.RESULT_SAMP_FRACTION = rESULT_SAMP_FRACTION; if (rESULT_MSR != null) a.RESULT_MSR = rESULT_MSR; if (rESULT_MSR_UNIT != null) a.RESULT_MSR_UNIT = rESULT_MSR_UNIT; if (rESULT_STATUS != null) a.RESULT_STATUS = rESULT_STATUS; if (rESULT_VALUE_TYPE != null) a.RESULT_VALUE_TYPE = rESULT_VALUE_TYPE; if (rESULT_COMMENT != null) a.RESULT_COMMENT = rESULT_COMMENT; if (bIO_INTENT_NAME != null) a.BIO_INTENT_NAME = bIO_INTENT_NAME; if (bIO_INDIVIDUAL_ID != null) a.BIO_INDIVIDUAL_ID = bIO_INDIVIDUAL_ID; if (bIO_TAXONOMY != null) a.BIO_SUBJECT_TAXONOMY = bIO_TAXONOMY; if (bIO_SAMPLE_TISSUE_ANATOMY != null) a.BIO_SAMPLE_TISSUE_ANATOMY = bIO_SAMPLE_TISSUE_ANATOMY; if (aNALYTIC_METHOD_IDX != null) a.ANALYTIC_METHOD_IDX = aNALYTIC_METHOD_IDX; if (lAB_IDX != null) a.LAB_IDX = lAB_IDX; if (lAB_ANALYSIS_START_DT != null) a.LAB_ANALYSIS_START_DT = lAB_ANALYSIS_START_DT; if (dETECTION_LIMIT != null) a.DETECTION_LIMIT = dETECTION_LIMIT; if (pQL != null) a.PQL = pQL; if (lOWER_QUANT_LIMIT != null) a.LOWER_QUANT_LIMIT = lOWER_QUANT_LIMIT; if (uPPER_QUANT_LIMIT != null) a.UPPER_QUANT_LIMIT = uPPER_QUANT_LIMIT; if (lAB_SAMP_PREP_IDX != null) a.LAB_SAMP_PREP_IDX = lAB_SAMP_PREP_IDX; if (lAB_SAMP_PREP_START_DT != null) a.LAB_SAMP_PREP_START_DT = lAB_SAMP_PREP_START_DT; if (dILUTION_FACTOR != null) a.DILUTION_FACTOR = dILUTION_FACTOR; if (fREQ_CLASS_CODE != null) a.FREQ_CLASS_CODE = fREQ_CLASS_CODE; if (fREQ_CLASS_UNIT != null) a.FREQ_CLASS_UNIT = fREQ_CLASS_UNIT; //set freq class unit to count if not provided if (fREQ_CLASS_UNIT == null && fREQ_CLASS_CODE != null) fREQ_CLASS_UNIT = "count"; if (insInd) //insert case ctx.AddToT_WQX_RESULT(a); ctx.SaveChanges(); return a.RESULT_IDX; } catch (Exception ex) { return 0; } } }