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

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

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

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