public ActionResult Cancel() { ViewBag.Message = ""; ViewModels.TemplateList template = new ViewModels.TemplateList(); template = _applicationContext.ServiceContext.TemplateService.GetTemplates(); return(View("Index", template)); }
/// <summary> /// Create the list of Suggested and other templates /// </summary> /// <returns>Returns the list of templates categorised as Suggested and others</returns> public ViewModels.TemplateList GetTemplates() { List <Entities.HtmlTemplate> _templates = _repositoryFactory.HtmlTemplateRepository.GetAllTemplates(Convert.ToInt32(_hraSessionManager.InstitutionId)); ViewModels.TemplateList templateList = new ViewModels.TemplateList(); foreach (var template in _templates) { if (supported.Contains(template.RoutineName)) { if (string.Compare(routine, template.RoutineName, true) == 0 || string.Compare(template.RoutineName, "surveySummary", true) == 0) { templateList.SuggestedDocument.Add(new ViewModels.Template() { Id = template.Id, TemplateName = template.TemplateName }); } else { templateList.OtherDocuments.Add(new ViewModels.Template() { Id = template.Id, TemplateName = template.TemplateName }); } } } templateList.SuggestedDocument.OrderBy(o => o.TemplateName); templateList.OtherDocuments.OrderBy(o => o.TemplateName); return(templateList); }
public ActionResult Cancel() { ViewBag.Message = ""; ViewModels.TemplateList template = new ViewModels.TemplateList(); template = _applicationContext.ServiceContext.TemplateService.GetTemplates(); return View("Index", template); }
/// <summary> /// Create the list of Suggested and other templates /// </summary> /// <returns>Returns the list of templates categorised as Suggested and others</returns> public ViewModels.TemplateList GetTemplates() { List<Entities.HtmlTemplate> _templates = _repositoryFactory.HtmlTemplateRepository.GetAllTemplates(Convert.ToInt32(_hraSessionManager.InstitutionId)); ViewModels.TemplateList templateList = new ViewModels.TemplateList(); foreach(var template in _templates) { if (supported.Contains(template.RoutineName)) { if (string.Compare(routine, template.RoutineName, true) == 0 || string.Compare(template.RoutineName, "surveySummary", true) == 0) { templateList.SuggestedDocument.Add(new ViewModels.Template() { Id=template.Id, TemplateName= template.TemplateName }); } else { templateList.OtherDocuments.Add(new ViewModels.Template() { Id = template.Id, TemplateName = template.TemplateName }); } } } templateList.SuggestedDocument.OrderBy(o => o.TemplateName); templateList.OtherDocuments.OrderBy(o => o.TemplateName); return templateList; }