protected virtual IHtmlString RenderContentPosition(ContentPosition contentPosition) { var site = this.PageContext.PageRequestContext.Site; var repository = site.GetRepository(); if (repository == null) { throw new KoobooException("The repository for site is null."); } var dataRule = contentPosition.DataRule; var dataRuleContext = new DataRuleContext(this.PageContext.PageRequestContext.Site, this.PageContext.PageRequestContext.Page) { ValueProvider = this.PageContext.PageRequestContext.GetValueProvider() }; var contentQuery = dataRule.Execute(dataRuleContext); string viewPath = ""; var schema = dataRule.GetSchema(repository); Object model = contentQuery; switch (contentPosition.Type) { case ContentPositionType.Detail: viewPath = schema.GetFormTemplate(FormType.Detail); model = contentQuery.FirstOrDefault(); break; case ContentPositionType.List: default: int top = 10; if (int.TryParse(((FolderDataRule)dataRule).Top, out top)) { model = contentQuery.Take(top); } viewPath = schema.GetFormTemplate(FormType.List); break; } return(ViewRender.RenderViewInternal(this.Html, viewPath, null, model)); }
protected virtual IHtmlString RenderContentPosition(ContentPosition contentPosition) { var site = this.PageContext.PageRequestContext.Site; var repository = site.GetRepository(); if (repository == null) { throw new KoobooException("The repository for site is null."); } var dataRule = (IContentDataRule)(contentPosition.DataRule); var dataRuleContext = new DataRuleContext(this.PageContext.PageRequestContext.Site, this.PageContext.PageRequestContext.Page) { ValueProvider = this.PageContext.PageRequestContext.GetValueProvider() }; string viewPath = ""; TakeOperation operation; var schema = dataRule.GetSchema(repository); switch (contentPosition.Type) { case ContentPositionType.Detail: viewPath = schema.GetFormTemplate(FormType.Detail); operation = TakeOperation.First; break; case ContentPositionType.List: default: viewPath = schema.GetFormTemplate(FormType.List); operation = TakeOperation.List; break; } var model = dataRule.Execute(dataRuleContext, operation, 0); return(ViewRender.RenderViewInternal(this.Html, viewPath, null, model)); }
public AdminController(CampContext context, ViewRender view) { this.view = view; db = context; }
/// <summary> /// Renders the view. /// </summary> /// <param name="viewName">Name of the view.</param> /// <param name="viewData">The view data.</param> /// <param name="parameters">The parameters.</param> /// <param name="executeDataRule">if set to <c>true</c> [execute data rule].</param> /// <returns></returns> public virtual IHtmlString RenderView(string viewName, ViewDataDictionary viewData, object parameters, bool executeDataRule) { return(ViewRender.RenderView(this.Html, PageContext, viewName, viewData, parameters, executeDataRule)); }
public ModalController(ViewRender view, IUserRepository userRepository) { _view = view; _userRepository = userRepository; }
public MeetingController(ViewRender view) { _mailgenerator = new HtmlGenerator(view); }
public UserController(ViewRender view) { _view = view; _mailgenerator = new HtmlGenerator(view); }
public ModalController(ViewRender view, IUserRepository userRepository, IMapper mapper) { _view = view; _userRepository = userRepository; _mapper = mapper; }
public HtmlGenerator(ViewRender viewRenderer) { ViewRenderer = viewRenderer; }
public HomeController(ViewRender view, INodeServices nodeServices) { this.view = view; this.nodeServices = nodeServices; }