コード例 #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            Velejador velejador = db.Velejadors.Find(id);

            db.Velejadors.Remove(velejador);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
コード例 #2
0
 public ActionResult Edit([Bind(Include = "id,Nome,Modalidade,Idade,Celular")] Velejador velejador)
 {
     if (ModelState.IsValid)
     {
         db.Entry(velejador).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(velejador));
 }
コード例 #3
0
        public ActionResult Create([Bind(Include = "id,Nome,Modalidade,Idade,Celular")] Velejador velejador)
        {
            if (ModelState.IsValid)
            {
                db.Velejadors.Add(velejador);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(velejador));
        }
コード例 #4
0
        // GET: Velejadors/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Velejador velejador = db.Velejadors.Find(id);

            if (velejador == null)
            {
                return(HttpNotFound());
            }
            return(View(velejador));
        }