Ejemplo n.º 1
0
        public ActionResult DeleteConfirmed(int id)
        {
            UpcomingRnd upcomingRnd = db.UpcomingRnds.Find(id);

            db.UpcomingRnds.Remove(upcomingRnd);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Ejemplo n.º 2
0
        public ActionResult DeleteRnd(int RndID)
        {
            UpcomingRnd upcomingRnd = db.UpcomingRnds.Find(RndID);

            db.UpcomingRnds.Remove(upcomingRnd);
            db.SaveChanges();
            return(RedirectToAction("Index", new { upcomingRnd.CompPlayerID, upcomingRnd.CompID }));
        }
Ejemplo n.º 3
0
 public ActionResult Edit([Bind(Include = "RndID,CompPlayerID,CompID,RndDate,RndType,CourseID,Note")] UpcomingRnd upcomingRnd)
 {
     if (ModelState.IsValid)
     {
         db.Entry(upcomingRnd).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index", new { upcomingRnd.CompPlayerID, upcomingRnd.CompID }));
     }
     return(View(upcomingRnd));
 }
Ejemplo n.º 4
0
        public ActionResult Create([Bind(Include = "RndID,CompPlayerID,CompID,RndDate,RndType,CourseID,Note")] UpcomingRnd upcomingRnd)
        {
            if (ModelState.IsValid)
            {
                db.UpcomingRnds.Add(upcomingRnd);
                db.SaveChanges();
                return(RedirectToAction("Index", new { upcomingRnd.CompPlayerID, upcomingRnd.CompID }));
            }

            return(View(upcomingRnd));
        }
Ejemplo n.º 5
0
        // GET: UpcomingRnds/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            UpcomingRnd upcomingRnd = db.UpcomingRnds.Find(id);

            if (upcomingRnd == null)
            {
                return(HttpNotFound());
            }
            return(View(upcomingRnd));
        }
Ejemplo n.º 6
0
        // GET: UpcomingRnds/Create
        public ActionResult Create(int compPlayerID, int compID)
        {
            // Get Competition Name, Player Name, Current Handicap and Player Photo
            PlayerStats pStats = new PlayerStats();
            CompMain    cMain  = db.CompMains.Find(compID);

            ViewBag.PlayerName  = pStats.GetPlayerName(compPlayerID);
            ViewBag.PlayerPhoto = pStats.GetPlayerPhoto(compPlayerID);
            ViewBag.CurrentHCap = pStats.CurrentHcap(compPlayerID);
            ViewBag.CompName    = cMain.CompName;

            // Get Club Names For Drop Down List
            var courseInfo = new CourseInfo();

            ViewBag.CourseList = courseInfo.GetCourseList();

            // default players home course
            var upcomingRnd = new UpcomingRnd();

            upcomingRnd.CourseID     = pStats.HomeClubID(compPlayerID);
            upcomingRnd.CompPlayerID = compPlayerID;


            // Options for Round Type - Competition or Practice
            List <SelectListItem> rndType = new List <SelectListItem>();

            rndType.Add(new SelectListItem()
            {
                Text = "Competiton", Value = "Competition"
            });
            rndType.Add(new SelectListItem()
            {
                Text = "Practice", Value = "Practice"
            });
            ViewBag.RndType = rndType;

            return(View(upcomingRnd));
        }
Ejemplo n.º 7
0
        // GET: UpcomingRnds/Edit/5
        public ActionResult Edit(int?RndID)
        {
            if (RndID == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }

            UpcomingRnd upcomingRnd = db.UpcomingRnds.Find(RndID);

            // Get Competition Name, Player Name, Current Handicap and Player Photo
            PlayerStats pStats = new PlayerStats();
            CompMain    cMain  = db.CompMains.Find(upcomingRnd.CompID);

            ViewBag.PlayerName  = pStats.GetPlayerName(upcomingRnd.CompPlayerID);
            ViewBag.PlayerPhoto = pStats.GetPlayerPhoto(upcomingRnd.CompPlayerID);
            ViewBag.CurrentHCap = pStats.CurrentHcap(upcomingRnd.CompPlayerID);
            ViewBag.CompName    = cMain.CompName;

            // Get Club Names For Drop Down List
            var courseInfo = new CourseInfo();

            ViewBag.CourseList = courseInfo.GetCourseList();

            // Options for Round Type - Competition or Practice
            List <SelectListItem> rndType = new List <SelectListItem>();

            rndType.Add(new SelectListItem()
            {
                Text = "Competiton", Value = "Competition"
            });
            rndType.Add(new SelectListItem()
            {
                Text = "Practice", Value = "Practice"
            });
            ViewBag.RndType = rndType;

            return(View(upcomingRnd));
        }