public ActionResult EventDetail() { Event e = new Event(); if (Request.Cookies["EventId"] != null) { string eventId; { eventId = Request.Cookies["EventId"].Value.ToString(); } // GoogleAPI eventGetter = new GoogleAPI(); MySQLDatabase eventGetter = new MySQLDatabase(); e = eventGetter.GetEventById(eventId); } ViewBag.e = e; return(View()); }
public ActionResult EventEdit() { if (Session["IsLoggedIn"].ToString() == "false") { Response.Redirect("~/Home/Index"); } Event e = new Event(); if (Request.Cookies["EventId"] != null) { string eventId; { eventId = Request.Cookies["EventId"].Value.ToString(); } // GoogleAPI eventGetter = new GoogleAPI(); MySQLDatabase eventGetter = new MySQLDatabase(); e = eventGetter.GetEventById(eventId); } ViewBag.e = e; return(View()); }
public ActionResult EventEdit(string startDate, string endDate, string name, string details, string game) { // GoogleAPI eventEditor = new GoogleAPI(); MySQLDatabase eventEditor = new MySQLDatabase(); DateTime start = Convert.ToDateTime(startDate); DateTime end = Convert.ToDateTime(endDate); string eventId; if (Request.Cookies["EventId"] != null) { { eventId = Request.Cookies["EventId"].Value.ToString(); } bool results = eventEditor.EditEvent(start, end, name, details, eventId, game); if (results) { ViewBag.results = "Event Edited"; } else { ViewBag.results = "Something went wrong."; } Event e = new Event(); if (Request.Cookies["EventId"] != null) { /// GoogleAPI eventGetter = new GoogleAPI(); e = eventEditor.GetEventById(eventId); ViewBag.e = e; } } else { ViewBag.results = "Something went wrong."; } return(View()); }