Esempio n. 1
0
 public ActionResult DangKy(KhachHang kh)
 {
     if (ModelState.IsValid)
     {
         using (MotorbikesShopEntities db = new MotorbikesShopEntities())
         {
             db.KhachHangs.Add(kh);
             db.SaveChanges();
             ModelState.Clear();
             kh = null;
             ViewBag.Success = "Đăng ký thành công";
             return(Redirect("DangNhap"));
         }
     }
     return(View(kh));
 }