private bool CheckTonTai(string strMa)
 {
     bool kq = false;
     clsDM_Thuoc obj = new clsDM_Thuoc();
     kq = obj.CheckTonTai(strMa);
     return kq;
 }
 private int Delete(string strMaDM)
 {
     int kq = 0;
     clsDM_Thuoc obj = new clsDM_Thuoc();
     if (MessageBox.Show("Bạn muốn xóa?", "Thông báo", MessageBoxButtons.YesNo) == DialogResult.Yes)
     {
         kq = obj.Delete(strMaDM);
     }
     return kq;
 }
        private int Delete()
        {
            int kq = 0;
            clsDM_Thuoc obj = new clsDM_Thuoc();
            if (MessageBox.Show("Bạn muốn xóa?", "Thông báo", MessageBoxButtons.YesNo) == DialogResult.Yes)
            {
                if (gridMaster.SelectedRows.Count != 0)
                {
                    DataGridViewRow row = this.gridMaster.SelectedRows[0];
                    string MaThuoc = row.Cells["MaThuoc"].Value.ToString();
                    kq = obj.Delete(MaThuoc);
                    if (kq > 0)
                    {
                        LoadGridView();
                    }
                }

            }
            return kq;
        }
        private void LoadGridView()
        {
            int index=0;
            if (gridMaster.RowCount > 0)
            {
                index = gridMaster.CurrentCell.RowIndex;
            }
            clsDM_Thuoc obj = new clsDM_Thuoc();
            dTableDanhMucThuoc = obj.GetAll();
            gridMaster.DataSource = dTableDanhMucThuoc;

            if (gridMaster.RowCount > 0)
            {
                gridMaster.Rows[index].Selected = true;
                gridMaster.FirstDisplayedScrollingRowIndex = index;
            }
        }
        private void FillData()
        {
            lblCapNhat.Text = "Thêm";
            if (MaDM != "")
            {
                txtMaThuoc.Enabled = false;
                lblCapNhat.Text = "Cập nhật";

                clsDM_Thuoc obj = new clsDM_Thuoc();
                obj.GetByKey(MaDM);
                txtMaThuoc.Text = obj.MaThuoc;
                txtTenThuoc.Text = obj.TenThuoc;
                txtDVT.Text = obj.DonViTinh;
                txtTenHoatChat.Text = obj.TenHoatChat;
                txtQuyCach.Text = obj.QuyCach;
                txtNhaSanXuat.Text = obj.NhaSanXuat;
                txtNuocSanXuat.Text = obj.NuocSanXuat;
                txtSoDK.Text = obj.SoDangKy;

                intNam.Text = obj.Nam.ToString();

                decDonGiaMua.Value = obj.DonGiaMua??0;
                decDonGiaCSKCB.Value = obj.DonGiaCSKCB??0;
                decDonGiaBHYT.Value = obj.DonGiaThau??0;

                chkConDung.Checked = obj.Active??false;
                chkBHYT.Checked = obj.TrongDanhMucBHYT??false;
                txtNhom1.Text = obj.MaNhom1;
                txtNhom2.Text = obj.MaNhom2;

                txtHanSuDung.Text = (obj.HanSuDung != null) ? string.Format("{0:dd/MM/yyyy}", obj.HanSuDung) : "";
                txtGhiChu.Text = obj.GhiChu;
                intSTTBYT.Text = obj.STTBYT;
                txtMaThuocBYT.Text = obj.MaThuocBYT;
                txtTenThuocBYT.Text = obj.TenThuocBYT;
            }
        }
        private int Update(string strMa)
        {
            int kq = 0;
            clsDM_Thuoc obj = new clsDM_Thuoc();
            obj.MaThuoc = strMa;
            obj.GetByKey(strMa);
            obj.TenThuoc = txtTenThuoc.Text;
            obj.TenHoatChat = txtTenHoatChat.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.MaNhom1 = txtNhom1.Text;
            obj.MaNhom2 = txtNhom2.Text;
            obj.STTBYT = intSTTBYT.Text;
            obj.MaThuocBYT = txtMaThuocBYT.Text;
            obj.TenThuocBYT = txtTenThuocBYT.Text;
            obj.GhiChu = txtGhiChu.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.DonViTinh = txtDVT.Text;
            obj.Active = chkConDung.Checked;
            obj.TrongDanhMucBHYT = chkBHYT.Checked;
            obj.SoDangKy = txtSoDK.Text;

            kq = obj.Update();
            return kq;
        }
        private int Insert()
        {
            if (CheckTonTai(txtMaThuoc.Text))
            {
                MessageBox.Show("Mã thuốc này đã được sử dụng. Xin nhập mã thuốc khác", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
                txtMaThuoc.Focus();
                return 0;
            }

            int kq = 0;
            clsDM_Thuoc obj = new clsDM_Thuoc();
            obj.MaThuoc = txtMaThuoc.Text;
            obj.TenThuoc = txtTenThuoc.Text;
            obj.TenHoatChat = txtTenHoatChat.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.MaNhom1 = txtNhom1.Text;
            obj.MaNhom2 = txtNhom2.Text;
            obj.STTBYT = intSTTBYT.Text;
            obj.MaThuocBYT = txtMaThuocBYT.Text;
            obj.TenThuocBYT = txtTenThuocBYT.Text;
            obj.GhiChu = txtGhiChu.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.DonViTinh = txtDVT.Text;
            obj.Active = chkConDung.Checked;
            obj.TrongDanhMucBHYT = chkBHYT.Checked;
            obj.SoDangKy = txtSoDK.Text;

            kq = obj.Insert();
            return kq;
        }
        private void ThemVaCapNhatChiPhi()
        {
            if (txtSoTheBHYT.Text.Replace("-", "").Length < 15)
            {
                MessageBox.Show("Vui lòng nhập số thẻ BHYT trước khi thêm chi phí.", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
                //lblThongBao.Text = "Vui lòng nhập số thẻ BHYT trước khi thêm chi phí!";
                //timerThongBao.Enabled = true;

                txtThuoc.Focus();
                return;
            }
            string MaChiPhi = txtThuoc.SelectedValues["MaChiPhi"].ToString();
            string LoaiChiPhi = txtThuoc.SelectedValues["LoaiChiPhi"].ToString();

            bool isUpdateChiTiet = false;

            isCapNhat = false;

            if (m_MaChiPhi.Trim().Length > 0 && m_LoaiChiPhi.Trim().Length > 0)
            {
                MaChiPhi = m_MaChiPhi;
                LoaiChiPhi = m_LoaiChiPhi;
                isUpdateChiTiet = true;
                isCapNhat = true;
            }

            DataRow[] existsRows = TableChiPhiThuoc.Select("MaChiPhi ='" + MaChiPhi + "'");

            if (LoaiChiPhi == "T")
            {
                clsDM_Thuoc t = new clsDM_Thuoc();
                t.GetByKey(MaChiPhi);

                if (existsRows.Length > 0)
                {
                    if (!isUpdateChiTiet && MessageBox.Show("Mã " + MaChiPhi + " chi phí này tồn tại? Bạn có muốn cập nhật số lượng?", "Thông báo", MessageBoxButtons.YesNo) == DialogResult.Yes)
                    {
                        existsRows[0]["SoLuong"] = (decimal)existsRows[0]["SoLuong"] + txtSoLuongThuoc.Value;

                    }
                    else
                    {
                        existsRows[0]["SoLuong"] = txtSoLuongThuoc.Value;
                    }

                    existsRows[0]["PhanTramDuocHuong"] = txtPhanTramHuong.Text;

                    decimal ThanhTienBHYT = Math.Round((decimal)existsRows[0]["SoLuong"] * t.DonGiaThau.Value);
                    decimal BHYTThanhToan = Math.Round(((decimal)existsRows[0]["SoLuong"] * t.DonGiaThau.Value) * (txtPhanTramHuong.Value / 100) * (t.TyLeThanhToan.Value / 100));
                    decimal NguoiBenhTra = ThanhTienBHYT - txtNguonKhacThuoc.Value - BHYTThanhToan;

                    existsRows[0]["ThanhTienBHYT"] = ThanhTienBHYT;
                    existsRows[0]["BHYTThanhToan"] = BHYTThanhToan;
                    existsRows[0]["NguoiBenhTra"] = NguoiBenhTra; ;
                    existsRows[0]["NguonKhac"] = txtNguonKhacThuoc.Value;
                    existsRows[0]["ChiPhiNgoaiDinhSuat"] = 0;
                    existsRows[0]["TyLeThanhToan"] = t.TyLeThanhToan.Value;
                    TableChiPhiThuoc.AcceptChanges();
                }
                else
                {

                    DataRow dr = TableChiPhiThuoc.NewRow();
                    dr["MaChiPhi"] = t.MaThuoc;
                    //dr["MaPhu"] = t.MaPhu ;
                    dr["TenChiPhi"] = t.TenThuoc;
                    dr["DonViTinh"] = t.DonViTinh;
                    dr["SoLuong"] = txtSoLuongThuoc.Value;
                    dr["DonGiaBHYT"] = t.DonGiaThau;
                    dr["PhanTramDuocHuong"] = txtPhanTramHuong.Text;

                    decimal ThanhTienBHYT = Math.Round(txtSoLuongThuoc.Value * t.DonGiaThau.Value);
                    decimal BHYTThanhToan = Math.Round((txtSoLuongThuoc.Value * t.DonGiaThau.Value) * (txtPhanTramHuong.Value / 100) * (t.TyLeThanhToan.Value / 100));
                    decimal NguoiBenhTra = ThanhTienBHYT - txtNguonKhacThuoc.Value - BHYTThanhToan;

                    dr["ThanhTienBHYT"] = ThanhTienBHYT;
                    dr["BHYTThanhToan"] = BHYTThanhToan;
                    dr["NguoiBenhTra"] = NguoiBenhTra;
                    dr["NguonKhac"] = txtNguonKhacThuoc.Value;
                    dr["ChiPhiNgoaiDinhSuat"] = 0;
                    dr["MaNhom1"] = t.MaNhom1;
                    dr["MaNhom2"] = t.MaNhom2;
                    dr["MaLoaiChiPhi"] = LoaiChiPhi;
                    //dr["VTYTDichVuKTC"] = t.VTYTDichVuKTC ;
                    //dr["DichVuKTC"] = t.DichVuKTC ;
                    dr["GhiChu"] = t.GhiChu;

                    dr["TyLeThanhToan"] = t.TyLeThanhToan.Value;

                    dr["GroupName"] = "Thuốc";

                    TableChiPhiThuoc.Rows.Add(dr);
                }
            }

            else if (LoaiChiPhi == "D")
            {
                clsDM_DichVu dv = new clsDM_DichVu();
                dv.GetByKey(MaChiPhi);

                if (existsRows.Length > 0)
                {
                    if (!isUpdateChiTiet && MessageBox.Show("Mã " + MaChiPhi + " chi phí này tồn tại? Bạn có muốn cập nhật số lượng?", "Thông báo", MessageBoxButtons.YesNo) == DialogResult.Yes)
                    {
                        existsRows[0]["SoLuong"] = (decimal)existsRows[0]["SoLuong"] + txtSoLuongThuoc.Value;
                    }
                    else
                    {
                        existsRows[0]["SoLuong"] = txtSoLuongThuoc.Value;
                    }
                    existsRows[0]["PhanTramDuocHuong"] = txtPhanTramHuong.Text;

                    decimal ThanhTienBHYT = Math.Round((decimal)existsRows[0]["SoLuong"] * dv.DonGiaBHYT.Value);
                    decimal BHYTThanhToan = Math.Round(((decimal)existsRows[0]["SoLuong"] * dv.DonGiaBHYT.Value) * (txtPhanTramHuong.Value / 100));
                    decimal NguoiBenhTra = ThanhTienBHYT - txtNguonKhacThuoc.Value - BHYTThanhToan;

                    existsRows[0]["ThanhTienBHYT"] = ThanhTienBHYT;
                    existsRows[0]["BHYTThanhToan"] = BHYTThanhToan;
                    existsRows[0]["NguoiBenhTra"] = NguoiBenhTra; ;
                    existsRows[0]["NguonKhac"] = txtNguonKhacThuoc.Value;
                    existsRows[0]["ChiPhiNgoaiDinhSuat"] = 0;
                    TableChiPhiThuoc.AcceptChanges();
                }
                else
                {

                    DataRow dr = TableChiPhiThuoc.NewRow();
                    dr["MaChiPhi"] = dv.MaDichVu;
                    dr["MaPhu"] = dv.MaKhac;
                    dr["TenChiPhi"] = dv.TenDichVu;
                    dr["DonViTinh"] = dv.DonViTinh;
                    dr["SoLuong"] = txtSoLuongThuoc.Value;
                    dr["DonGiaBHYT"] = dv.DonGiaBHYT;
                    dr["PhanTramDuocHuong"] = txtPhanTramHuong.Text;

                    decimal ThanhTienBHYT = Math.Round(txtSoLuongThuoc.Value * dv.DonGiaBHYT.Value);
                    decimal BHYTThanhToan = Math.Round((txtSoLuongThuoc.Value * dv.DonGiaBHYT.Value) * (txtPhanTramHuong.Value / 100));
                    decimal NguoiBenhTra = ThanhTienBHYT - txtNguonKhacThuoc.Value - BHYTThanhToan;

                    dr["ThanhTienBHYT"] = ThanhTienBHYT;
                    dr["BHYTThanhToan"] = BHYTThanhToan;
                    dr["NguoiBenhTra"] = NguoiBenhTra;
                    dr["NguonKhac"] = txtNguonKhacThuoc.Value;
                    dr["ChiPhiNgoaiDinhSuat"] = 0;
                    dr["MaNhom1"] = dv.MaNhom1;
                    dr["MaNhom2"] = dv.MaNhom2;
                    dr["MaLoaiChiPhi"] = LoaiChiPhi;
                    //dr["VTYTDichVuKTC"] = t.VTYTDichVuKTC ;
                    dr["DichVuKTC"] = dv.DichVuKTC.Value;
                    dr["GhiChu"] = dv.GhiChu;

                    dr["GroupName"] = "Dịch vụ";

                    TableChiPhiThuoc.Rows.Add(dr);
                }
            }
            else if (LoaiChiPhi == "V")
            {
                clsDM_VTYT vtyt = new clsDM_VTYT();
                vtyt.GetByKey(MaChiPhi);

                if (existsRows.Length > 0)
                {
                    if (!isUpdateChiTiet && MessageBox.Show("Mã " + MaChiPhi + " chi phí này tồn tại? Bạn có muốn cập nhật số lượng?", "Thông báo", MessageBoxButtons.YesNo) == DialogResult.Yes)
                    {
                        existsRows[0]["SoLuong"] = (decimal)existsRows[0]["SoLuong"] + txtSoLuongThuoc.Value;

                    }
                    else
                    {
                        existsRows[0]["SoLuong"] = txtSoLuongThuoc.Value;
                    }
                    existsRows[0]["PhanTramDuocHuong"] = txtPhanTramHuong.Text;
                    decimal ThanhTienBHYT = Math.Round((decimal)existsRows[0]["SoLuong"] * vtyt.DonGiaThau.Value);
                    decimal BHYTThanhToan = Math.Round(((decimal)existsRows[0]["SoLuong"] * vtyt.DonGiaThau.Value) * (txtPhanTramHuong.Value / 100));
                    decimal NguoiBenhTra = ThanhTienBHYT - txtNguonKhacThuoc.Value - BHYTThanhToan;

                    existsRows[0]["ThanhTienBHYT"] = ThanhTienBHYT;
                    existsRows[0]["BHYTThanhToan"] = BHYTThanhToan;
                    existsRows[0]["NguoiBenhTra"] = NguoiBenhTra; ;
                    existsRows[0]["NguonKhac"] = txtNguonKhacThuoc.Value;
                    existsRows[0]["ChiPhiNgoaiDinhSuat"] = 0;
                    TableChiPhiThuoc.AcceptChanges();
                }
                else
                {

                    DataRow dr = TableChiPhiThuoc.NewRow();
                    dr["MaChiPhi"] = vtyt.MaVTYT;
                    // dr["MaPhu"] = vtyt.;
                    dr["TenChiPhi"] = vtyt.TenVTYT;
                    dr["DonViTinh"] = vtyt.DonViTinh;
                    dr["SoLuong"] = txtSoLuongThuoc.Value;
                    dr["DonGiaBHYT"] = vtyt.DonGiaThau;
                    dr["PhanTramDuocHuong"] = txtPhanTramHuong.Text;

                    decimal ThanhTienBHYT = Math.Round(txtSoLuongThuoc.Value * vtyt.DonGiaThau.Value);
                    decimal BHYTThanhToan = Math.Round((txtSoLuongThuoc.Value * vtyt.DonGiaThau.Value) * (txtPhanTramHuong.Value / 100));
                    decimal NguoiBenhTra = ThanhTienBHYT - txtNguonKhacThuoc.Value - BHYTThanhToan;
                    dr["ThanhTienBHYT"] = ThanhTienBHYT;
                    dr["BHYTThanhToan"] = BHYTThanhToan;
                    dr["NguoiBenhTra"] = NguoiBenhTra;
                    dr["NguonKhac"] = txtNguonKhacThuoc.Value;

                    dr["ChiPhiNgoaiDinhSuat"] = 0;
                    dr["MaNhom1"] = vtyt.MaNhom1;
                    dr["MaNhom2"] = vtyt.MaNhom2;
                    dr["MaLoaiChiPhi"] = LoaiChiPhi;
                    dr["VTYTDichVuKTC"] = vtyt.VTYTDichVuKTC.Value;
                    //dr["DichVuKTC"] = t.DichVuKTC ;
                    dr["GhiChu"] = vtyt.GhiChu;
                    dr["GroupName"] = "Vật tư y tế";
                    TableChiPhiThuoc.Rows.Add(dr);
                }
            }
            else if (LoaiChiPhi == "M")
            {
                clsDM_Mau m = new clsDM_Mau();
                m.GetByKey(MaChiPhi);

                if (existsRows.Length > 0)
                {
                    if (MessageBox.Show("Mã " + MaChiPhi + " chi phí này tồn tại? Bạn có muốn cập nhật số lượng?", "Thông báo", MessageBoxButtons.YesNo) == DialogResult.Yes)
                    {
                        existsRows[0]["SoLuong"] = (decimal)existsRows[0]["SoLuong"] + txtSoLuongThuoc.Value;

                    }
                    else
                    {
                        existsRows[0]["SoLuong"] = txtSoLuongThuoc.Value;
                    }
                    existsRows[0]["PhanTramDuocHuong"] = txtPhanTramHuong.Text;

                    decimal ThanhTienBHYT = Math.Round((decimal)existsRows[0]["SoLuong"] * m.DonGiaBHYT.Value);
                    decimal BHYTThanhToan = Math.Round(((decimal)existsRows[0]["SoLuong"] * m.DonGiaBHYT.Value) * (txtPhanTramHuong.Value / 100));
                    decimal NguoiBenhTra = ThanhTienBHYT - txtNguonKhacThuoc.Value - BHYTThanhToan;

                    existsRows[0]["ThanhTienBHYT"] = ThanhTienBHYT;
                    existsRows[0]["BHYTThanhToan"] = BHYTThanhToan;
                    existsRows[0]["NguoiBenhTra"] = NguoiBenhTra; ;
                    existsRows[0]["NguonKhac"] = txtNguonKhacThuoc.Value;

                    existsRows[0]["ChiPhiNgoaiDinhSuat"] = 0;
                    TableChiPhiThuoc.AcceptChanges();
                }
                else
                {

                    DataRow dr = TableChiPhiThuoc.NewRow();
                    dr["MaChiPhi"] = m.MaMauVaChePhamMau;
                    // dr["MaPhu"] = vtyt.;
                    dr["TenChiPhi"] = m.TenMauVaChePhamMau;
                    dr["DonViTinh"] = m.DonViTinh;
                    dr["SoLuong"] = txtSoLuongThuoc.Value;
                    dr["DonGiaBHYT"] = m.DonGiaBHYT;
                    dr["PhanTramDuocHuong"] = txtPhanTramHuong.Text;

                    decimal ThanhTienBHYT = Math.Round(txtSoLuongThuoc.Value * m.DonGiaBHYT.Value);
                    decimal BHYTThanhToan = Math.Round((txtSoLuongThuoc.Value * m.DonGiaBHYT.Value) * (txtPhanTramHuong.Value / 100));
                    decimal NguoiBenhTra = ThanhTienBHYT - txtNguonKhacThuoc.Value - BHYTThanhToan;
                    dr["ThanhTienBHYT"] = ThanhTienBHYT;
                    dr["BHYTThanhToan"] = BHYTThanhToan;
                    dr["NguoiBenhTra"] = NguoiBenhTra;
                    dr["NguonKhac"] = txtNguonKhacThuoc.Value;

                    dr["ChiPhiNgoaiDinhSuat"] = 0;
                    dr["MaNhom1"] = m.MaNhom1;
                    dr["MaNhom2"] = m.MaNhom2;
                    dr["MaLoaiChiPhi"] = LoaiChiPhi;
                    //dr["VTYTDichVuKTC"] = vtyt.VTYTDichVuKTC;
                    //dr["DichVuKTC"] = t.DichVuKTC ;
                    dr["GhiChu"] = m.GhiChu;
                    dr["GroupName"] = "Máu và chế phẩm";
                    TableChiPhiThuoc.Rows.Add(dr);
                }
            }
            m_MaChiPhi = "";
            m_LoaiChiPhi = "";
            txtThuoc.ClearSelection();
            TinhTongGridView();
            txtThuoc.Focus();
        }
        private void LoadDataCombobox()
        {
            //Chú ý khi đổ dữ liệu lần đầu, không cho valuechanged sự kiện cbo

            //Load data cbo trạng thái - 2 trạng thái: "tạo mới" và "đã gửi BHXH". Mặc định là tạo mới, khi cột DaGuiBHXH trong bảng BangKe là 1 thì sẽ là "đã gửi BHXH"

            cboTinhTrang.DataSource = Utilities.Utils.GetTrangThai();
            cboTinhTrang.DisplayMember = "Name";
            cboTinhTrang.ValueMember = "Value";

            //Load data cbo mã nơi sinh sống - 3 nơi: K1, K2, K3
            cboMaNoiSinhSong.DisplayMember = "Name";
            cboMaNoiSinhSong.ValueMember = "Value";
            cboMaNoiSinhSong.DataSource = Utilities.Utils.GetKhuVucSong();

            //Load gioi tinh
            cboGioiTinh.DataSource = Utilities.Utils.GetGioiTinh();
            cboGioiTinh.DisplayMember = "Name";
            cboGioiTinh.ValueMember = "Value";

            //Load gioi tinh
            cboTuyenKham.DataSource = Utilities.Utils.GetTuyenKham();
            cboTuyenKham.DisplayMember = "Name";
            cboTuyenKham.ValueMember = "Value";

            //Load data cơ sở khám chữa bệnh

            clsDM_CSKCB cskcb = new clsDM_CSKCB();
            dtCSKCB = cskcb.GetAllActive();
            txtNoiChuyenDen.Values = dtCSKCB;
            List<CDisplayColumns> lstColCSKCB = new List<CDisplayColumns>();
            lstColCSKCB.Add(new CDisplayColumns("MaCSKCB", "Mã CSKCB", true, true));
            lstColCSKCB.Add(new CDisplayColumns("TenCSKCB", "Tên CSKCB", true, true));

            txtNoiChuyenDen.DisplayColumns = lstColCSKCB;

            //Load data cbo mức hưởng
            clsDM_MucHuong mucHuong = new clsDM_MucHuong();
            cboMucHuong.DataSource = mucHuong.GetAllActive();
            cboMucHuong.DisplayMember = "MucHuong";
            cboMucHuong.ValueMember = "MucHuong";
            cboMucHuong.SelectedValue = 0;

            //Load data cbo ICD

            clsDM_ICD icd = new clsDM_ICD();

            DataTable dt = new DataTable();
            dt = icd.GetAllActive();

            txtMaICD.Values = dt;
            List<CDisplayColumns> lstCol = new List<CDisplayColumns>();
            lstCol.Add(new CDisplayColumns("MaICD", "Mã ICD", true, true));
            lstCol.Add(new CDisplayColumns("TenICD", "Tên ICD", true, true));

            txtMaICD.DisplayColumns = lstCol;

            txtBenhKhac.DisplayColumns = lstCol;
            txtBenhKhac.Values = dt;

            //Load data cbo Thuốc

            clsDM_Thuoc thuoc = new clsDM_Thuoc();
            txtThuoc.DropDownSize = new Size(600, 155);
            txtThuoc.Values = thuoc.GetAllALL();

            List<CDisplayColumns> lstColT = new List<CDisplayColumns>();
            lstColT.Add(new CDisplayColumns("Nhom", "Nhóm", false, true));
            lstColT.Add(new CDisplayColumns("MaChiPhi", "Mã chi phí", true, true));
            lstColT.Add(new CDisplayColumns("TenChiPhi", "Tên chi phí", true, true));
            lstColT.Add(new CDisplayColumns("DonGiaBHYT", "Đơn giá", false, true));
            txtThuoc.DisplayColumns = lstColT;
            txtThuoc.DisplayMember = "TenChiPhi";

            //Danh mục phòng ban
            clsDM_PhongBan phongban = new clsDM_PhongBan();
            txtKhoa.DropDownSize = new Size(300, 110);
            txtKhoa.Values = phongban.GetAllActive();
            List<CDisplayColumns> lstColPB = new List<CDisplayColumns>();
            lstColPB.Add(new CDisplayColumns("MaPhongBan", "Mã Khoa", true, true));
            lstColPB.Add(new CDisplayColumns("TenPhongBan", "Tên khoa", true, true));
            txtKhoa.DisplayColumns = lstColPB;
            txtKhoa.DisplayMember = "TenPhongBan";
        }