Esempio n. 1
0
 public ActionResult Edit([Bind(Include = "Product_TypeID,Name")] Product_Type product_Type)
 {
     if (ModelState.IsValid)
     {
         db.Entry(product_Type).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(product_Type));
 }
Esempio n. 2
0
 public ActionResult Edit([Bind(Include = "CountryID,Name")] Country country)
 {
     if (ModelState.IsValid)
     {
         db.Entry(country).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(country));
 }
Esempio n. 3
0
 public ActionResult Edit([Bind(Include = "MotorID,Name")] Motor motor)
 {
     if (ModelState.IsValid)
     {
         db.Entry(motor).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(motor));
 }
Esempio n. 4
0
 public ActionResult Edit([Bind(Include = "StateID,Name,CountryID")] State state)
 {
     if (ModelState.IsValid)
     {
         db.Entry(state).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.CountryID = new SelectList(db.Country, "CountryID", "Name", state.CountryID);
     return(View(state));
 }
Esempio n. 5
0
 public ActionResult Edit([Bind(Include = "CityID,Name,StateID")] City city)
 {
     if (ModelState.IsValid)
     {
         db.Entry(city).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.StateID = new SelectList(db.State, "StateID", "Name", city.StateID);
     return(View(city));
 }
Esempio n. 6
0
 public ActionResult Edit([Bind(Include = "SupplierID,Name,Description,Address,Lat,Long,CityID")] Supplier supplier)
 {
     if (ModelState.IsValid)
     {
         db.Entry(supplier).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.CityID = new SelectList(db.City, "CityID", "Name", supplier.CityID);
     return(View(supplier));
 }
Esempio n. 7
0
 public ActionResult Edit([Bind(Include = "ProductID,Description,Price,Product_TypeID")] Product product)
 {
     if (ModelState.IsValid)
     {
         db.Entry(product).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.Product_TypeID = new SelectList(db.Product_Type, "Product_TypeID", "Name", product.Product_TypeID);
     return(View(product));
 }
Esempio n. 8
0
 public ActionResult Edit([Bind(Include = "DerivationID,Description,MotorID,FuelID,Mnemonic_Bodystyle")] Derivation derivation)
 {
     if (ModelState.IsValid)
     {
         db.Entry(derivation).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.Mnemonic_Bodystyle = new SelectList(db.CarBuild, "Mnemonic_Bodystyle", "Mnemonic_Vehicle", derivation.Mnemonic_Bodystyle);
     ViewBag.FuelID             = new SelectList(db.Fuel, "FuelID", "Name", derivation.FuelID);
     ViewBag.MotorID            = new SelectList(db.Motor, "MotorID", "Name", derivation.MotorID);
     return(View(derivation));
 }