示例#1
0
 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));
 }
示例#2
0
 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));
 }
示例#3
0
 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));
 }