public void BuildComponentInfoTab(ComponentQuestionInfoData info, CSET_Context controlContext)
        {
            try
            {
                IsComponent = true;
                ShowRequirementFrameworkTitle = false;
                NEW_QUESTION question = BuildFromNewQuestion(info, info.Set, controlContext);
                ComponentVisibility = true;
                // Build multiServiceComponent types list if any
                ComponentTypes.Clear();
                int salLevel = controlContext.UNIVERSAL_SAL_LEVEL.Where(x => x.Universal_Sal_Level1 == question.Universal_Sal_Level).First().Sal_Level_Order;

                List <ComponentOverrideLinkInfo> tmpList = new List <ComponentOverrideLinkInfo>();

                foreach (COMPONENT_QUESTIONS componentType in question.COMPONENT_QUESTIONS)
                {
                    bool enabled = info.HasComponentsForTypeAtSal(componentType.Component_Type, salLevel);
                    SymbolComponentInfoData componentTypeData = info.DictionaryComponentInfo[componentType.Component_Type];
                    tmpList.Add(new ComponentOverrideLinkInfo()
                    {
                        TypeComponetXML = componentTypeData.XMLName,
                        Type            = componentTypeData.DisplayName,
                        Enabled         = enabled
                    });
                }
                ComponentTypes = tmpList.OrderByDescending(x => x.Enabled).ThenBy(x => x.Type).ToList();
            }
            catch (Exception ex)
            {
                //CSETLogger.Fatal("Failed to get component information tab data.", ex);
            }
        }
Exemplo n.º 2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="questionInfoData"></param>
        /// <returns></returns>
        internal List <QuestionInformationTabData> CreateComponentInformationTab(ComponentQuestionInfoData questionInfoData)
        {
            List <QuestionInformationTabData> tempTabDataList = new List <QuestionInformationTabData>();
            QuestionInformationTabData        tab             = new QuestionInformationTabData();

            tab.BuildComponentInfoTab(questionInfoData, DataContext);
            tempTabDataList.Add(tab);
            return(tempTabDataList);
        }
Exemplo n.º 3
0
        public void BuildComponentInfoTab(ComponentQuestionInfoData info, CSET_Context controlContext)
        {
            try
            {
                IsComponent = true;
                ShowRequirementFrameworkTitle  = false;
                this.RequirementFrameworkTitle = "Components";
                NEW_QUESTION question = BuildFromNewQuestion(info, info.Set, controlContext);
                ComponentVisibility = true;
                // Build multiServiceComponent types list if any
                ComponentTypes.Clear();
                int salLevel = controlContext.UNIVERSAL_SAL_LEVEL.Where(x => x.Universal_Sal_Level1 == question.Universal_Sal_Level).First().Sal_Level_Order;

                List <ComponentOverrideLinkInfo> tmpList = new List <ComponentOverrideLinkInfo>();


                foreach (COMPONENT_QUESTIONS componentType in controlContext.COMPONENT_QUESTIONS.Where(x => x.Question_Id == info.QuestionID))
                {
                    bool enabled = info.HasComponentsForTypeAtSal(componentType.Component_Symbol_Id, salLevel);
                    COMPONENT_SYMBOLS componentTypeData = info.DictionaryComponentInfo[componentType.Component_Symbol_Id];
                    tmpList.Add(new ComponentOverrideLinkInfo()
                    {
                        Component_Symbol_Id = componentTypeData.Component_Symbol_Id,
                        Symbol_Name         = componentTypeData.Symbol_Name,
                        Enabled             = enabled
                    });
                }
                ComponentTypes = tmpList.OrderByDescending(x => x.Enabled).ThenBy(x => x.Symbol_Name).ToList();
                var reqid = controlContext.REQUIREMENT_QUESTIONS.Where(x => x.Question_Id == info.QuestionID).First().Requirement_Id;
                BuildDocuments(reqid, controlContext);
                var requirement = controlContext.NEW_REQUIREMENT.Where(x => x.Requirement_Id == reqid).Select(t => new
                {
                    Question_or_Requirement_Id = t.Requirement_Id,
                    Text             = FormatRequirementText(t.Requirement_Text),
                    SupplementalInfo = FormatSupplementalInfo(t.Supplemental_Info)
                }).FirstOrDefault();
                if (requirement != null)
                {
                    RequirementsData = new RequirementTabData()
                    {
                        RequirementID    = requirement.Question_or_Requirement_Id,
                        Text             = requirement.Text,
                        SupplementalInfo = FormatSupplementalInfo(requirement.SupplementalInfo),
                    };
                    QuestionsVisible = false;
                    ShowSALLevel     = true;
                }
            }
            catch (Exception ex)
            {
                //CSETLogger.Fatal("Failed to get component information tab data.", ex);
            }
        }