Ejemplo n.º 1
0
        /// <summary>
        /// hàm thực hiện việc hủy thanh toán
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void cmdPrint_Click(object sender, EventArgs e)
        {
            if (THU_VIEN_CHUNG.Laygiatrithamsohethong("KCB_THANHTOAN_BATNHAPLYDO_HUYTHANHTOAN", "1", false) == "1")
            {
                frm_Chondanhmucdungchung _Nhaplydohuythanhtoan = new frm_Chondanhmucdungchung("LYDOHUYTHANHTOAN", "Hủy thanh toán tiền Bệnh nhân", "Nhập lý do hủy thanh toán trước khi thực hiện...", "Lý do hủy thanh toán");
                _Nhaplydohuythanhtoan.ShowDialog();
                m_blnCancel = _Nhaplydohuythanhtoan.m_blnCancel;
                if (m_blnCancel)
                {
                    return;
                }
                ma_lydohuy = _Nhaplydohuythanhtoan.ma;
            }
            bool HUYTHANHTOAN_HUYBIENLAI = THU_VIEN_CHUNG.Laygiatrithamsohethong("HUYTHANHTOAN_HUYBIENLAI", "1", true) == "1";

            actionResult = _THANHTOAN.HuyThanhtoanDonthuoctaiquay(v_Payment_Id, null, ma_lydohuy, Utility.Int32Dbnull(grdPaymentDetail.CurrentRow.Cells[KcbThanhtoan.Columns.IdHdonLog], -1), HUYTHANHTOAN_HUYBIENLAI);
            int record = -1;

            switch (actionResult)
            {
            case ActionResult.Success:
                ModifyComamd();
                Utility.ShowMsg("Bạn hủy thông tin thanh toán thành công", "Thông báo");
                m_blnCancel = false;
                cmdExit.PerformClick();
                break;

            case ActionResult.ExistedRecord:
                Utility.ShowMsg("Thuốc đã cấp phát cho Bệnh nhân nên cần trả lại thuốc bên Dược mới có thể thực hiện hủy thanh toán", "Thông báo", MessageBoxIcon.Warning);
                break;

            case ActionResult.Error:
                Utility.ShowMsg("Lỗi trong quá trình hủy thông tin thanh toán", "Thông báo", MessageBoxIcon.Error);
                break;
            }
            //Rem lại
            //if (record <= 0 && Id_HD_LOG > 0)
            //{
            //   Utility.ShowMsg("Có lỗi trong quá trình hủy hóa đơn thanh toán.");
            //}
        }