Example #1
0
    /// <summary>
    /// Controls display of menu containing links to child forms. Menu links driven by PatientDataEntryConfig.xml file.
    /// </summary>
    /// <param name="formNode">XmlNode containing meta data on current form</param>
    /// <param name="primaryKeyValue">Integer with current record id if it exists</param>
    public void Show(string tableName, int primaryKeyValue, int parentKeyValue, bool isParentRecordLocked)//, List<String> tableNames)
    {
        //_currentNode = menuNode;
        _currentTableName     = GetActiveTableName(tableName);
        _primaryKeyValue      = primaryKeyValue;
        _parentKeyValue       = parentKeyValue;
        _isParentRecordLocked = isParentRecordLocked;

        // the sequence in which these methods fire is important!
        GetRelevantTableNames();
        GetOtherTableNames();
//        SetOtherLinks();
        SetRelevantLinks();


        if (subFormNavigation.Text != "" || relevantFormNavigation.Text != "")
        {
            this.Visible = true;

            //if (_childRecordsExist)
            //{   // show populated icon
            //    SubDataIcon.Src = "../../Images/icon_hasDetails.gif";
            //}
        }

        // show related records
        RelatedRecordController rc = new RelatedRecordController();
        var relatableTables        = rc.GetRelatedRecordUtilityTables();

        if (relatableTables.Contains(tableName) && _primaryKeyValue > 0)
        {
            this.Visible = true;
            ShowRelatedRecords(tableName, primaryKeyValue, parentKeyValue, isParentRecordLocked);
        }
    }