Example #1
0
 public ActionResult Index()
 {
     try
     {
         return(View(Mapper.Map <IEnumerable <StyleViewModel> >(_styleService.GetAll())));
     }
     catch (Exception ex)
     {
         return(JavaScript($"ShowResult('{ex.Message}','failure')"));
     }
 }
Example #2
0
 public MvcHtmlString RenderResourceStyle(string name)
 {
     if (_styleService.GetAll().Any(s => s.Name.Equals(name, StringComparison.CurrentCultureIgnoreCase)))
     {
         var tag = new TagBuilder("link");
         tag.Attributes.Add("rel", "stylesheet");
         tag.Attributes.Add("type", "text/css");
         tag.Attributes.Add("href", string.Format(EzCMSContants.CssResourceUrl, name));
         return(new MvcHtmlString(tag.ToString(TagRenderMode.SelfClosing)));
     }
     return(new MvcHtmlString(string.Empty));
 }