public ActionResult Edit([Bind(Include = "ID,Registration,CarBrand,CarModel")] Vehicle vehicle) { if (ModelState.IsValid) { db.Entry(vehicle).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(vehicle)); }
public ActionResult Edit([Bind(Include = "ID,Year")] YearInput yearInput) { if (ModelState.IsValid) { db.Entry(yearInput).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(yearInput)); }
public ActionResult Edit([Bind(Include = "ID,NameSurname,City")] Distributor distributor) { if (ModelState.IsValid) { db.Entry(distributor).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(distributor)); }
public ActionResult Edit([Bind(Include = "ID,VehicleID,DistributorID,Month,YearInputID,Realization,PriceOfCostOfProduct,Gratis,Shortage,Storage,Unload,Commercialist,BrutoPay,BrutoPercent,NetoPay,NetoPercent,Fuel,Service,Consumables,RegistrationInsurance,OtherExpenses")] DistributorTable distributorTable) { if (ModelState.IsValid) { db.Entry(distributorTable).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.DistributorID = new SelectList(db.Distributors, "ID", "NameSurname", distributorTable.DistributorID); ViewBag.VehicleID = new SelectList(db.Vehicles, "ID", "Registration", distributorTable.VehicleID); ViewBag.YearInputID = new SelectList(db.YearInputs, "ID", "Year", distributorTable.YearInputID); return(View(distributorTable)); }