private int Insert() { if (CheckTonTai(txtMaVTYT.Text)) { MessageBox.Show("Mã VTYT này đã được sử dụng. Xin nhập mã VTYT khác", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information); txtMaVTYT.Focus(); return 0; } int kq = 0; clsDM_VTYT obj = new clsDM_VTYT(); obj.MaVTYT = txtMaVTYT.Text; obj.TenVTYT = txtTenVTYT.Text; obj.DonViTinh = txtDVT.Text; obj.TenHoatChat = txtTenHoatChat.Text; obj.QuyCach = txtQuyCach.Text; obj.NhaSanXuat = txtNhaSanXuat.Text; obj.NuocSanXuat = txtNuocSanXuat.Text; obj.SoDangKy = txtSoDK.Text; obj.DonGiaMua = decDonGiaMua.Value; obj.DonGiaCSKCB = decDonGiaCSKCB.Value; obj.DonGiaThau = decDonGiaBHYT.Value; obj.VTYTThayThe = chkVTYT_TT.Checked; obj.VTYTDichVuKTC = chkKTC.Checked; obj.Active = chkConDung.Checked; obj.TrongDanhMucBHYT = chkBHYT.Checked; obj.MaNhom1 = txtNhom1.Text; obj.MaNhom2 = txtNhom2.Text; if (txtHanSuDung.Text.Length > 0) { DateTime dt = DateTime.ParseExact(txtHanSuDung.Text, "dd/MM/yyyy", CultureInfo.InvariantCulture); obj.HanSuDung = dt; } else { obj.HanSuDung = null; } obj.VTYTDichVuKTC = chkKTC.Checked; obj.Active = chkConDung.Checked; obj.MaVTYTBYT = txtMaVTYTBYT.Text; obj.GhiChu = txtGhiChu.Text; obj.STTBYT = intSTTBYT.Text; obj.MaVTYTBYT = txtMaVTYTBYT.Text; obj.TenVTYTBYT = txtTenVTYTBYT.Text; kq = obj.Insert(); return kq; }