Ejemplo n.º 1
0
        public ActionResult RealDeleteConfirmed(short id)
        {
            OpcionesDelPlano opcionesDelPlano = db.OPCIONPLANO.Find(id);

            db.OPCIONPLANO.Remove(opcionesDelPlano);
            db.SaveChanges();
            TempData["Type"]    = "error";
            TempData["Message"] = "El registro se eliminó correctamente";
            return(RedirectToAction("Index"));
        }
Ejemplo n.º 2
0
 public ActionResult Edit([Bind(Include = "Id,Descripcion,Estado,FechaDeInicio,FechaDeFin")] OpcionesDelPlano opcionesDelPlano)
 {
     if (ModelState.IsValid)
     {
         db.Entry(opcionesDelPlano).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(opcionesDelPlano));
 }
Ejemplo n.º 3
0
        // GET: OpcionesDelPlanoes/Edit/5
        public ActionResult Edit(short?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            OpcionesDelPlano opcionesDelPlano = db.OPCIONPLANO.Find(id);

            if (opcionesDelPlano == null)
            {
                return(HttpNotFound());
            }
            return(View(opcionesDelPlano));
        }
Ejemplo n.º 4
0
        public ActionResult DeleteConfirmed(short id)
        {
            OpcionesDelPlano opcionesDelPlano = db.OPCIONPLANO.Find(id);

            if (opcionesDelPlano.Estado == "I")
            {
                opcionesDelPlano.Estado = "A";
            }
            else
            {
                opcionesDelPlano.Estado = "I";
            }
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Ejemplo n.º 5
0
        public ActionResult Create([Bind(Include = "Id,Descripcion,Estado,FechaDeInicio,FechaDeFin")] OpcionesDelPlano opcionesDelPlano)
        {
            if (ModelState.IsValid)
            {
                db.OPCIONPLANO.Add(opcionesDelPlano);
                string mensaje = Verificar(opcionesDelPlano.Id);
                if (mensaje == "")
                {
                    db.SaveChanges();
                    TempData["Type"]    = "success";
                    TempData["Message"] = "El registro se realizó correctamente";
                    return(RedirectToAction("Index"));
                }
                else
                {
                    ViewBag.Type    = "warning";
                    ViewBag.Message = mensaje;
                    return(View(opcionesDelPlano));
                }
            }

            return(View(opcionesDelPlano));
        }