public ActionResult Edit([Bind(Include = "TounamentID,TournamentName")] Tournament tournament) { if (ModelState.IsValid) { db.Entry(tournament).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(tournament)); }
public IHttpActionResult PutEventDetail(long id, EventDetail eventDetail) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != eventDetail.EventDetailID) { return(BadRequest()); } db.Entry(eventDetail).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!EventDetailExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public ActionResult Edit([Bind(Include = "EventID,TounamentID,EventName,EventNumber,EventDateTime,EventEndDateTime,AutoClose")] Event @event) { if (ModelState.IsValid) { db.Entry(@event).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.TounamentID = new SelectList(db.Tournaments, "TounamentID", "TournamentName", @event.TounamentID); return(View(@event)); }
public ActionResult Edit([Bind(Include = "EventDetailID,EventID,EventDetailStatusID,EventDetailName,EventDetailNumber,EventDetailOdd,FinishingPosition,FirsTimer")] EventDetail eventDetail) { if (ModelState.IsValid) { db.Entry(eventDetail).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.EventID = new SelectList(db.Events, "EventID", "EventName", eventDetail.EventID); return(View(eventDetail)); }
public ActionResult Edit([Bind(Include = "EventDetailStatusID,EventDetailStatusName")] EventDetailStatus @event) { try { db.Entry(@event).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } catch { return(View()); } }