public ActionResult Edit([Bind(Include = "MediaTypeId,Name")] MediaType mediaType) { if (ModelState.IsValid) { db.Entry(mediaType).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(mediaType)); }
public ActionResult Edit([Bind(Include = "GenreId,TrackId,TotalTrackCharge,TimeCreated")] InvoiceStatistic invoiceStatistic) { if (ModelState.IsValid) { db.Entry(invoiceStatistic).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(invoiceStatistic)); }
public ActionResult Edit([Bind(Include = "ArtistId,Name")] Artist artist) { if (ModelState.IsValid) { db.Entry(artist).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(artist)); }
public ActionResult Edit([Bind(Include = "CustomerId,FirstName,LastName,Company,Address,City,State,Country,PostalCode,Phone,Fax,Email,SupportRepId")] Customer customer) { if (ModelState.IsValid) { db.Entry(customer).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.SupportRepId = new SelectList(db.Employee, "EmployeeId", "LastName", customer.SupportRepId); return(View(customer)); }
public ActionResult Edit([Bind(Include = "EmployeeId,LastName,FirstName,Title,ReportsTo,BirthDate,HireDate,Address,City,State,Country,PostalCode,Phone,Fax,Email")] Employee employee) { if (ModelState.IsValid) { db.Entry(employee).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.ReportsTo = new SelectList(db.Employees, "EmployeeId", "LastName", employee.ReportsTo); return(View(employee)); }
public ActionResult Edit([Bind(Include = "InvoiceId,CustomerId,InvoiceDate,BillingAddress,BillingCity,BillingState,BillingCountry,BillingPostalCode,Total")] Invoice invoice) { if (ModelState.IsValid) { db.Entry(invoice).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.CustomerId = new SelectList(db.Customer, "CustomerId", "FirstName", invoice.CustomerId); return(View(invoice)); }
public ActionResult Edit([Bind(Include = "AlbumId,Title,ArtistId")] Album album) { if (ModelState.IsValid) { db.Entry(album).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.ArtistId = new SelectList(db.Artists, "ArtistId", "Name", album.ArtistId); return(View(album)); }
public ActionResult Edit([Bind(Include = "InvoiceLineId,InvoiceId,TrackId,UnitPrice,Quantity")] InvoiceLine invoiceLine) { if (ModelState.IsValid) { db.Entry(invoiceLine).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.InvoiceId = new SelectList(db.Invoice, "InvoiceId", "BillingAddress", invoiceLine.InvoiceId); ViewBag.TrackId = new SelectList(db.Track, "TrackId", "Name", invoiceLine.TrackId); return(View(invoiceLine)); }
public ActionResult Edit(Track track) { if (ModelState.IsValid) { db.Entry(track).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.AlbumId = new SelectList(db.Albums, "AlbumId", "Title", track.AlbumId); ViewBag.GenreId = new SelectList(db.Genres, "GenreId", "Name", track.GenreId); ViewBag.MediaTypeId = new SelectList(db.MediaTypes, "MediaTypeId", "Name", track.MediaTypeId); return(View(track)); }
public ActionResult Edit([Bind(Include = "TrackId,Name,AlbumId,MediaTypeId,GenreId,Composer,Milliseconds,Bytes,UnitPrice")] Track track) { if (ModelState.IsValid) { db.Entry(track).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.AlbumId = new SelectList(db.Album, "AlbumId", "Title", track.AlbumId); ViewBag.GenreId = new SelectList(db.Genre, "GenreId", "Name", track.GenreId); ViewBag.MediaTypeId = new SelectList(db.MediaType, "MediaTypeId", "Name", track.MediaTypeId); return(View(track)); }
public void Update(Customer entity) { _ChinookEntities.Customer.Attach(entity); _ChinookEntities.Entry(entity).State = EntityState.Modified; }
public void Update(Employee entity) { _ChinookEntities.Employee.Attach(entity); _ChinookEntities.Entry(entity).State = EntityState.Modified; }