예제 #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            FechaDeVencimiento fechaDeVencimiento = db.FechasDeVencimiento.Find(id);

            db.FechasDeVencimiento.Remove(fechaDeVencimiento);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
예제 #2
0
 public ActionResult Edit([Bind(Include = "ID,Mes,Año,PrimerVencimiento,SegundoVencimiento")] FechaDeVencimiento fechaDeVencimiento)
 {
     if (ModelState.IsValid)
     {
         db.Entry(fechaDeVencimiento).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(fechaDeVencimiento));
 }
예제 #3
0
        public ActionResult Create([Bind(Include = "ID,Mes,Año,PrimerVencimiento,SegundoVencimiento")] FechaDeVencimiento fechaDeVencimiento)
        {
            if (ModelState.IsValid)
            {
                db.FechasDeVencimiento.Add(fechaDeVencimiento);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(fechaDeVencimiento));
        }
예제 #4
0
        // GET: ContentAdmin/FechasDeVencimientos/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            FechaDeVencimiento fechaDeVencimiento = db.FechasDeVencimiento.Find(id);

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