public ActionResult DeleteConfirmed(int id) { nonPlayer nonPlayer = db.nonPlayers.Find(id); db.nonPlayers.Remove(nonPlayer); db.SaveChanges(); return(RedirectToAction("Index")); }
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)); }
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)); }
// 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)); }
public getCoachName(GameRecord gameRecord, nonPlayer coach) { gr = gameRecord; coachName = coach.FullName; }