Beispiel #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            nonPlayer nonPlayer = db.nonPlayers.Find(id);

            db.nonPlayers.Remove(nonPlayer);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Beispiel #2
0
 public ActionResult Edit([Bind(Include = "id,SRUNum,fName,lName,dob,address,postCode,phone,email")] nonPlayer nonPlayer)
 {
     if (ModelState.IsValid)
     {
         db.Entry(nonPlayer).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(nonPlayer));
 }
Beispiel #3
0
        public ActionResult Create([Bind(Include = "id,SRUNum,fName,lName,dob,address,postCode,phone,email")] nonPlayer nonPlayer)
        {
            if (ModelState.IsValid)
            {
                db.nonPlayers.Add(nonPlayer);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(nonPlayer));
        }
Beispiel #4
0
        // GET: nonPlayers/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            nonPlayer nonPlayer = db.nonPlayers.Find(id);

            if (nonPlayer == null)
            {
                return(HttpNotFound());
            }
            return(View(nonPlayer));
        }
        // GET: GameRecords/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            GameRecord gameRecord = db.GameRecords.Find(id);
            int        CoachID    = gameRecord.coachID;
            nonPlayer  coach      = db.nonPlayers.Find(CoachID);

            if (gameRecord == null)
            {
                return(HttpNotFound());
            }
            var ViewModel = new getCoachName(gameRecord, coach);

            return(View(ViewModel));
        }
Beispiel #6
0
 public getCoachName(GameRecord gameRecord, nonPlayer coach)
 {
     gr        = gameRecord;
     coachName = coach.FullName;
 }