Ejemplo n.º 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.TheLoai tl = new ENTITY.TheLoai();
                tl.ID_TheLoai = txtMaTheLoai.Text.Trim();
                DAL.TheLoai_Controler t = new DAL.TheLoai_Controler();
                t.deleteTheLoai(tl);
            }
            showLsvTheLoai();
            lockControl();
        }
Ejemplo n.º 2
0
 private void btnLuu_Click(object sender, EventArgs e)
 {
     ENTITY.TheLoai t = new ENTITY.TheLoai();
     t.ID_TheLoai = txtMaTheLoai.Text.Trim();
     t.TenTheLoai = txtTenTheLoai.Text.Trim();
     DAL.TheLoai_Controler tl = new DAL.TheLoai_Controler();
     if (kt == true)
     {
         tl.insertTheLoai(t);
     }
     else
     {
         tl.editTheLoai(t);
     }
     lockControl();
     showLsvTheLoai();
 }