コード例 #1
0
        public ActionResult DeleteConfirmed(long id)
        {
            Bailarin bailarin = db.Bailarin.Find(id);

            db.Bailarin.Remove(bailarin);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
コード例 #2
0
 public ActionResult Edit([Bind(Include = "Id,Documento,Nombre,Apellido,Edad,Sexo,Telefono,Email")] Bailarin bailarin)
 {
     if (ModelState.IsValid)
     {
         db.Entry(bailarin).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(bailarin));
 }
コード例 #3
0
        public ActionResult Create([Bind(Include = "Id,Documento,Nombre,Apellido,Edad,Sexo,Telefono,Email")] Bailarin bailarin)
        {
            if (ModelState.IsValid)
            {
                db.Bailarin.Add(bailarin);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

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

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