public ActionResult EditUserInfo(Customer customer) { if (ModelState.IsValid) { customerRepo.Update(customer); customerRepo.SaveChanges(); ViewBag.Message = "修改成功"; } return View(customer); }
public ActionResult Create(Customer customer) { if (ModelState.IsValid) { db.Customer.Add(customer); db.SaveChanges(); return RedirectToAction("Index"); } return View(customer); }
public RegisterModel() { Customer = new Customer(); }
public ActionResult Edit(Customer customer) { if (ModelState.IsValid) { db.Entry(customer).State = EntityState.Modified; db.SaveChanges(); return RedirectToAction("Index"); } return View(customer); }