예제 #1
0
    /// <summary>
    /// For the given table, show a list of related records as well as available tables to relate
    /// </summary>
    /// <param name="tableName"></param>
    /// <param name="primaryKeyValue"></param>
    /// <param name="parentKeyValue"></param>
    /// <param name="isParentRecordLocked"></param>
    protected void ShowRelatedRecords(string tableName, int primaryKeyValue, int parentKeyValue, bool isParentRecordLocked)
    {
        if (primaryKeyValue > 0)
        {
            // set url
            RelatedRecordsFrame.Attributes["src"] = "RelatedRecords.aspx?destTableName=" + tableName + "&destTablePrimaryKey=" + primaryKeyValue;
            // build existing related records
            DataView relatedRecords = RelatedRecordController.GetRelatedRecords(tableName, primaryKeyValue).AsDataView <RelatedRecord>();

            RelatedRecordsRptr.DataSource = relatedRecords;
            RelatedRecordsRptr.DataBind();

            // show related records container
            RelatedRecordsContainer.Visible = true;
            RelatedRecordsPopup.Visible     = true;
        }
        else
        {
            RelatedRecordsContainer.Visible = false;
            RelatedRecordsPopup.Visible     = false;
        }
    }
예제 #2
0
        /// <summary>
        /// Gets a list of Diagnostic related records
        /// </summary>
        /// <param name="specimenAccessionId"></param>
        /// <returns></returns>
        private IEnumerable <RelatedRecord> GetDiagnosticRelatedRecords(int specimenAccessionId)
        {
            IEnumerable <RelatedRecord> diagnosticRelatedRecords = RelatedRecordController.GetRelatedRecords("SpecimenAccessions", specimenAccessionId, "Diagnostics");

            return(diagnosticRelatedRecords);
        }