コード例 #1
0
ファイル: MeetController.cs プロジェクト: exp3rt1/PowerPipes
        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));
        }
コード例 #2
0
ファイル: MeetController.cs プロジェクト: exp3rt1/PowerPipes
        public ActionResult Create()
        {
            var meet = new Meet();

            meet.CreateEmptyResults();
            meet.Header.Date = DateTime.Today;

            ViewBag.SuccessChoices = MeetBL.GetSuccessChoices();

            return(View(meet));
        }