예제 #1
0
        private void LoadThongTin()
        {
            try
            {
                clsDM_CSKCB obj = new clsDM_CSKCB();
                obj.GetByKey(txtMaCoSoKCB.Text);
                lblTenCSKCB.Text = obj.TenCSKCB;

                cboTuyen.SelectedValue = obj.Tuyen.ToString();
            }
            catch { }
        }
예제 #2
0
        //public bool CheckConnection(string path)
        //{
        //    try
        //    {
        //        SQLiteConnection m_dbConnection = new SQLiteConnection("Data Source=" + path + ";Version=3;");
        //        m_dbConnection.Open();
        //        m_dbConnection.Close();
        //        return true;
        //    }
        //    catch
        //    {
        //        return false;
        //    }
        //}
        public string GetThongTinCSKCB()
        {
            try
            {
                clsDM_CSKCB m_CSKCB = new clsDM_CSKCB();
                m_CSKCB.GetByKey(MaCSKCB);

                if (m_CSKCB.MaCSKCB != null)
                {
                    string LoaiTuyen = "";
                    switch (m_CSKCB.Tuyen)
                    {
                        case (byte)EnumTuyen.Xa:
                            LoaiTuyen = "Tuyến Xã";
                            TuyenKham = "xa";
                            break;

                        case (byte)EnumTuyen.Huyen:
                            LoaiTuyen = "Tuyến Huyện";
                            TuyenKham = "huyen";
                            break;
                        case (byte)EnumTuyen.Tinh:
                            LoaiTuyen = "Tuyến Tỉnh";
                            TuyenKham = "tinh";
                            break;
                        case (byte)EnumTuyen.TW:
                            LoaiTuyen = "Tuyến TƯ";
                            TuyenKham = "tw";
                            break;
                        default:
                            LoaiTuyen = "";
                            TuyenKham = "t";
                            break;

                    }

                    return "Mã CSKCB: " + m_CSKCB.MaCSKCB + " - " + m_CSKCB.TenCSKCB + " - " + LoaiTuyen;
                }
                else
                {
                    TuyenKham = string.Empty;
                    return "";
                }
            }
            catch
            {
                TuyenKham = string.Empty;
                return "Không tìm thấy CSDL.";
            }
        }
        private void LoadDataCombobox()
        {
            //Load gioi tinh
            cboGioiTinh.DataSource = Utilities.Utils.GetGioiTinh();
            cboGioiTinh.DisplayMember = "Name";
            cboGioiTinh.ValueMember = "Value";

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

            clsDM_CSKCB cskcb = new clsDM_CSKCB();
            DataTable 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;
            txtNoiChuyenDen.DisplayMember = "TenCSKCB";
        }
        private void btnPrint_Click(object sender, EventArgs e)
        {
            if (m_SoLuuTru.Trim() == "")
            {
                MessageBox.Show("Bạn vui lòng chọn giấy chuyển tuyến để in!", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
                //lblThongBao.Text = "Bạn vui lòng chọn bảng kê để in!";
                //timerThongBao.Enabled = true;
                return;
            }

            try
            {
                clsBaoCao bc = new clsBaoCao();
                clsDM_CSKCB objCSKCB = new clsDM_CSKCB();
                SystemConfig sys = SystemConfig.Instance;

                objCSKCB.GetByKey(sys.MaCSKCB);

                DataTable dt = new DataTable("BaoCao");
                dt = bc.GetBySoLuuTru(m_SoLuuTru,Code);

                string path = string.Format("{0}/Reports/{1}.rpt", Directory.GetCurrentDirectory(), "GiayRaVien");

                ReportDocument rpDocument = new ReportDocument();
                rpDocument.Load(path);
                rpDocument.SetDataSource(dt);

                ParameterDiscreteValue val = new ParameterDiscreteValue();
                val.Value = objCSKCB.TenCSKCB;

                ParameterDiscreteValue TenSYT = new ParameterDiscreteValue();
                TenSYT.Value = conf.TenSYT;

                ParameterValues paramVals = new ParameterValues();
                ParameterValues paramSYT = new ParameterValues();

                paramVals.Add(val);

                paramSYT.Add(TenSYT);

                rpDocument.ParameterFields["TenBenhVien"].CurrentValues = paramVals;

                rpDocument.ParameterFields["TenSYT"].CurrentValues = paramSYT;

                rpDocument.DataDefinition.ParameterFields["TenBenhVien"].ApplyCurrentValues(paramVals);
                rpDocument.DataDefinition.ParameterFields["TenSYT"].ApplyCurrentValues(paramSYT);

                int nCopy = (int)nupPage.Value;
                string PrinterName = cboMayIn.Text;
                rpDocument.PrintOptions.PrinterName = PrinterName;
                rpDocument.PrintToPrinter(nCopy, false, 0, 0);
            }
            catch
            {
                lblThongBao.Text = "Vui lòng kiểm tra lại máy in.";
                timerThongBao.Enabled = true;
            }
        }
        private void LoadDataCombobox()
        {
            //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";
            clsDM_CSKCB cskcb = new clsDM_CSKCB();
            dtCSKCB = cskcb.GetAll();

            //
            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;
        }
 private void txtMaCSKCBBD_Validating(object sender, CancelEventArgs e)
 {
     try
     {
         clsDM_CSKCB obj = new clsDM_CSKCB();
         obj.GetByKey(txtMaCSKCBBD.Text);
         txtTenCSKCBBD.Text = obj.TenCSKCB;
         CheckDungTuyen();
     }
     catch { }
 }
 private void LoadGridView()
 {
     clsDM_CSKCB obj = new clsDM_CSKCB();
     CSKCBBD = obj.GetAll();
     grdMaster.DataSource = CSKCBBD;
 }
예제 #8
0
        private void frmReport_Load(object sender, EventArgs e)
        {
            try
            {
                clsBaoCao bc = new clsBaoCao();
                clsDM_CSKCB objCSKCB = new clsDM_CSKCB();
                SystemConfig sys = SystemConfig.Instance;

                objCSKCB.GetByKey(sys.MaCSKCB);

                ParameterFields paramFields = new ParameterFields();

                //add ten benh vien
                ParameterField paramField = new ParameterField();
                ParameterDiscreteValue paramDiscreteValue = new ParameterDiscreteValue();
                paramField.Name = "TenBenhVien";
                paramDiscreteValue.Value = objCSKCB.TenCSKCB;
                paramField.CurrentValues.Add(paramDiscreteValue);
                paramFields.Add(paramField);
                //
                ParameterField paramField1 = new ParameterField();
                ParameterDiscreteValue paramDiscreteValue1 = new ParameterDiscreteValue();
                paramField1.Name = "TenSYT";
                paramDiscreteValue1.Value = sys.TenSYT;
                paramField1.CurrentValues.Add(paramDiscreteValue1);
                paramFields.Add(paramField1);
                DataTable dt = new DataTable("BaoCao");
                if (reportname.Trim().ToLower() == "BCVP".ToLower())
                {

                    dt = bc.GetBangKeNhom1(m_BangKe_Id);
                    dt.Columns.Add("BarCode", typeof(byte[]));

                    //BarcodeLib.Barcode b = new BarcodeLib.Barcode();

                    //if (dt.Rows.Count > 0)
                    //{
                    //    if (!string.IsNullOrEmpty(dt.Rows[0]["MaNguoiBenh"].ToString()))
                    //    {
                    //        Image bar = b.Encode(BarcodeLib.TYPE.CODE128, dt.Rows[0]["MaNguoiBenh"].ToString(), Color.Black, Color.White, 300, 150);
                    //        byte[] imageData = converterByte(bar);
                    //        dt.Rows[0]["BarCode"] = imageData;
                    //    }
                    //}

                    string path = string.Format("{0}/Reports/BCVP_{1}.rpt", Directory.GetCurrentDirectory(), m_LoaiBangKe);
                    rpDocument.Load(path);
                    rpDocument.SetDataSource(dt);

                    repordView.ParameterFieldInfo = paramFields;
                    repordView.ReportSource = rpDocument;
                }
                else
                {
                    dt = bc.GetBySoLuuTru(m_SoLuuTru, m_LoaiGiay);

                    string path = string.Format("{0}/Reports/{1}.rpt", Directory.GetCurrentDirectory(), reportname);
                    rpDocument.Load(path);
                    rpDocument.SetDataSource(dt);

                    repordView.ParameterFieldInfo = paramFields;
                    repordView.ReportSource = rpDocument;
                }
            }
            catch(Exception ex)
            {
            }
        }
예제 #9
0
        private void txtMaCSKCBBD_TextChanged(object sender, EventArgs e)
        {
            try
            {
                clsDM_CSKCB obj = new clsDM_CSKCB();
                obj.GetByKey(txtMaCSKCBBD.Text);
                txtTenCSKCBBD.Text = obj.TenCSKCB;//txtMaCSKCBBD.SelectedValues["TenCSKCB"].ToString();

            }
            catch { }
        }
예제 #10
0
        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";
        }
예제 #11
0
        private void LoadData(int status)
        {
            if (IsRunCheck == true)
            {
                return;
            }
            //Nếu trang thái là 3 và có số đăng ký ở trang thái thêm mới thì GetSoDangKy từ DangKyKhamBenh
            if (status == 3 && txtSoDK.Text.Trim().Length > 0 && TrangThai == "ThemMoi")
            {

                clsDangKyKhamBenh obj = new clsDangKyKhamBenh();
                obj.GetByKey(txtSoDK.Text.Trim());

                if (obj.KhamBenh_Id <= 0)
                {
                    txtSoDK.Text = string.Empty;
                    ResetControl();
                    return;
                }
                IsRunCheck = true;
                txtSoTheBHYT.Text = obj.SoTheBHYT.ToString();
                txtHoTen.Text = obj.HoTen;
                txtDiaChi.Text = obj.DiaChi;
                txtTuNgay.Text = string.Format("{0:dd/MM/yyyy}", obj.TuNgay);
                txtDenNgay.Text = string.Format("{0:dd/MM/yyyy}", obj.DenNgay);
                txtNgaySinh.Text = string.Format("{0:dd/MM/yyyy}", obj.NgaySinh);
                txtNgayVao.Text = string.Format("{0:dd/MM/yyyy}", obj.NgayDenKham);
                txtNamSinh.Text = obj.NgaySinh.Value.Year.ToString();

                clsDM_CSKCB objCSKCB = new clsDM_CSKCB();
                objCSKCB.GetByKey(obj.MaCSKCBBĐ);
                txtMaCSKCBBD.Text = obj.MaCSKCBBĐ;
                txtTenCSKCBBD.Text = objCSKCB.TenCSKCB;
                txtNoiChuyenDen.Text = obj.MaNoiChuyenDen;
                cboTuyenKham.SelectedValue = obj.LyDoVV.ToString();
                cboGioiTinh.SelectedValue = obj.GioiTinh.ToString();
                cboMaNoiSinhSong.SelectedValue = obj.MaNoiSinhSong.ToString();

                LoadMaCSKCBTheoMaTinh();
                //CheckDungTuyen();
                txtMaBenhNhan.Focus();
            }

            /*
             * Load thông tin từ Bảng Kê
             * Trang thái 0 : Get từ Form Search
             * Trang Thai 1: Get thông tin bằng Mã khám chữa bệnh
             * Trạng thái 2: Get thông tin bằng thẻ BHYT
             * Trang thái 3: Get bằng số đăng ký.
             */
            if (status == 0 || status == 1 || status == 2 || (TrangThai == "" && status == 3))
            {
                clsBangKe obj = new clsBangKe();
                if (TrangThai.Trim() == "" && status == 1)
                {
                    if (txtMaKhamChuBenh.Text.Trim().Length > 0)
                    {
                        obj.GetByMaKhamChuaBenh(txtMaKhamChuBenh.Text);
                        if (obj.MaKhamChuaBenh == null || obj.MaKhamChuaBenh.Trim() == "")
                        {
                            MessageBox.Show("Không tìm thấy Mã khám chữa bệnh " + txtMaKhamChuBenh.Text + " này.", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);

                            ResetControl();
                            txtMaKhamChuBenh.Focus();
                            return;
                        }
                        m_BangKe_Id = obj.BangKe_Id;
                    }
                    else
                    {
                        ResetControl();
                        txtMaKhamChuBenh.Focus();
                        return;
                    }
                    IsRunCheck = true;
                }
                else if (TrangThai.Trim() == "" && status == 2)
                {

                    if (txtSoTheBHYT.Text.Replace("-", "").Trim().Length > 0)
                    {
                        obj.GetByKey(txtSoTheBHYT.Text.Replace("-", "").Trim());
                        if (obj.MaKhamChuaBenh == null || obj.MaKhamChuaBenh.Trim() == "")
                        {
                            MessageBox.Show("Không tìm thấy số thẻ " + txtSoTheBHYT.Text + " này.", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);

                            ResetControl();
                            txtSoTheBHYT.Focus();
                            return;
                        }

                    }
                    else
                    {
                        ResetControl();
                        txtSoTheBHYT.Focus();
                        return;
                    }
                    IsRunCheck = true;
                }
                else if (TrangThai.Trim() == "" && status == 3)
                {
                    obj.GetBySoDK(txtSoDK.Text);
                    if (obj.MaKhamChuaBenh == null || obj.MaKhamChuaBenh.Trim() == "")
                    {
                        MessageBox.Show("Không tìm thấy số đăng ký " + txtSoDK.Text + " này.", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);

                        ResetControl();
                        txtSoDK.Focus();
                        return;
                    }

                }
                else if (status == 0)
                {
                    IsRunCheck = true;
                    obj.GetByKey(m_BangKe_Id);
                }
                m_BangKe_Id = obj.BangKe_Id;

                //txtSoHoSo.Text = obj.SoHoSo;

                txtSoHoSo.Text = obj.BangKe_Id.ToString();
                txtMaKhamChuBenh.Text = obj.MaKhamChuaBenh;

                //if (status != 2)
                //{
                txtSoTheBHYT.Text = obj.SoTheBHYT;
                //}

                txtTuNgay.Text = string.Format("{0:dd/MM/yyyy}", obj.TuNgayBH);
                txtDenNgay.Text = string.Format("{0:dd/MM/yyyy}", obj.DenNgayBH);
                txtDiaChi.Text = obj.DiaChi;
                txtKhoa.Text = obj.Khoa;
                txtHoTen.Text = obj.HoTen;
                txtMaBenhNhan.Text = obj.MaNguoiBenh;
                cboTuyenKham.SelectedValue = obj.TuyenKhamBenh.ToString();

                txtNamSinh.Text = obj.NamSinh.ToString();

                cboTinhTrang.SelectedIndex = obj.DaGuiBHYT.Value ? 1 : 0;

                txtSoNgay.Text = obj.SoNgayDieuTri.Value.ToString();
                txtNgayVao.Text = string.Format("{0:dd/MM/yyyy}", obj.NgayDenKham);
                txtNgayRa.Text = string.Format("{0:dd/MM/yyyy}", obj.NgayKetThuc);
                txtNgayQuyetToan.Text = string.Format("{0:dd/MM/yyyy}", obj.NgayQuyetToan);
                txtMaICD.Text = obj.MaICD;
                txtChanDoan.Text = obj.ChanDoan;
                cboGioiTinh.SelectedValue = obj.GioiTinh.ToString();
                cboMaNoiSinhSong.SelectedValue = obj.MaNoiSinhSong;
                txtMaCSKCBBD.Text = obj.MaCSKCBBanDau;
                txtTenCSKCBBD.Text = obj.TenCSKCBBanDau;
                txtNoiChuyenDen.Text = obj.MaNoiChuyenDen;
                txtNgaySinh.Text = string.Format("{0:dd/MM/yyyy}", obj.NgaySinh);
                txtBenhKhac.Text = obj.BenhKhac;

                chkChungTuKhongCCT.Checked = obj.ChungNhanKhongCCT.Value;

                txtSoDK.Text = obj.SoHoSo;

                LoadMaCSKCBTheoMaTinh();

                // txtMaCSKCBBD.UpdateData();
                txtThuoc.Clear();

                clsBangKeChiTiet chitiet = new clsBangKeChiTiet();
                TableChiPhiThuoc = chitiet.GetAll(m_BangKe_Id);
                grdChiPhiThuoc.DataSource = TableChiPhiThuoc;

                txtTongChiPhi.Text = string.Format("{0:#,##0}", TableChiPhiThuoc.Compute("Sum(ThanhTienBHYT)", "True"));
                txtBHYTThanhToan.Text = string.Format("{0:#,##0}", TableChiPhiThuoc.Compute("Sum(BHYTThanhToan)", "True"));
                txtNguoiBenhTra.Text = string.Format("{0:#,##0}", TableChiPhiThuoc.Compute("Sum(NguoiBenhTra)", "True"));
                txtNguonKhac.Text = string.Format("{0:#,##0}", TableChiPhiThuoc.Compute("Sum(NguonKhac)", "True"));
                txtNgoaiDinhSuat.Text = string.Format("{0:#,##0}", TableChiPhiThuoc.Compute("Sum(ChiPhiNgoaiDinhSuat)", "True"));
                txtThuoc.Focus();
                txtThuoc.Text = "";
                txtSoLuongThuoc.Value = 1;
                txtPhanTramHuong.Value = obj.PhanTramDuocHuong ?? 0;
            }

            //txtMaICD.UpdateData();

            this.grdChiPhiThuoc.Sort(this.grdChiPhiThuoc.Columns["GroupName"], ListSortDirection.Ascending);
            IsRunCheck = false;
        }