public DashboardController(IDashboardBuilder dashboardbuilder, IDashboardRepository dashboardrepository, SecurityResolver sr, SessionData sd) { _sr = sr; _sd = sd; _dashboardbuilder = dashboardbuilder; _dashboardrepository = dashboardrepository; }
public Dashboard BuildDashboard(SecurityResolver sr) { var dashboardtype = _dashboardrepository.GetDashboardType(sr.user, sr.CurrentRole); var dashboard = dashboardtype == "Company" ? _dashboardrepository.GetCompanyDashboard(sr.user) : _dashboardrepository.GetUserDashboard(sr.user, sr.CurrentRole); InitDashboard(dashboard); return dashboard; }
public WidgetController(IWidgetBuilder widgetbuilder, IWidgetRepository widgetrepository, SecurityResolver sr, SessionData sd) { _widgetbuilder = widgetbuilder; _widgetrepository = widgetrepository; _sr = sr; _sd = sd; }
public string BuildWidgets(SecurityResolver sr) { var widgets = JsonConvert.SerializeObject(_widgetrepository.BuildCategoryWidgets()); var formattedwidgets = "{\"result\":{\"data\":" + widgets + "}}"; return formattedwidgets; }