Ejemplo n.º 1
0
        public ActionResult Create(RaceResult raceresult)
        {
            if (ModelState.IsValid)
            {
                db.RaceResultSet.Add(raceresult);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

            ViewBag.RaceId = new SelectList(db.RaceSet, "Id", "Pool", raceresult.RaceId);
            ViewBag.BoatId = new SelectList(db.BoatSet, "Id", "Name", raceresult.BoatId);
            return View(raceresult);
        }
Ejemplo n.º 2
0
 public ActionResult Edit(RaceResult raceresult)
 {
     if (ModelState.IsValid)
     {
         db.Entry(raceresult).State = EntityState.Modified;
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     ViewBag.RaceId = new SelectList(db.RaceSet, "Id", "Pool", raceresult.RaceId);
     ViewBag.BoatId = new SelectList(db.BoatSet, "Id", "Name", raceresult.BoatId);
     return View(raceresult);
 }