public ActionResult CreateChartAantalTweetsPerDag(string politicus, string type, int aantalDagenTerug) { ApplicationUser currUser = aMgr.FindById(System.Web.HttpContext.Current.User.Identity.GetUserId()); string userName = currUser.UserName; Gebruiker user = gMgr.FindUser(userName); string naam = politicus; Persoon p = dMgr.GetPersoon(naam); List <GraphData> graphDataList = dMgr.GetTweetsPerDag(p, aantalDagenTerug); DashItem newDashItem = dashMgr.CreateDashitem(false, type, aantalDagenTerug, naam); Follow follow = dashMgr.CreateFollow(newDashItem.DashItemId, p.OnderwerpId); DashItem dashItem = dashMgr.SetupDashItem(user, follow); dashMgr.LinkGraphsToUser(graphDataList, dashItem.DashItemId); return(RedirectToAction("Dashboard")); }
public ActionResult CreateGrafiekLine(string automplete, string automplete2) { string naam = automplete; ViewBag.naam = automplete; //Zie dat je bent ingelogd //TODO: redirect naar inlog pagina <-- ApplicationUser currUser = _userManager.FindById(System.Web.HttpContext.Current.User.Identity.GetUserId()); string userName = currUser.UserName; Gebruiker user = _gebrManager.FindUser(userName); int nDagen = 10; // <-- voorlopig default ////////////////////////////////////////////////////////////////// try { Persoon p = _dataManager.GetPersoon(naam); // =============== Opslaan grafiek : opgesplitst om te debuggen =================== // List <IP3_8IEN.BL.Domain.Dashboard.GraphData> graphDataList = _dataManager.GetTweetsPerDag(p, nDagen); IP3_8IEN.BL.Domain.Dashboard.DashItem newDashItem = _dashManager.CreateDashitem(true, "Line", naam); IP3_8IEN.BL.Domain.Dashboard.Follow follow = _dashManager.CreateFollow(newDashItem.DashItemId, p.OnderwerpId); IP3_8IEN.BL.Domain.Dashboard.DashItem dashItem = _dashManager.SetupDashItem(user, follow); _dashManager.LinkGraphsToUser(graphDataList, dashItem.DashItemId); // ================================================================================ // _dashManager.SyncWithAdmins(user.GebruikerId, dashItem.DashItemId); } catch { } try { Organisatie o = _dataManager.GetOrganisaties().ToList().FirstOrDefault(org => org.Naam == naam); List <IP3_8IEN.BL.Domain.Dashboard.GraphData> graphDataList; IP3_8IEN.BL.Domain.Dashboard.DashItem newDashItem; // =============== Opslaan grafiek : opgesplitst om te debuggen =================== // if (automplete2 != null) { graphDataList = _dataManager.GetTweetsPerDag(o, automplete2, nDagen); newDashItem = _dashManager.CreateDashitem(true, "Line", naam, automplete2); } else { graphDataList = _dataManager.GetTweetsPerDag(o, nDagen); newDashItem = _dashManager.CreateDashitem(true, "Line", naam); } IP3_8IEN.BL.Domain.Dashboard.Follow follow = _dashManager.CreateFollow(newDashItem.DashItemId, o.OnderwerpId); IP3_8IEN.BL.Domain.Dashboard.DashItem dashItem = _dashManager.SetupDashItem(user, follow); _dashManager.LinkGraphsToUser(graphDataList, dashItem.DashItemId); // ================================================================================ // _dashManager.SyncWithAdmins(user.GebruikerId, dashItem.DashItemId); } catch { } try { Thema thema = _dataManager.GetThemas().ToList().FirstOrDefault(t => t.Naam == naam); List <GraphData> graphDataList = _dataManager.GetTweetsPerDag(thema, nDagen); DashItem newDashItem = _dashManager.CreateDashitem(true, "Line", naam); Follow follow = _dashManager.CreateFollow(newDashItem.DashItemId, thema.OnderwerpId); DashItem dashItem = _dashManager.SetupDashItem(user, follow); _dashManager.LinkGraphsToUser(graphDataList, dashItem.DashItemId); // ================================================================================ // _dashManager.SyncWithAdmins(user.GebruikerId, dashItem.DashItemId); } catch { } //////////////////////////////////////////////////////////////// Dashbord dash = _dashManager.GetDashboardWithFollows(user); return(View()); }