Ejemplo n.º 1
0
        /// <summary>
        /// hàm thực hiện việc in phiếu bảo hiểm cho bệnh nhân
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void cmdPrintAll_Click(object sender, EventArgs e)
        {
            KcbPhieuDct  objPhieuDct  = CreatePhieuDongChiTra();
            ActionResult actionResult = new KCB_THANHTOAN().UpdatePhieuDCT(objPhieuDct, objLuotkham);

            LAOKHO_INPHIEU_BAOHIEM();
        }
Ejemplo n.º 2
0
        void cmdChotDanhSach_Click(object sender, EventArgs e)
        {
            ActionResult actionResult = ActionResult.UNKNOW;

            if (radoChotMoi.Checked)
            {
                if (Utility.AcceptQuestion("Bạn có chắc chắn muốn chốt các bản ghi thanh toán còn sót lại hay không?", "Xác nhận chốt thanh toán", true))
                {
                    actionResult = new KCB_THANHTOAN().Chotbaocao(dtpNgayChot.Value, dtpNgayThanhToan.Value);
                }
            }
            else
            {
                if (Utility.AcceptQuestion("Bạn có chắc chắn muốn chốt các bản ghi thanh toán còn sót lại hay không?", "Xác nhận chốt thanh toán", true))
                {
                    actionResult = new KCB_THANHTOAN().ChotVetbaocao(dtpNgayChot.Value, dtpNgayThanhToan.Value);
                }
            }
            switch (actionResult)
            {
            case ActionResult.Success:
                Utility.ShowMsg("Đã chốt thanh toán thành công");
                break;

            case ActionResult.Error:
                Utility.ShowMsg("Có lỗi trong quá trình chốt thanh toán");
                break;
            }
        }
Ejemplo n.º 3
0
        private void cmdLuuThongTin_Click(object sender, EventArgs e)
        {
            try
            {
                if (!KTRA_DULIEU())
                {
                    return;
                }
                ActionResult actionResult = new KCB_THANHTOAN().UPDATE_SOBIENLAI(get_HoadonLog());
                switch (actionResult)
                {
                case ActionResult.Success:
                    m_blnCancel = false;
                    Utility.ShowMsg("Đã sửa biên lai thành công");
                    Close();
                    break;

                case ActionResult.Error:
                    Utility.ShowMsg("Sửa biên lai không thành công.");
                    break;
                }
            }
            catch (Exception ex)
            {
                Utility.CatchException("Có lỗi khi sửa biên lai", ex);
            }
        }
Ejemplo n.º 4
0
        void cmdInphoiBHYT_Click(object sender, EventArgs e)
        {
            DataTable m_dtPayment =
                new KCB_THANHTOAN().LaythongtinCacLanthanhtoan(objLuotkham.MaLuotkham,
                                                               Utility.Int32Dbnull(objLuotkham.IdBenhnhan), 0, objLuotkham.TrangthaiNoitru, 0,
                                                               globalVariables.MA_KHOA_THIEN);

            if (objLuotkham.MabenhChinh != null)
            {
                new INPHIEU_THANHTOAN_NGOAITRU().InPhoiBHYT(objLuotkham, m_dtPayment, dtPaymentDate.Value);
            }
            else
            {
                Utility.ShowMsg("Bệnh nhân chưa có mã ICD10 để in phôi BHYT.\n Quay lại phòng bác sỹ để nhập mã ICD10");
                return;
            }
        }
Ejemplo n.º 5
0
        /// <summary>
        /// hà thực hiện vieecin in phiếu đống chi trả cho bệnh nhân
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void cmdInPhieu_DongChiTra_Click(object sender, EventArgs e)
        {
            try
            {
                if (objLuotkham != null)
                {
                    KcbPhieuDct  objPhieuDct  = CreatePhieuDongChiTra();
                    ActionResult actionResult = new KCB_THANHTOAN().UpdatePhieuDCT(objPhieuDct, objLuotkham);
                    switch (actionResult)
                    {
                    case ActionResult.Success:
                        InPhieuDCT(objLuotkham);
                        break;

                    case ActionResult.Error:
                        Utility.ShowMsg("Lỗi trong quá trình cập nhập thông tin đồng  chi trả", "Thông báo lỗi", MessageBoxIcon.Error);
                        break;
                    }
                }
            }
            catch (Exception exception)
            {
            }
        }
Ejemplo n.º 6
0
        private void cmdPrint_Click(object sender, EventArgs e)
        {
            bool hasError = false;

            try
            {
                if (!ValidData())
                {
                    return;
                }
                try
                {
                    using (var Scope = new TransactionScope())
                    {
                        using (var dbScope = new SharedDbConnectionScope())
                        {
                            if (Utility.Int32Dbnull(grdList.GetValue(HoadonLog.Columns.IdHdonLog)) > 0)
                            {
                                new Update(HoadonLog.Schema).Set(HoadonLog.Columns.TrangThai).EqualTo(1).Where(
                                    HoadonLog.Columns.IdHdonLog).IsEqualTo(Utility.Int32Dbnull(grdList.GetValue(HoadonLog.Columns.IdHdonLog))).
                                Execute();
                            }
                            HoadonLog obj = new HoadonLog();
                            obj.IdThanhtoan = payment_ID;
                            obj.TongTien    = Utility.DecimaltoDbnull(grdList.GetValue(HoadonLog.Columns.TongTien));
                            obj.IdBenhnhan  = Utility.Int32Dbnull(grdList.GetValue(HoadonLog.Columns.IdBenhnhan));
                            obj.MaLuotkham  = Utility.sDbnull(grdList.GetValue(HoadonLog.Columns.MaLuotkham));
                            obj.MauHoadon   = txtMauHD.Text;
                            obj.KiHieu      = txtKiHieu.Text;
                            obj.IdCapphat   = Utility.Int32Dbnull(grdHoaDonCapPhat.GetValue(HoadonLog.Columns.IdCapphat));
                            obj.MaQuyen     = txtMaQuyen.Text;
                            obj.Serie       = txtSerie.Text;
                            obj.MaNhanvien  = globalVariables.UserName;
                            obj.MaLydo      = Utility.sDbnull(cboLy_Do.SelectedValue);
                            obj.NgayIn      = globalVariables.SysDate;
                            obj.TrangThai   = 0;
                            obj.IsNew       = true;
                            obj.Save();
                            new Update(HoadonCapphat.Schema).Set(HoadonCapphat.Columns.SerieHientai).EqualTo(txtSerie.Text).
                            Set(HoadonCapphat.Columns.TrangThai).EqualTo(1).
                            Where(HoadonCapphat.Columns.IdCapphat).IsEqualTo(Utility.Int32Dbnull(grdHoaDonCapPhat.GetValue(HoadonCapphat.Columns.IdCapphat))).
                            Execute();
                        }
                        Scope.Complete();
                    }
                }
                catch (Exception ex1)
                {
                    Utility.ShowMsg("Lỗi khi thực hiện in hóa đơn mẫu. Liên hệ VNS để được trợ giúp-->" + ex1.Message);
                    hasError = true;
                }
                if (!hasError)
                {
                    ActionResult actionResult = new KCB_THANHTOAN().Capnhattrangthaithanhtoan(payment_ID);
                    switch (actionResult)
                    {
                    case ActionResult.Success:
                        new INPHIEU_THANHTOAN_NGOAITRU().IN_HOADON(payment_ID);
                        break;

                    case ActionResult.Error:
                        Utility.ShowMsg("Lỗi trong quá trình in hóa đơn", "Thông báo lỗi", MessageBoxIcon.Warning);
                        break;
                    }
                }
                //DataRow dr = dtList.NewRow();
                //ProcessData(ref dr);
                //dtList.Rows.InsertAt(dr, 0);
                //dtList.AcceptChanges();
            }
            catch (Exception ex)
            {
                Utility.ShowMsg(ex.Message);
            }
            Close();
        }
Ejemplo n.º 7
0
        public bool InPhoiBHYT(KcbLuotkham objLuotkham, DataTable m_dtPayment, DateTime ngayIn)
        {
            try
            {
                KcbPhieuDct objPhieuDct = CreatePhieuDongChiTra(objLuotkham, m_dtPayment);
                objPhieuDct.NgayTao = ngayIn;
                ActionResult actionResult = new KCB_THANHTOAN().UpdatePhieuDCT(objPhieuDct, objLuotkham);
                if (actionResult == ActionResult.Success) //Tránh trường hợp in ra phôi mà ko đẩy vào CSDL
                {
                    DataTable mDtReportPhieuThu =
                        new KCB_THANHTOAN().NoiTruLaythongtinInphoiBHYT(-1, Utility.sDbnull(objLuotkham.MaLuotkham, ""),
                                                                        Utility.Int32Dbnull(objLuotkham.IdBenhnhan, -1), 0);
                    THU_VIEN_CHUNG.CreateXML(mDtReportPhieuThu);

                    //load thông tin của việc lấy dữ liệu vào datatable trong phiếu thanh toán)
                    if (mDtReportPhieuThu.Rows.Count <= 0)
                    {
                        Utility.ShowMsg("Không tìm thấy dữ liệu để in phôi BHYT ", "Thông báo");
                        return(false);
                    }
                    string ICD_Name = "";
                    string ICD_Code = "";
                    if (mDtReportPhieuThu.Rows.Count > 0)
                    {
                        GetChanDoanPhu(Utility.sDbnull(mDtReportPhieuThu.Rows[0]["ma_benhphu"], ""), ref ICD_Name, ref ICD_Code);
                    }
                    //foreach (DataRow dr in m_dtReportPhieuThu.Rows)
                    //{
                    //    dr["chuan_doanphu"] = Utility.sDbnull(dr["chuan_doanphu"]).Trim() == ""
                    //                          ? ICD_Name
                    //                          : Utility.sDbnull(dr["chuan_doanphu"]) + ";" + ICD_Name;
                    //    //dr[DmucBenh.Columns.MaBenh] = ICD_Code;
                    //   // dr["ma_icd"] = ICD_Code;
                    //}
                    //
                    foreach (DataRow drv in mDtReportPhieuThu.Rows)
                    {
                        drv["chuan_doanphu"] = Utility.sDbnull(drv["chuan_doanphu"]).Trim() == ""
                                          ? ICD_Name
                                          : Utility.sDbnull(drv["chuan_doanphu"]) + ";" + ICD_Name;
                        if (drv[KcbThanhtoanChitiet.Columns.IdLoaithanhtoan].ToString() == "1" ||//Chi phí KCB
                            drv[KcbThanhtoanChitiet.Columns.IdLoaithanhtoan].ToString() == "0" ||//Phí KCB kèm theo
                            drv[KcbThanhtoanChitiet.Columns.IdLoaithanhtoan].ToString() == "4" ||//Buồng giường
                            drv[KcbThanhtoanChitiet.Columns.IdLoaithanhtoan].ToString() == "8"   //Gói dịch vụ
                            )
                        {
                            drv["ten_loaidichvu"] = string.Empty;
                            drv["STT"]            = 1;
                            drv["id_loaidichvu"]  = -1;
                        }
                        else if (drv[KcbThanhtoanChitiet.Columns.IdLoaithanhtoan].ToString() == "2")
                        {
                            string maLoaidichvu = Utility.sDbnull(drv["id_loaidichvu"], -1);
                            //drv["id_loaidichvu"]-->Được xác định trong câu truy vấn
                            var objService = (from p in globalVariables.gv_dtDmucChung.AsEnumerable()
                                              where
                                              p[DmucChung.Columns.Loai].Equals("LOAIDICHVUCLS") &&
                                              p[DmucChung.Columns.Ma].Equals(maLoaidichvu)
                                              select p).FirstOrDefault();
                            // DmucChung objService = THU_VIEN_CHUNG.LaydoituongDmucChung("LOAIDICHVUCLS", maLoaidichvu);
                            if (objService != null)
                            {
                                drv["ten_loaidichvu"] = Utility.sDbnull(objService["ten"].ToString());
                                drv["STT"]            = Utility.sDbnull(objService["stt_hthi"]);
                            }
                        }
                        else if (drv[KcbThanhtoanChitiet.Columns.IdLoaithanhtoan].ToString() == "3" ||
                                 drv[KcbThanhtoanChitiet.Columns.IdLoaithanhtoan].ToString() == "5")
                        {
                            int drugId  = Utility.Int32Dbnull(drv["id_dichvu"], -1);
                            var objDrug = (from p in globalVariables.gv_dtDanhMucThuoc.AsEnumerable()
                                           where p[DmucThuoc.Columns.IdThuoc].Equals(drugId)
                                           select p).FirstOrDefault();
                            var objLoaithuoc = (from p in globalVariables.gv_dtLoaiThuoc.AsEnumerable()
                                                where objDrug != null && p[DmucLoaithuoc.Columns.IdLoaithuoc].Equals(objDrug["id_loaithuoc"].ToString())
                                                select p).FirstOrDefault();
                            //DmucThuoc objDrug = DmucThuoc.FetchByID(drugId);
                            //  DmucLoaithuoc objLoaithuoc = DmucLoaithuoc.FetchByID(objDrug.IdLoaithuoc);
                            if (objLoaithuoc != null)
                            {
                                if (objDrug != null)
                                {
                                    objDrug["kieu_thuocvattu"] = objLoaithuoc["kieu_thuocvattu"];
                                }
                            }
                            //LDrugType objLDrugType = LDrugType.FetchByID(objDrug.DrugTypeId);
                            if (objDrug != null && objDrug["kieu_thuocvattu"].ToString() == "THUOC")
                            {
                                drv["id_loaidichvu"]  = "THUOC";
                                drv["STT"]            = 1;
                                drv["ten_loaidichvu"] = "3.1 Trong danh mục BHYT";
                            }
                            else
                            {
                                drv["id_loaidichvu"]  = "VTTH";
                                drv["STT"]            = 2;
                                drv["ten_loaidichvu"] = "Vật tư tiêu hao";
                            }
                        }
                        if (drv[KcbThanhtoanChitiet.Columns.IdLoaithanhtoan].ToString() == "9")
                        {
                            drv["id_loaidichvu"]  = 1;
                            drv["STT"]            = 1;
                            drv["ten_loaidichvu"] = "Chi phí thêm  ";
                        }
                    }
                    mDtReportPhieuThu.AcceptChanges();
                    new INPHIEU_THANHTOAN_NOITRU(objPhieuDct.NgayTao).INPHOI_BHYT(
                        mDtReportPhieuThu, ngayIn, objLuotkham);
                }
                return(actionResult == ActionResult.Success);
            }
            catch (Exception ex)
            {
                Utility.ShowMsg("Lỗi khi thực hiện in phôi BHYT\n" + ex.Message);
                return(false);
            }
        }