コード例 #1
0
 public ActionResult DeleteConfirmed(int id)
 {
     ManageSuppliers manageSuppliers = db.ManageSuppliers.Find(id);
     db.ManageSuppliers.Remove(manageSuppliers);
     db.SaveChanges();
     return RedirectToAction("Index");
 }
コード例 #2
0
 public ActionResult Edit([Bind(Include = "SupplierID,SupplierName,SupplierCompany,SuppliersAddress,SupplierPhone,SupplierEmail")] ManageSuppliers manageSuppliers)
 {
     if (ModelState.IsValid)
     {
         db.Entry(manageSuppliers).State = EntityState.Modified;
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     return View(manageSuppliers);
 }
コード例 #3
0
        public ActionResult Create([Bind(Include = "SupplierID,SupplierName,SupplierCompany,SuppliersAddress,SupplierPhone,SupplierEmail")] ManageSuppliers manageSuppliers)
        {
            if (ModelState.IsValid)
            {
                db.ManageSuppliers.Add(manageSuppliers);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

            return View(manageSuppliers);
        }
コード例 #4
0
 // GET: ManageSuppliers/Delete/5
 public ActionResult Delete(int? id)
 {
     if (id == null)
     {
         return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
     }
     ManageSuppliers manageSuppliers = db.ManageSuppliers.Find(id);
     if (manageSuppliers == null)
     {
         return HttpNotFound();
     }
     return View(manageSuppliers);
 }