Пример #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            tb_proveedores tb_proveedores = db.tb_proveedores.Find(id);

            db.tb_proveedores.Remove(tb_proveedores);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Пример #2
0
 public ActionResult Edit([Bind(Include = "id_proveedor,nombre_proveedor")] tb_proveedores tb_proveedores)
 {
     if (ModelState.IsValid)
     {
         db.Entry(tb_proveedores).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(tb_proveedores));
 }
Пример #3
0
        public ActionResult Create([Bind(Include = "id_proveedor,nombre_proveedor")] tb_proveedores tb_proveedores)
        {
            if (ModelState.IsValid)
            {
                db.tb_proveedores.Add(tb_proveedores);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(tb_proveedores));
        }
Пример #4
0
        // GET: proveedores/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            tb_proveedores tb_proveedores = db.tb_proveedores.Find(id);

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