//remove public void removeKhachHang(int id) { data = new DvdRentDbDataContext(); KhachHang item = data.KhachHangs.Single(n => n.Id == id); item.TrangThai = false; data.SubmitChanges(); }
public void removeDvd(int id) { data = new DvdRentDbDataContext(); DVD item = data.DVDs.Single(n => n.Id == id); item.TrangThai = false; data.SubmitChanges(); }
public void removeChiTietDatTruoc(int idDat, int idTitle) { data = new DvdRentDbDataContext(); ChiTietPhieuDatTruoc item = data.ChiTietPhieuDatTruocs.Single(n => n.IdPhieuDatTruoc == idDat && n.IdTitle == idTitle); item.Huy = false; data.SubmitChanges(); }
public void updateDvd(eDvd newitem) { DVD item = data.DVDs.Single(n => n.Id == newitem.IdDvd); item.Id = newitem.IdDvd; item.IdTitle = newitem.IdTiltle; item.TinhTrang = newitem.TinhTrang; item.TrangThai = newitem.TrangThai1; data.SubmitChanges(); }
//insert public void insertPhieuMuon(ePhieuMuon item) { data = new DvdRentDbDataContext(); data.PhieuMuons.InsertOnSubmit(new PhieuMuon() { IdKhachHang = item.IdKhach, NgayTao = item.NgayTao }); data.SubmitChanges(); }
public void insertDvd(eDvd item) { data = new DvdRentDbDataContext(); data.DVDs.InsertOnSubmit(new DVD() { IdTitle = item.IdTiltle, TinhTrang = item.TinhTrang, TrangThai = item.TrangThai1 }); data.SubmitChanges(); }
public void updateChiTietPhieuDatTruoc(eChiTietPhieuDatTruoc newitem) { data = new DvdRentDbDataContext(); ChiTietPhieuDatTruoc item = data.ChiTietPhieuDatTruocs.Single(n => n.IdPhieuDatTruoc == newitem.IdPhieuDatTruoc && n.IdTitle == newitem.IdTitle); item.IdPhieuDatTruoc = newitem.IdPhieuDatTruoc; item.IdTitle = newitem.IdTitle; item.TrangThai = newitem.TrangThai1; item.Huy = newitem.Huy; data.SubmitChanges(); }
//update public void updateKhachHang(eKhachHang newitem) { data = new DvdRentDbDataContext(); KhachHang item = data.KhachHangs.Single(n => n.Id == newitem.IdKhach); item.Id = newitem.IdKhach; item.Ten = newitem.TenKhach; item.DiaChi = newitem.DiaChiKhach; item.Sdt = newitem.SdtKhach; item.TrangThai = newitem.TrangThai1; data.SubmitChanges(); }
//insert public void insertKhachHang(eKhachHang item) { data = new DvdRentDbDataContext(); data.KhachHangs.InsertOnSubmit(new KhachHang() { Ten = item.TenKhach, DiaChi = item.DiaChiKhach, Sdt = item.SdtKhach, TrangThai = item.TrangThai1 }); data.SubmitChanges(); }
public void insertChiPhieuDatTruoc(eChiTietPhieuDatTruoc item) { data = new DvdRentDbDataContext(); data.ChiTietPhieuDatTruocs.InsertOnSubmit(new ChiTietPhieuDatTruoc() { IdPhieuDatTruoc = item.IdPhieuDatTruoc, IdTitle = item.IdTitle, TrangThai = item.TrangThai1, Huy = item.Huy }); data.SubmitChanges(); }
//update public void updateChiTietPhieuMuon(eChiTietPhieuMuon newitem) { data = new DvdRentDbDataContext(); ChiTietPhieuMuon item = data.ChiTietPhieuMuons.Single(n => n.IdDVD == newitem.IdDvd && n.IdPhieuMuon == newitem.IdPhieuMuon); item.IdPhieuMuon = newitem.IdPhieuMuon; item.IdDVD = newitem.IdDvd; item.PhiTre = newitem.PhiTre; item.NgayTra = newitem.NgayTra; item.TinhTrang = newitem.TinhTrang; data.SubmitChanges(); }
//insert public void insertChiTietPhieuMuon(eChiTietPhieuMuon item) { data = new DvdRentDbDataContext(); data.ChiTietPhieuMuons.InsertOnSubmit(new ChiTietPhieuMuon() { IdPhieuMuon = item.IdPhieuMuon, IdDVD = item.IdDvd, PhiTre = item.PhiTre, NgayTra = item.NgayTra, TinhTrang = item.TinhTrang }); data.SubmitChanges(); }
public void insertTitle(eTitle item) { data = new DvdRentDbDataContext(); data.Titles.InsertOnSubmit(new Title() { PhiTre = item.PhiTre, ThoiGianThue = item.ThoiGianThue, Gia = item.GiaThue, Ten = item.TenTitle, TheLoai = item.TheLoai, TrangThai = item.TrangThai1 }); data.SubmitChanges(); }