public ActionResult CreateCijfer(string automplete, int uren) { string naam = automplete; //Persoon p = _dataManager.GetPersoon(naam); ViewBag.naam = automplete; //Zie dat je bent ingelogd ApplicationUser currUser = _userManager.FindById(System.Web.HttpContext.Current.User.Identity.GetUserId()); string userName = currUser.UserName; Gebruiker user = _gebrManager.FindUser(userName); try { Persoon p = _dataManager.GetPersoon(naam); // =============== Opslaan grafiek : opgesplitst om te debuggen =================== // List <IP3_8IEN.BL.Domain.Dashboard.GraphData> graphDataList = _dataManager.GetNumberGraph(p, uren); IP3_8IEN.BL.Domain.Dashboard.DashItem newDashItem = _dashManager.CreateDashitem(true, "Cijfer", 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().FirstOrDefault(org => org.Naam == naam); // =============== Opslaan grafiek : opgesplitst om te debuggen =================== // List <IP3_8IEN.BL.Domain.Dashboard.GraphData> graphDataList = _dataManager.GetNumberGraph(o, uren); IP3_8IEN.BL.Domain.Dashboard.DashItem newDashItem = _dashManager.CreateDashitem(true, "Cijfer", 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 t = _dataManager.GetThemas().FirstOrDefault(theme => theme.Naam == naam); // =============== Opslaan grafiek : opgesplitst om te debuggen =================== // List <GraphData> graphDataList = _dataManager.GetNumberGraph(t, uren); DashItem newDashItem = _dashManager.CreateDashitem(true, "Cijfer", naam); Follow follow = _dashManager.CreateFollow(newDashItem.DashItemId, t.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()); }
public ActionResult CreateComparisonPersonLine(string pers1, string pers2, string pers3, string pers4, string pers5) { ApplicationUser currUser = aMgr.FindById(System.Web.HttpContext.Current.User.Identity.GetUserId()); string userName = currUser.UserName; Gebruiker user = gMgr.FindUser(userName); Persoon p1 = dMgr.GetPersoon(pers1); Persoon p2 = dMgr.GetPersoon(pers2); Persoon p3 = dMgr.GetPersoon(pers3); Persoon p4 = dMgr.GetPersoon(pers4); Persoon p5 = dMgr.GetPersoon(pers5); // =============== Opslaan grafiek : opgesplitst om te debuggen =================== // List <IP3_8IEN.BL.Domain.Dashboard.GraphData> graphDataList = dMgr.GetTweetsPerDagComparisonOverTime(p1, p2, p3, p4, p5); IP3_8IEN.BL.Domain.Dashboard.DashItem newDashItem = dashMgr.CreateDashitem(false, "Verg", "Vergelijk 5 onderwerpen", "Vlaanderen", pers1, pers2, pers3, pers4, pers5); IP3_8IEN.BL.Domain.Dashboard.Follow follow = dashMgr.CreateFollow(newDashItem.DashItemId, p1.OnderwerpId); IP3_8IEN.BL.Domain.Dashboard.DashItem dashItem = dashMgr.SetupDashItem(user, follow); dashMgr.LinkGraphsToUser(graphDataList, dashItem.DashItemId); // ================================================================================ // return(RedirectToAction("Dashboard")); }
public ActionResult CreateComparisonPerson(string pers1, string pers2, string pers3, string pers4, string pers5) { ApplicationUser currUser = _userManager.FindById(System.Web.HttpContext.Current.User.Identity.GetUserId()); string userName = currUser.UserName; Gebruiker user = _gebrManager.FindUser(userName); Persoon p1 = _dataManager.GetPersoon(pers1); Persoon p2 = _dataManager.GetPersoon(pers2); Persoon p3 = _dataManager.GetPersoon(pers3); Persoon p4 = _dataManager.GetPersoon(pers4); Persoon p5 = _dataManager.GetPersoon(pers5); // =============== Opslaan grafiek : opgesplitst om te debuggen =================== // List <IP3_8IEN.BL.Domain.Dashboard.GraphData> graphDataList = _dataManager.GetComparisonPersonNumberOfTweets(p1, p2, p3, p4, p5); IP3_8IEN.BL.Domain.Dashboard.DashItem newDashItem = _dashManager.CreateDashitem(true, "Bar", "Vergelijk 5 onderwerpen"); IP3_8IEN.BL.Domain.Dashboard.Follow follow = _dashManager.CreateFollow(newDashItem.DashItemId, p1.OnderwerpId); IP3_8IEN.BL.Domain.Dashboard.DashItem dashItem = _dashManager.SetupDashItem(user, follow); _dashManager.LinkGraphsToUser(graphDataList, dashItem.DashItemId); // ================================================================================ // _dashManager.SyncWithAdmins(user.GebruikerId, dashItem.DashItemId); return(RedirectToAction("CreateComparisonPersonFinished")); }
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()); }