Example #1
0
        public ActionResult DeleteConfirmed(string id)
        {
            pymes pymes = db.pymes.Find(id);

            db.pymes.Remove(pymes);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Example #2
0
 public ActionResult Edit([Bind(Include = "rut,nombre,descripcion,id_categoria,id_subcategoria")] pymes pymes)
 {
     if (ModelState.IsValid)
     {
         db.Entry(pymes).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.id_categoria    = new SelectList(db.categoria, "id", "nombre", pymes.id_categoria);
     ViewBag.id_subcategoria = new SelectList(db.sub_categoria, "id", "nombre", pymes.id_subcategoria);
     return(View(pymes));
 }
Example #3
0
        // GET: Pymes/Details/5
        public ActionResult Details(string id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            pymes pymes = db.pymes.Find(id);

            if (pymes == null)
            {
                return(HttpNotFound());
            }
            return(View(pymes));
        }
Example #4
0
        // GET: Pymes/Edit/5
        public ActionResult Edit(string id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            pymes pymes = db.pymes.Find(id);

            if (pymes == null)
            {
                return(HttpNotFound());
            }
            ViewBag.id_categoria    = new SelectList(db.categoria, "id", "nombre", pymes.id_categoria);
            ViewBag.id_subcategoria = new SelectList(db.sub_categoria, "id", "nombre", pymes.id_subcategoria);
            return(View(pymes));
        }