Esempio n. 1
0
 string RenderEvents(UserEventSubscription s, IQueryable <AuditEventView> events)
 {
     using (var writer = new StringWriter())
     {
         var rc   = new System.Web.Routing.RequestContext(HttpContext, new RouteData());
         var cc   = new ControllerContext(rc, Reports);
         var view = ViewEngines.Engines.OfType <CompiledViewEngine>().First().FindView(cc, typeof(Views.Notifications.EmailNotification).AssemblyQualifiedName, "", true);
         try
         {
             var model = new Models.EmailNotificationModel
             {
                 User   = s.User,
                 Events = AuditUI.Visualize(AuditUIScope.Email, events)
                          .GroupBy(e => e, GroupingEventsComparer.Instance)
                          .Select(es => es.First())
             };
             view.View.Render(new ViewContext(cc, view.View, new ViewDataDictionary(model), new TempDataDictionary(), writer), writer);
         }
         finally
         {
             view.ViewEngine.ReleaseView(cc, view.View);
         }
         return(writer.ToString());
     }
 }
        public IEnumerable <IModule> GetModules()
        {
            yield return(Sec.Module <DnsDomain>());

            yield return(SecurityUI.Module <DnsDomain>());

            yield return(Aud.Module <DnsDomain>());

            yield return(AuditUI.Module <DnsDomain>());

            yield return(Mvc.Boilerplate.JsBootstrap());
        }