Пример #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="frameworkData"></param>
        /// <returns></returns>
        internal List <QuestionInformationTabData> CreateFrameworkInformationTab(FrameworkInfoData frameworkData)
        {
            List <QuestionInformationTabData> tempTabDataList = new List <QuestionInformationTabData>();
            QuestionInformationTabData        tab             = new QuestionInformationTabData();

            tab.BuildFrameworkInfoTab(frameworkData, DataContext);
            tempTabDataList.Add(tab);
            return(tempTabDataList);
        }
        public void BuildFrameworkInfoTab(FrameworkInfoData frameworkData, CSET_Context controlContext)
        {
            QuestionsList    = new List <RelatedQuestion>();
            IsCustomQuestion = frameworkData.IsCustomQuestion;
            References       = frameworkData.References;
            if (!IsComponent)
            {
                RequirementFrameworkTitle = frameworkData.Title;
            }
            RelatedFrameworkCategory      = frameworkData.Category;
            ShowRequirementFrameworkTitle = true;
            String shortStandardName = controlContext.SETS.Where(x => x.Set_Name == frameworkData.SetName).FirstOrDefault().Short_Name;

            HeaderName = shortStandardName;

            if (String.IsNullOrWhiteSpace(References))
            {
                References = "None";
            }
            Question_or_Requirement_Id = frameworkData.RequirementID;

            RequirementTabData tabData = new RequirementTabData();

            if (frameworkData.IsCustomQuestion)
            {
                tabData.Text             = frameworkData.Question;
                tabData.SupplementalInfo = FormatSupplementalInfo(frameworkData.SupplementalInfo);
                if (String.IsNullOrWhiteSpace(tabData.SupplementalInfo))
                {
                    tabData.SupplementalInfo = "None";
                }
                QuestionsVisible         = false;
                ShowRequirementStandards = false;
                ShowSALLevel             = false;
            }
            else
            {
                var requirement = controlContext.NEW_REQUIREMENT.Where(x => x.Requirement_Id == frameworkData.RequirementID).Select(t => new
                {
                    Question_or_Requirement_Id = t.Requirement_Id,
                    Text             = FormatRequirementText(t.Requirement_Text),
                    SupplementalInfo = FormatSupplementalInfo(t.Supplemental_Info),
                    Questions        = t.NEW_QUESTIONs().Select(s => new RelatedQuestion
                    {
                        QuestionID   = s.Question_Id,
                        QuestionText = s.Simple_Question
                    }),
                    LevelName = t.REQUIREMENT_LEVELS.Select(s => s.Standard_LevelNavigation).OrderBy(s => s.Level_Order).Select(s => s.Full_Name).FirstOrDefault()
                }).FirstOrDefault();
                if (requirement != null)
                {
                    QuestionsList            = requirement.Questions.ToList();
                    this.LevelName           = requirement.LevelName;
                    tabData.RequirementID    = requirement.Question_or_Requirement_Id;
                    tabData.Text             = requirement.Text;
                    tabData.SupplementalInfo = FormatSupplementalInfo(requirement.SupplementalInfo);

                    QuestionsVisible = false;

                    ShowSALLevel = true;
                    BuildDocuments(frameworkData.RequirementID, controlContext);
                    SetFrameworkQuestions(frameworkData.RequirementID, controlContext);
                }
            }
            RequirementsData = tabData;
        }