public ActionResult DeleteConfirmed(int id)
        {
            MaintenanceSuppliers maintenanceSuppliers = Bs.GetTMaintenanceSupp(id);

            Bs.RemoveMaintenanceSupp(maintenanceSuppliers);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
 public ActionResult Edit([Bind(Include = "SupplierID,Supplier,Supplier_Product,Product_Cost,Product_Quantity,Supplier_Email")] MaintenanceSuppliers maintenanceSuppliers)
 {
     if (ModelState.IsValid)
     {
         db.Entry(maintenanceSuppliers).State = EntityState.Modified;
         Bs.AddMaintenanceSupp(maintenanceSuppliers);
         return(RedirectToAction("Index"));
     }
     return(View(maintenanceSuppliers));
 }
        public ActionResult Create([Bind(Include = "SupplierID,Supplier,Supplier_Product,Product_Cost,Product_Quantity,Supplier_Email")] MaintenanceSuppliers maintenanceSuppliers)
        {
            if (ModelState.IsValid)
            {
                Bs.AddMaintenanceSupp(maintenanceSuppliers);

                return(RedirectToAction("Index"));
            }

            return(View(maintenanceSuppliers));
        }
Beispiel #4
0
 public bool RemoveMaintenanceSupp(MaintenanceSuppliers maintenanceSuppliers)
 {
     try
     {
         db.maintenanceSuppliers.Remove(maintenanceSuppliers);
         db.SaveChanges();
         return(true);
     }
     catch (Exception ex)
     { return(false); }
 }
        // GET: MaintenanceSuppliers/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            MaintenanceSuppliers maintenanceSuppliers = Bs.GetTMaintenanceSupp(id);

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