Beispiel #1
0
 public ActionResult Edit([Bind(Include = "MaKhachHang,TenKhachHang,DiaChiKhachHang,DienThoaiKhach,TenDangNhap,MatKhau,NgaySinh,GioiTinh,Email")] KhachHang khachHang)
 {
     if (ModelState.IsValid)
     {
         db.Entry(khachHang).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(khachHang));
 }
Beispiel #2
0
 public ActionResult Edit([Bind(Include = "MaKichCo,TenKichCo")] KichCo kichCo)
 {
     if (ModelState.IsValid)
     {
         db.Entry(kichCo).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(kichCo));
 }
 public ActionResult Edit([Bind(Include = "MaNhaSanXuat,TenNhaSanXuat,DiaChiNhaSanXuat,DienThoaiNhaSanXuat")] NhaSanXuat nhaSanXuat)
 {
     if (ModelState.IsValid)
     {
         db.Entry(nhaSanXuat).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(nhaSanXuat));
 }
 public ActionResult Edit([Bind(Include = "MaTheLoai,TenTheLoai")] TheLoai theLoai)
 {
     if (ModelState.IsValid)
     {
         db.Entry(theLoai).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(theLoai));
 }
Beispiel #5
0
 public ActionResult Edit([Bind(Include = "MaChatLieu,TenChatLieu")] ChatLieu chatLieu)
 {
     if (ModelState.IsValid)
     {
         db.Entry(chatLieu).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(chatLieu));
 }
 public ActionResult Edit([Bind(Include = "UserId,UserName,PassWord,Email,Phone,Avatar,Allowed")] USER uSER)
 {
     if (ModelState.IsValid)
     {
         db.Entry(uSER).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(uSER));
 }
Beispiel #7
0
 public ActionResult Edit([Bind(Include = "MaNhanVien,TenNhanVien,GioiTinh,NgaySinh,DienThoai,DiaChi")] NhanVien nhanVien)
 {
     if (ModelState.IsValid)
     {
         db.Entry(nhanVien).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(nhanVien));
 }
 public ActionResult Edit([Bind(Include = "MaDoiTuong,TenDoiTuong")] DoiTuong doiTuong)
 {
     if (ModelState.IsValid)
     {
         db.Entry(doiTuong).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(doiTuong));
 }
Beispiel #9
0
 public ActionResult Edit([Bind(Include = "SoHoaDon,MaSanPham,MaKhachHang,SoLuong,DonGia,ThanhTien,NgayDatHang,NgayGiaoHang")] ChiTietDatHang chiTietDatHang)
 {
     if (ModelState.IsValid)
     {
         db.Entry(chiTietDatHang).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.MaKhachHang = new SelectList(db.KhachHangs, "MaKhachHang", "TenKhachHang", chiTietDatHang.MaKhachHang);
     ViewBag.MaSanPham   = new SelectList(db.SanPhams, "MaSanPham", "TenSanPham", chiTietDatHang.MaSanPham);
     return(View(chiTietDatHang));
 }
 public ActionResult Edit([Bind(Include = "MaSanPham,TenSanPham,MaDoiTuong,MaTheLoai,MaKichCo,MaChatLieu,MaNhaSanXuat,DonViTinh,SoLuong,SoLuongBan,DonGia,MoTa,NgayCapNhat,HinhMinhHoa")] SanPham sanPham)
 {
     if (ModelState.IsValid)
     {
         db.Entry(sanPham).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.MaChatLieu   = new SelectList(db.ChatLieux, "MaChatLieu", "TenChatLieu", sanPham.MaChatLieu);
     ViewBag.MaDoiTuong   = new SelectList(db.DoiTuongs, "MaDoiTuong", "TenDoiTuong", sanPham.MaDoiTuong);
     ViewBag.MaKichCo     = new SelectList(db.KichCoes, "MaKichCo", "TenKichCo", sanPham.MaKichCo);
     ViewBag.MaNhaSanXuat = new SelectList(db.NhaSanXuats, "MaNhaSanXuat", "TenNhaSanXuat", sanPham.MaNhaSanXuat);
     ViewBag.MaTheLoai    = new SelectList(db.TheLoais, "MaTheLoai", "TenTheLoai", sanPham.MaTheLoai);
     return(View(sanPham));
 }
Beispiel #11
0
 public virtual void Update(T entity)
 {
     dbSet.Attach(entity);
     context.Entry(entity).State = EntityState.Modified;
     context.SaveChanges();
 }