public void EditVModel(VehicleModel VModel) { using (db = new vjezbaEntities()) { db.Entry(VModel).State = System.Data.Entity.EntityState.Modified; db.SaveChanges(); } }
public void EditVMake(VehicleMake VMake) { using (vjezbaEntities db = new vjezbaEntities()) { db.Entry(VMake).State = System.Data.Entity.EntityState.Modified; db.SaveChanges(); } }
public ActionResult Edit([Bind(Include = "Id,Name")] VehicleMake vehicleMake) { if (ModelState.IsValid) { db.Entry(vehicleMake).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(vehicleMake)); }
public ActionResult Edit([Bind(Include = "Id,MakeId,Name")] VehicleModel vehicleModel) { if (ModelState.IsValid) { db.Entry(vehicleModel).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.MakeId = new SelectList(db.VehicleMake, "Id", "Name", vehicleModel.MakeId); return(View(vehicleModel)); }