private void btTra_sach_Click(object sender, EventArgs e) { for (int i = 0; i < ds_PM.count(); i++) { if (tb_MDG_tra.Text == ds_PM[i].Ma_doc_gia) { Phieutra b = new Phieutra(ds_PM[i].Ma_phieu_muon, ds_PM[i].Ma_doc_gia, ds_PM[i].Ngay_muon, ds_PM[i].Ngay_hen_tra, DateTime.Now, ds_PM[i].Ma_sach_1, ds_PM[i].Ma_sach_2); ds_PT.add(b); PHIEUTRA pt = new PHIEUTRA(); pt.MAPHIEUMUON = ds_PM[i].Ma_phieu_muon; pt.NGAYTRA = DateTime.Now; a.PHIEUTRAs.InsertOnSubmit(pt); a.SubmitChanges(); TimeSpan TG = b.Ngay_tra - b.Ngay_hen_tra; if (TG.Days > 30) { MessageBox.Show("Tra qua han 1 thang\nTien phat: 20000VND"); } break; } } loadlistPT(); add_lvSach(); }
partial void UpdatePHIEUTRA(PHIEUTRA instance);
partial void DeletePHIEUTRA(PHIEUTRA instance);
partial void InsertPHIEUTRA(PHIEUTRA instance);