public ActionResult Edit([Bind(Include = "BranchID,BranchName,rowguid")] Branch branch) { if (ModelState.IsValid) { db.Entry(branch).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(branch)); }
public ActionResult Edit([Bind(Include = "StaffID,FullName,Birthday,Address,PID,PhoneNumber,Branch,rowguid")] Staff staff) { if (ModelState.IsValid) { db.Entry(staff).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index_Edit")); } return(View(staff)); }
public ActionResult Edit([Bind(Include = "CustomerID,FullName,Birthday,Address,PhoneNumber,Branch,PID,rowguid")] Customer customer) { if (ModelState.IsValid) { // defult function db.Entry(customer).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index_Edit")); } ViewBag.Branch = new SelectList(db.Branches, "BranchID", "BranchName", customer.Branch); return(View(customer)); }