public ActionResult ViewTemplate(int formId) { var templateCollectionView = new TemplateCollectionViewModel(); using (var formManager = new FormManager()) { templateCollectionView.Templates = formManager.FindAllTemplatesByFormId(formId); } return(View(templateCollectionView)); }
public ActionResult GetTemplates(int formid) { string message = string.Empty; using (var formManager = new FormManager(GetLoginUser())) { var results = formManager.FindAllTemplatesByFormId(formid).ToList(); var list = JsonConvert.SerializeObject(results, Formatting.None, new JsonSerializerSettings() { ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Ignore }); return(Content(list, "application/json")); } }