public ActionResult Details(int idMeet) { var meet = new Meet(); ViewBag.SuccessChoices = MeetBL.GetSuccessChoices(); var db = new DatabaseConnection(Server.MapPath("~")); db.connection.Open(); meet.Header = MeetBL.GetHeader(idMeet, db); if (meet.Header.IdUser == (int)Session["IdUser"]) { meet.Results = MeetBL.GetResults(idMeet, db); } //Prevents users from accessing other users trainings else { return(RedirectToAction("Index", "Meet")); } db.connection.Close(); return(View(meet)); }
public ActionResult Create() { var meet = new Meet(); meet.CreateEmptyResults(); meet.Header.Date = DateTime.Today; ViewBag.SuccessChoices = MeetBL.GetSuccessChoices(); return(View(meet)); }