private void btnTimKiem_Click(object sender, EventArgs e) { grcBase.DataSource = DMTrungTamDataProvider.Search(new DMTrungTamInfor { MaTrungTam = txtTimKiemMa.Text.Trim(), TenTrungTam = txtTimKiemTen.Text.Trim().ToUpper() }); //grcBase.DataSource = DMTrungTamDataProvider.Search(txtTimKiemTen.Text.Trim(), txtTimKiemMa.Text.Trim()); }
//private bool Search(DMTrungTamInfor dmTrungTamInfor) //{ // return ((txtTimKiemTen.Text.Trim() == String.Empty || (txtTimKiemTen.Text.Trim() != String.Empty && // dmTrungTamInfor.TenTrungTam.ToLower().Contains(txtTimKiemTen.Text.Trim().ToLower()))) // && (txtTimKiemMa.Text.Trim() == String.Empty || (txtTimKiemMa.Text.Trim() != String.Empty && // dmTrungTamInfor.MaTrungTam.ToLower().Contains(txtTimKiemMa.Text.Trim().ToLower())))); //} private void btnTimKiem_Click(object sender, EventArgs e) { DMTrungTamInfor dmTrungTamInfor = new DMTrungTamInfor(); dmTrungTamInfor.TenTrungTam = txtTimKiemTen.Text; dmTrungTamInfor.MaTrungTam = txtTimKiemMa.Text; dgvList.DataSource = DMTrungTamDataProvider.Search(dmTrungTamInfor); }
public void TestTrungTam05_InsertSuccess() { frmDM_TrungTam frm = new frmDM_TrungTam(); frm.Oid = 0; frm.isAdd = true; frmChiTiet_TrungTam frmChiTietTrungTam = new frmChiTiet_TrungTam(frm); frmChiTietTrungTam.SetInput("TrungTam1", "111", "Thai Thinh 2", "043840856", "045621543", "hanhbd@gmail", "Unit test ma TrungTam", 1); frmChiTietTrungTam.TestSave(); List <DMTrungTamInfor> list = DMTrungTamDataProvider.Search(new DMTrungTamInfor { MaTrungTam = "111" }); //List<DMTrungTamInfor> list = DMTrungTamDataProvider.Search(t = "111"}); Assert.AreEqual(1, list.Count); }