private void bt_print_Click(object sender, EventArgs e)
        {
            Frm_Report a = new Frm_Report();
            string  from_date = "", to_date = "";
            from_date = Frm_MC_Chargeback.gldtFrom;
            to_date = Frm_MC_Chargeback.gldtTo;
            Ref_no_2nd = tbRef_no.Text;
            string sql = "", err = "";

            #region arbitration 2nd presentment
            if (rbArbitration.Checked == true)
            {
                Frm_MC_Arbitration_2nd_Presentment b = new Frm_MC_Arbitration_2nd_Presentment();
               b.Show();
            }
            #endregion arbitration 2nd presentment

            #region reversal 2nd presentment
            if (rbReversal2nd.Checked == true)
            {
                if (Frm_main.admin_flag)
                {

                    sql = " select a.microfilm_ref_number as Ref_no,a.card_number as Card_no,a.card_account_number,a.cr_account_number,";
                }
                else
                {
                    sql = " select a.microfilm_ref_number as Ref_no, substr(a.card_number,1,4)||'xxxxxxxx'||substr(a.card_number,-4) as Card_no, substr(a.card_account_number,1,4)||'xxxxxxxx'||substr(a.card_account_number,-4) card_account_number,substr(a.cr_account_number,1,4)||'xxxxxxxx'||substr(a.cr_account_number,-4) cr_account_number,";
                }

                sql += "a.trace_audit_number as Trace_no,a.authorization_number as Auth_no,a.transaction_date as Trans_date,";
                sql += "a.transaction_amount as Trans_amt,a.transaction_currency  as Trans_cur,a.billing_amount as Billing_amt,";
                sql += "a.billing_currency as Bill_cur,a.settlement_amount as Settle_amt,a.settlement_currency as Settle_cur,";
                sql += "a.function_code as Func_code, (select transaction_wording from " + Businessbp.executedb.owner + "trans_def_stand where transaction_code = a.transaction_code) Trans_code,";
                sql += "a.chargeback_status,a.reversal_flag,a.reversal_reason_code";
                sql += " from " + Businessbp.executedb.owner + "transaction_hist a";
                sql += " where a.function_code = 206";
                sql += " and a.microfilm_ref_number = '" +Ref_no_2nd+ "'";
                sql += " and a.reversal_flag = 'R'";
                sql += " and a.issuer_bank_code = '970428'";
                sql += " and a.acquirer_bank_code <> '970428'";
                sql += " and trunc(a.date_create) >= trunc(to_date('" + from_date + "','mm/dd/yyyy'))";
                sql += " and trunc(a.date_create) <= trunc(to_date('" + to_date + "','mm/dd/yyyy'))";

                DataTable dtt = Businessbp.executedb.getTable(sql, ref err);
                if (err != "")
                {
                    MessageBox.Show(err);
                    return;
                }
                else
                {
                    if (dtt.Rows.Count == 0)
                    {
                        MessageBox.Show("No data found!!!");
                        return;
                    }
                    else
                    {
                        a.type = "MC_Reversal_2nd_Presentment";
                        a.thoiGian = "Từ ngày: " + from_date + " đến ngày " + to_date;
                        a.title = "DANH SÁCH GIAO DỊCH REVERSAL SECOND PRESNETMENT";
                        a.dt = dtt;
                        a.ShowDialog();
                    }
                }
            }
            #endregion reversal 2nd presentment
        }
        private void button1_Click(object sender, EventArgs e)
        {
            #region 1st presentment
            if (comboBox1.SelectedIndex + 1 == 1)//1st presentment
            {

                Frm_MC_1st_Presentment a = new Frm_MC_1st_Presentment();
                gldtFrom = dtFrom.Text.Trim();
                gldtTo = dtTo.Text.Trim();
                combox = "1";
                a.ShowDialog();
            }
            #endregion 1st presentment

            #region Retrieval Request
            if (comboBox1.SelectedIndex + 1 == 2)//Retrieval Request
            {

                Frm_MC_Retrieval_Request_1st_Presentment a = new Frm_MC_Retrieval_Request_1st_Presentment();
                gldtFrom = dtFrom.Text.Trim();
                gldtTo = dtTo.Text.Trim();
                combox = "2";
                a.ShowDialog();
            }
            #endregion Retrieval Request

            #region 1st chargeback
            if (comboBox1.SelectedIndex + 1 == 3)//1st chargeback
            {
                Frm_MC_Chargeback_1st_Presentment a = new Frm_MC_Chargeback_1st_Presentment();
                gldtFrom = dtFrom.Text.Trim();
                gldtTo = dtTo.Text.Trim();
                combox = "3";
                a.ShowDialog();
            }
            #endregion 1st chargeback

            #region  2nd presentment
            if (comboBox1.SelectedIndex + 1 == 4)//2nd presentment
            {
                Frm_MC_2nd_Presentment a = new Frm_MC_2nd_Presentment();
                gldtFrom = dtFrom.Text.Trim();
                gldtTo = dtTo.Text.Trim();
                combox = "4";
                a.ShowDialog();
            }
            #endregion 2nd presentment

            #region arbitration chargeback
            if (comboBox1.SelectedIndex + 1 == 5) // Arbitration chargeback
            {
                Frm_MC_Arbitration_2nd_Presentment a = new Frm_MC_Arbitration_2nd_Presentment();
                gldtFrom = dtFrom.Text.Trim();
                gldtTo = dtTo.Text.Trim();
                combox = "5";
                a.ShowDialog();

            }
            #endregion arbitration chargeback

            #region reprot fee
            if (comboBox1.SelectedIndex + 1 == 6) // Report Fee
            {
                Frm_Report a = new Frm_Report();
                string sql = "", err = "";

                sql = "select h.ipi_additional_data4_desc file_ID,k.ifd_transaction_amt as Trans_amt,k.ifd_curr_code_txn_cd as Trans_cur, " +
                             "k.ifd_original_amt as Original_amt,k.ifd_curr_original_txn_cd as Original_cur,k.ifd_recon_amt as Recon_amt,k.ifd_curr_code_recon_cd as Recon_cur," +
                             "k.ifd_convertion_rate_cd as Convert_rate,k.ifd_function_code_num as Func_code,k.ifd_reason_code_num as Rea_code, " +
                             "k.ifd_msg_reversal_indicator_cd as Reversal,k.ifd_processing_status as Process_status " +
                      "from " + Businessbp.executedb.owner + "ipm_fees_detail_t k," + Businessbp.executedb.owner + "ipm_incoming_header h " +
                      "where 1 = 1 " +
                            "and k.ifd_job_id = h.ipi_job_id " +
                            "and trunc(k.date_create) >= trunc(to_date('" + dtFrom.Text.Trim() + "','mm/dd/yyyy')) " +
                            "and trunc(k.date_create) <= trunc(to_date('" + dtTo.Text.Trim() + "','mm/dd/yyyy')) " +
                            "order by file_ID,Recon_cur ";

                DataTable dtt = Businessbp.executedb.getTable(sql, ref err);
                if (err != "")
                {
                    MessageBox.Show(err);
                    return;
                }
                else
                {
                    if (dtt.Rows.Count == 0)
                    {
                        MessageBox.Show("No data found!!!");
                        return;
                    }
                    else
                    {
                        a.type = "MC_Report_Fee";
                        a.thoiGian = "Từ ngày: " + dtFrom.Text.Trim() + " đến ngày " + dtTo.Text.Trim();
                        a.title = "DANH SÁCH REPORT FEE";
                        a.dt = dtt;
                        combox = "6";
                        a.ShowDialog();
                    }
                }
            }
            #endregion reprot fee
        }