/// <summary> /// Get page template for file template /// </summary> /// <param name="id"></param> /// <returns></returns> public IEnumerable <SelectListItem> GetPageTemplateSelectListForFileTemplate(int?id = null) { var pageTemplates = GetAll(); int?templateId = null; var fileTemplate = _fileTemplateRepository.GetById(id); if (fileTemplate != null) { templateId = fileTemplate.PageTemplateId; } var data = pageTemplates.Select(m => new HierarchyModel { Id = m.Id, Name = m.Name, Hierarchy = m.Hierarchy, RecordOrder = m.RecordOrder, Selected = templateId.HasValue && templateId.Value == m.Id }).ToList(); return(_pageTemplateRepository.BuildSelectList(data)); }
public FileTemplate GetById(object id) { return(_fileTemplateRepository.GetById(id)); }