Esempio n. 1
0
 public ActionResult Edit(Palestrante palestrante)
 {
     if (ModelState.IsValid)
     {
         db.Entry(palestrante).State = EntityState.Modified;
         return(RedirectToAction("Index"));
     }
     return(View(palestrante));
 }
Esempio n. 2
0
 public ActionResult Edit(Track track)
 {
     if (ModelState.IsValid)
     {
         db.Entry(track).State = EntityState.Modified;
         return(RedirectToAction("Index"));
     }
     return(View(track));
 }
Esempio n. 3
0
 public ActionResult Edit(Palestra palestra)
 {
     if (ModelState.IsValid)
     {
         var entry = db.Entry(palestra);
         entry.State = EntityState.Modified;
         return(RedirectToAction("Index"));
     }
     LoadPalestrantesAndTracksToViewBag();
     return(View(palestra));
 }
Esempio n. 4
0
        // PUT api/Palestras/5
        public HttpResponseMessage PutPalestra(int id, Palestra palestra)
        {
            if (ModelState.IsValid && id == palestra.Id)
            {
                db.Entry(palestra).State = EntityState.Modified;

                try
                {
                    db.SaveChanges();
                } catch (DbUpdateConcurrencyException)
                {
                    return(Request.CreateResponse(HttpStatusCode.NotFound));
                }

                return(Request.CreateResponse(HttpStatusCode.OK, palestra));
            }
            else
            {
                return(Request.CreateResponse(HttpStatusCode.BadRequest));
            }
        }