コード例 #1
0
 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));
 }
コード例 #2
0
        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));
        }
コード例 #3
0
 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));
 }
コード例 #4
0
 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));
 }
コード例 #5
0
 public ActionResult Edit([Bind(Include = "EventDetailStatusID,EventDetailStatusName")] EventDetailStatus @event)
 {
     try
     {
         db.Entry(@event).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     catch
     {
         return(View());
     }
 }