예제 #1
0
        private void btnXoa_Click(object sender, EventArgs e)
        {
            DialogResult check = MessageBox.Show("Bạn có muốn xóa không", "Thông báo", MessageBoxButtons.YesNo, MessageBoxIcon.Question);

            if (check == DialogResult.Yes)
            {
                ENTITY.PhieuMuon pm = new ENTITY.PhieuMuon();
                pm.ID_PhieuMuon = txtMaPhieuMuon.Text.Trim();
                DAL.PhieuMuon_Controler p = new DAL.PhieuMuon_Controler();
                p.deletePhieuMuon(pm);
            }
            showLsvPhieuMuon();
            lockControl();
        }
예제 #2
0
 private void btnLuu_Click(object sender, EventArgs e)
 {
     ENTITY.PhieuMuon p = new ENTITY.PhieuMuon();
     p.ID_PhieuMuon = txtMaPhieuMuon.Text.Trim();
     p.ID_NhanVien  = txtMaNhanVien.Text.Trim();
     p.ID_SinhVien  = txtMaSinhVien.Text.Trim();
     p.NgayMuon     = txtNgayMuon.Text.Trim();
     p.NgayTra      = txtNgayTra.Text.Trim();
     p.HanTra       = txtHanTra.Text.Trim();
     p.TienPhat     = txtTienPhat.Text.Trim();
     DAL.PhieuMuon_Controler pm = new DAL.PhieuMuon_Controler();
     if (kt == true)
     {
         pm.insertPhieuMuon(p);
     }
     else
     {
         pm.editPhieuMuon(p);
     }
     lockControl();
     showLsvPhieuMuon();
 }