Exemple #1
0
 public ActionResult Edit([Bind(Include = "Id_Nivel,Nivel,MaximoPuntaje,PuntosPregunta")] tbl_Niveles tbl_Niveles)
 {
     if (ModelState.IsValid)
     {
         db.Entry(tbl_Niveles).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(tbl_Niveles));
 }
Exemple #2
0
        public ActionResult Create([Bind(Include = "Id_Nivel,Nivel,MaximoPuntaje,PuntosPregunta")] tbl_Niveles tbl_Niveles)
        {
            if (ModelState.IsValid)
            {
                db.tbl_Niveles.Add(tbl_Niveles);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(tbl_Niveles));
        }
Exemple #3
0
        // GET: Niveles/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            tbl_Niveles tbl_Niveles = db.tbl_Niveles.Find(id);

            if (tbl_Niveles == null)
            {
                return(HttpNotFound());
            }
            return(View(tbl_Niveles));
        }
Exemple #4
0
        public ActionResult DeleteConfirmed(int id)
        {
            tbl_Niveles tbl_Niveles = db.tbl_Niveles.Find(id);

            db.tbl_Niveles.Remove(tbl_Niveles);
            try
            {
                db.SaveChanges();
            }
            catch (Exception ex)
            {
            }

            return(RedirectToAction("Index"));
        }