Ejemplo n.º 1
0
        public ActionResult DeleteConfirmed(int id)
        {
            Catig catig = db.Catigs.Find(id);

            db.Catigs.Remove(catig);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Ejemplo n.º 2
0
 public ActionResult Edit([Bind(Include = "id,Name,Details")] Catig catig)
 {
     if (ModelState.IsValid)
     {
         db.Entry(catig).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(catig));
 }
Ejemplo n.º 3
0
        public ActionResult Create([Bind(Include = "id,Name,Details")] Catig catig)
        {
            if (ModelState.IsValid)
            {
                db.Catigs.Add(catig);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(catig));
        }
Ejemplo n.º 4
0
        // GET: /Catig/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Catig catig = db.Catigs.Find(id);

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