Example #1
0
 private List <FormTemplateDto> BuildFormTemplateDto(IEnumerable <Form> forms)
 {
     return(forms.Select(f => new FormTemplateDto
     {
         FormId = f.FormId,
         Title = f.Title,
         Description = f.Description,
         Sections = FormSectionDto.From(f.FormSections)
     }).ToList());
 }
Example #2
0
        private IList <FormSectionDto> GetFormTabSections(XElement xTab)
        {
            var result = new List <FormSectionDto>();
            // ReSharper disable PossibleNullReferenceException
            var xSections = xTab.Element("columns").Elements("column").Elements("sections").Elements("section");

            foreach (var xSection in xSections)
            {
                var sectionNameAttribute = xSection.Attribute("name");
                var name       = sectionNameAttribute?.Value ?? xSection.Attribute("id").Value;
                var sectionDto = new FormSectionDto
                {
                    Name        = name,
                    DisplayName = this.GetLocalizedDescription(xSection)
                };
                // ReSharper restore PossibleNullReferenceException

                result.Add(sectionDto);
            }

            return(result);
        }