public ActionResult DeleteGrafiek(int id) { try { ApplicationUser currUser = aMgr.FindById(System.Web.HttpContext.Current.User.Identity.GetUserId()); Dashbord dash; if (currUser != null) { string userName = currUser.UserName; Gebruiker user = gMgr.FindUser(userName); dash = dashMgr.GetDashboardWithFollows(user); dashMgr.DeleteOneZonesOrder(dash); dashMgr.RemoveDashItem(id); } else { //not jet ready //have to add defaultdash //default redirect to inlog or alert to log in } return(RedirectToAction("Dashboard")); } catch { return(RedirectToAction("Dashboard")); } }
public ActionResult DeleteGrafiek(int id, FormCollection collection) { try { _dashManager.RemoveDashItem(id); return(RedirectToAction("Grafiek")); } catch { return(View()); } }