Exemple #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            ProductMake productMake = db.ProductMakes.Find(id);

            db.ProductMakes.Remove(productMake);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Exemple #2
0
 public ActionResult Edit([Bind(Include = "MakeID,MakeName")] ProductMake productMake)
 {
     if (ModelState.IsValid)
     {
         db.Entry(productMake).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(productMake));
 }
Exemple #3
0
        public ActionResult Create([Bind(Include = "MakeID,MakeName")] ProductMake productMake)
        {
            if (ModelState.IsValid)
            {
                db.ProductMakes.Add(productMake);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(productMake));
        }
Exemple #4
0
        // GET: ProductMakes/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            ProductMake productMake = db.ProductMakes.Find(id);

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