// GET: ProductSuppliers/Delete/5
        public ActionResult Delete(int?id)
        {
            BookingsModel.ProductSupplier supplier_ = db.ProductSuppliers.Find(id);
            if (supplier_ == null)      // if its not hthere
            {
                return(HttpNotFound()); //throw error
            }

            return(View(supplier_));//oftherwise through the view.
        }
        // GET: ProductSuppliers/Edit/5
        public ActionResult Edit(int id)
        {
            if (id == 0)                                                            //if ID is equal to null.
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));        //reutnr with error
            }
            BookingsModel.ProductSupplier supplier_ = db.ProductSuppliers.Find(id); //find the specified Staff.
            if (supplier_ == null)                                                  // if its not hthere
            {
                return(HttpNotFound());                                             //throw error
            }

            return(View(supplier_));//oftherwise through the view.
        }
 public ActionResult Edit(BookingsModel.ProductSupplier supplier_)
 {
     try
     {
         if (ModelState.IsValid)
         {
             db.Entry(supplier_).State = System.Data.Entity.EntityState.Modified;
         }
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     catch
     {
         return(View(supplier_));
     }
 }
 public ActionResult Create(BookingsModel.ProductSupplier supplier_)
 {
     try
     {
         if (ModelState.IsValid)                 //if model state is active/.
         {
             db.ProductSuppliers.Add(supplier_); //create the bu in the database
         }
         db.SaveChanges();                       //save the changes.
         return(RedirectToAction("Index"));      //retur nto index
     }
     catch
     {
         return(View(supplier_));
     }
 }
        public ActionResult Delete(int id, FormCollection collection)
        {
            if (id == 0)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); // displays error message is not existant
            }
            try
            {
                BookingsModel.ProductSupplier supplier_ = db.ProductSuppliers.Find(id);

                db.Entry(supplier_).State = System.Data.Entity.EntityState.Modified;
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            catch
            {
                return(View());
            }
        }