private bool CheckTonTai(int intMucHuong)
 {
     bool kq = false;
     clsDM_MucHuong obj = new clsDM_MucHuong();
     kq = obj.CheckTonTai(intMucHuong);
     return kq;
 }
        public static List<clsDM_MucHuong> GetListMucHuong()
        {
            List<clsDM_MucHuong> lst = new List<clsDM_MucHuong>();
            SQLiteConnection m_dbConnection = new SQLiteConnection(ConfigurationManager.AppSettings["ConnectionString"]);
            m_dbConnection.Open();
            DataTable dt = new DataTable();
            string sql = "select * from DM_MucHuong Where Active=1 order by MucHuong";
            SQLiteCommand cmd = new SQLiteCommand(sql, m_dbConnection);
            SQLiteDataAdapter da = new SQLiteDataAdapter(cmd);
            da.Fill(dt);
            m_dbConnection.Close();

            foreach (DataRow row in dt.Rows)
            {
                clsDM_MucHuong mh = new clsDM_MucHuong();
                mh.MucHuong_Id = int.Parse(row["MucHuong_Id"].ToString());
                mh.MucHuong = int.Parse(row["MucHuong"].ToString());
                mh.PhanTram = (decimal)row["PhanTram"];
                mh.Active = (bool)row["Active"];
                lst.Add(mh);
            }
            return lst;
        }
 private void LoadGridView()
 {
     clsDM_MucHuong obj = new clsDM_MucHuong();
     TableDanhMucMucHuong = obj.GetAll();
     grdDM_MucHuong.DataSource = TableDanhMucMucHuong;
 }
        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";
        }