Beispiel #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.PhieuVatTu p = new ENTITY.PhieuVatTu();
                p.ID_PhieuVatTu = txtID_PhieuVatTu.Text.Trim();
                DAL.PhieuVatTu_Model pvt = new DAL.PhieuVatTu_Model();
                pvt.deletePhieuVatTu(p);
            }
            showLsvPhieuVatTu();
            lockControl();
            clearControl();
        }
Beispiel #2
0
 private void btnLuu_Click(object sender, EventArgs e)
 {
     ENTITY.PhieuVatTu p = new ENTITY.PhieuVatTu();
     p.ID_PhieuVatTu = txtID_PhieuVatTu.Text.Trim();
     p.MaNPT         = txtMaNPT.Text.Trim();
     p.ThoiGian      = dtThoiGian.Value.ToShortDateString();
     DAL.PhieuVatTu_Model pvt = new DAL.PhieuVatTu_Model();
     if (kt == true)
     {
         pvt.insertPhieuVatTu(p);
     }
     else
     {
         pvt.editPhieuVatTu(p);
     }
     showLsvPhieuVatTu();
     clearControl();
     lockControl();
 }