public ActionResult create(VehicleMake v) { using (db) { db.VehicleMake.Add(v); db.SaveChanges(); } return(View()); }
public ActionResult Create([Bind(Include = "Id,MakeId,Name")] VehicleModel vehicleModel) { if (ModelState.IsValid) { db.VehicleModel.Add(vehicleModel); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.MakeId = new SelectList(db.VehicleMake, "Id", "Name", vehicleModel.MakeId); return(View(vehicleModel)); }
public void AddVehicleModel(VehicleModel vehiceMod) { using (db = new vjezbaEntities()) { db.VehicleModel.Add(vehiceMod); db.SaveChanges(); } }
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 void AddVehicleMake(VehicleMake VehiceM) { using (vjezbaEntities db = new vjezbaEntities()) { db.VehicleMakes.Add(VehiceM); db.SaveChanges(); } }
public void DeleteVehicleModel(int VModelId) { using (db = new vjezbaEntities()) { vehicleModel = new VehicleModel(); vehicleModel = db.VehicleModel.Find(VModelId); db.VehicleModel.Remove(vehicleModel); db.SaveChanges(); } }
public void DeleteVehicleMake(int VMakeId) { using (db = new vjezbaEntities()) { vehicleMake = new VehicleMake(); vehicleMake = db.VehicleMake.Find(VMakeId); db.VehicleMake.Remove(vehicleMake); db.SaveChanges(); } }
public void DeleteVehicleMake(int VMakeId) { using (vjezbaEntities db = new vjezbaEntities()) { VehicleMake Make = new VehicleMake(); Make = db.VehicleMakes.Find(VMakeId); db.VehicleMakes.Remove(Make); db.SaveChanges(); } }