public void TestThemDVFail() { dvDTO = null; int expected = 0; int actual = dvBus.insertDichVu(dvDTO); Assert.AreEqual(expected, actual); }
private void btnThem_Click(object sender, EventArgs e) { if (kiemtra()) { dvBUS = new DichVuBUS(); dvDTO = new DichVuDTO(); dvDTO.Madichvu = txtMaDV.Text; dvDTO.Tendichvu = txtTenDV.Text; dvDTO.Donvitinh = cmbDVtinh.Text; dvDTO.Gia = decimal.Parse(txtGia.Text); if (dvBUS.insertDichVu(dvDTO) == 1) { show_DichVu(); show_dvt(); } else { MessageBox.Show("Dữ liệu đã có!"); } } }