private void InitDashboard(Dashboard dashboard) { dashboard.data = _widgetrepository.GetDashboardWidgets(dashboard); foreach (Widget x in dashboard.data) { x.metadata = _parameterrepository.GetParameters(x.id); } }
public IEnumerable<Widget> GetDashboardWidgets(Dashboard dashboard) { if (dashboard.id == 1) { var list = new List<Widget> { new Widget(1, "Widget One", "/Dashboard/widgets/widget1.html", "/Dashboard/widgets/editwidget1.html", "first", true), new Widget(2, "Widget Regular", "/Dashboard/widgets/MyProfile.html", "/Dashboard/widgets/editwidget2.html", "first", true), new Widget(3, "Widget test", "/Dashboard/widgets/KO_MyProfile.html", "/Dashboard/widgets/editwidget2.html", "first", true) }; foreach (var x in list) { x.metadata = _parameterrepository.GetParameters(x.id); } return list; } else { var list = new List<Widget> { new Widget(1, "Widget One", "/Dashboard/widgets/widget1.html", "/Dashboard/widgets/editwidget1.html", "first", true), new Widget(2, "Widget Regular", "/Dashboard/widgets/MyProfile.html", "/Dashboard/widgets/editwidget2.html", "first", true), new Widget(3, "Widget test", "/Dashboard/widgets/KO_MyProfile.html", "/Dashboard/widgets/editwidget2.html", "first", true) }; foreach (var x in list) { x.metadata = _parameterrepository.GetParameters(x.id); } return list; } }
public void UpdateDashboard(Dashboard dashboard) { _dashboardrepository.UpdateDashboard(dashboard); }
public JsonResult CreateDashboard(Dashboard dashboard) { var createddashboard = _dashboardbuilder.CreateCustomDashboard(dashboard); return Json(createddashboard, JsonRequestBehavior.AllowGet); }
public void UpdateDashboard(Dashboard dashboard) { _widgetrepository.UpdateWidgets(dashboard.data); }
/// <summary> /// Create a new User Dashboard that can be customized /// </summary> /// <param name="dashboard">Holds the information for the Company Dashboard</param> /// <returns>The new User Dashboard</returns> public Dashboard CreateUserDashboard(Dashboard dashboard) { var userdashboard = new Dashboard(dashboard.id, dashboard.layout, "User"); userdashboard.data = dashboard.data; return userdashboard; }
public Dashboard CreateCompanyDashboard(Dashboard dashboard) { var companydashboard = new Dashboard(1, "layout1", "Company"); companydashboard.data = (IEnumerable<Widget>)new List<Widget>(); return companydashboard; }
public Dashboard CreateCustomDashboard(Dashboard dashboard) { if (dashboard.type == "Company") return _dashboardrepository.CreateUserDashboard(dashboard); return _dashboardrepository.CreateCompanyDashboard(dashboard); }