public IEnumerable <TemplateFieldValueViewModel> GetTemplateFieldValuesByForm(TemplateViewModel model) { var fieldValues = GetTemplateFieldValuesByTemplate(model.TemplateID.Value); var values = fieldValues .Select((fv) => { return(TemplateFieldValueViewModel.CreateFromObject(fv)); }) .OrderBy(f => f.FieldOrder) .ThenByDescending(f => f.DateAdded); return(values); }
public IEnumerable <TemplateFieldValueViewModel> HasSubmissions(TemplateViewModel model) { using (var unitOfWork = CreateUnitOfWork()) { var fieldValues = unitOfWork.FormRepository.GetTemplateFieldValuesByTemplate(model.TemplateID.Value); var values = fieldValues .Select((fv) => { return(TemplateFieldValueViewModel.CreateFromObject(fv)); }) .OrderBy(f => f.FieldOrder) .ThenByDescending(f => f.DateAdded); return(values); } }