public async Task <ActionResult> Edit([Bind(Include = "Id,CompanyName")] Company company) { if (ModelState.IsValid) { db.Entry(company).State = EntityState.Modified; await db.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(company)); }
public async Task <ActionResult> Edit([Bind(Include = "Id,FirstName,SurName,DOB,HouseNumber")] Customer customers) { if (ModelState.IsValid) { db.Entry(customers).State = EntityState.Modified; await db.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(customers)); }
public async Task <ActionResult> Edit([Bind(Include = "ContactId,Firstname,Surname,ContactTypeId,Phone,TwitterHandle,GenderTypeId,IsActive")] Contact contact) { if (ModelState.IsValid) { db.Entry(contact).State = EntityState.Modified; await db.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(contact)); }
public async Task <ActionResult> Edit([Bind(Include = "Id,Name,Volume,CompanyId")] Coffee coffee) { if (ModelState.IsValid) { db.Entry(coffee).State = EntityState.Modified; await db.SaveChangesAsync(); return(RedirectToAction("Index")); } ViewBag.CompanyId = new SelectList(db.Companies, "Id", "CompanyName", coffee.CompanyId); return(View(coffee)); }