コード例 #1
0
        protected void gvTm_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            if ((Session["tm_cnt"] != null) && (Session["tm_cnt"].ToString() != ""))
            {
                tm_cnt = Convert.ToInt32(Session["tm_cnt"]);
            }
            if ((Session["lt_ri"] != null) && (Session["lt_ri"].ToString() != ""))
            {
                lt_ri = (List<XObjs.ReportItem>)Session["lt_ri"];
            }
            gvTm.DataSource = lt_ri;
            gvTm.DataBind();
            if (e.CommandName == "TmPayClick")
            {
                GridViewRow namingContainer = (GridViewRow)((ImageButton)e.CommandSource).NamingContainer;
                int rowIndex = namingContainer.RowIndex;
                string txnref = e.CommandArgument.ToString();
                xispf = ret.getISWtransactionByTransactionID(txnref);
                if ((xispf.xid != null) && (xispf.xid != null))
                {
                    Session["xispf"] = xispf;
                    base.Response.Redirect("../xis/pd/tx/re_payment_details.aspx");
                }
            }
            if (e.CommandName == "TmReqClick")
            {
                string str2 = DateTime.Now.ToString("dd-MMM-yy HH:MM:ss");
                GridViewRow row2 = (GridViewRow)((ImageButton)e.CommandSource).NamingContainer;
                int num2 = row2.RowIndex;
                string str3 = e.CommandArgument.ToString();
                int num = 0;
                isw_fields = ret.getISWtransactionByTransactionID(str3);
                string inputString = isw_fields.product_id + isw_fields.txn_ref + isw_fields.mackey;
                string headerValue = hash_value.GetGetSHA512String(inputString);
                isr = tx.myRedirect(check_trans_page + "?productid=" + isw_fields.product_id + "&transactionreference=" + isw_fields.txn_ref + "&amount=" + isw_fields.amount, "Hash", headerValue);
                if ((((isr.ResponseCode != "") && (isr.ResponseCode != null)) && ((isr.PaymentReference != "") && (isr.PaymentReference != null))) && ((isr.ResponseDescription != "") && (isr.ResponseDescription != null)))
                {
                    if (isw_fields.txn_ref == null)
                    {
                        isw_fields.txn_ref = "";
                    }
                    if (isw_fields.pay_ref == null)
                    {
                        isw_fields.pay_ref = "";
                    }
                    if (isw_fields.ret_ref == null)
                    {
                        isw_fields.ret_ref = "";
                    }
                    if (isr.ResponseCode == null)
                    {
                        isr.ResponseCode = "";
                    }
                    if (isr.TransactionDate == null)
                    {
                        isr.TransactionDate = "";
                    }
                    if (isr.MerchantReference == null)
                    {
                        isr.MerchantReference = "";
                    }
                    if (isr.ResponseDescription == null)
                    {
                        isr.ResponseDescription = "";
                    }
                    xstring.AppendLine("Sent Amount: " + isw_fields.amount + "\r\n Product ID: " + isw_fields.product_id + "\r\n Hash: " + headerValue + "\r\n Amount: " + isr.Amount + "\r\n CardNumber: " + isr.CardNumber + "\r\n MerchantReference: " + isr.MerchantReference + "\r\n PaymentReference: " + isr.PaymentReference + "\r\n RetrievalReferenceNumber: " + isr.RetrievalReferenceNumber + "\r\n LeadBankCbnCode: " + isr.LeadBankCbnCode + "\r\n TransactionDate: " + isr.TransactionDate + "\r\n ResponseCode: " + isr.ResponseCode + "\r\n ResponseDescription: " + isr.ResponseDescription + "\r\n Json Page: " + check_trans_page);
                    if (isw_fields.txn_ref != "")
                    {
                        docpath = base.Server.MapPath("~/") + "LiveInterLogs/Ag/" + isw_fields.txn_ref + ".txt";
                        num = x.WriteToFile(xstring.ToString(), docpath);
                    }
                    else
                    {
                        docpath = base.Server.MapPath("~/") + "LiveInterLogs/Ag/xxx.txt";
                        num = x.WriteToFile(xstring.ToString(), docpath);
                    }
                    if ((isr.ResponseCode == "") || (isr.ResponseCode == null))
                    {
                        xpay_status = "2";
                    }
                    else if (isr.ResponseCode == "00")
                    {
                        xpay_status = "1";
                    }
                    else
                    {
                        xpay_status = "3";
                    }
                    num = reg.updateInterSwitchRecords(isw_fields.txn_ref, isw_fields.pay_ref, isw_fields.ret_ref, isr.ResponseCode, isr.TransactionDate, isr.MerchantReference, isr.ResponseDescription);
                    reg.updateTwalletPaymentStatus(isw_fields.txn_ref, xpay_status);
                    reg.updateInterSwitchPostFieldsDate(isw_fields.txn_ref, str2);
                    base.Response.Redirect("./xreport_payments.aspx");
                    if (num == 0)
                    {
                    }
                }
                else
                {
                    base.Response.Redirect("./xreport_payments.aspx");
                }
            }
            if (e.CommandName == "TmDeleteClick")
            {
                GridViewRow row3 = (GridViewRow)((ImageButton)e.CommandSource).NamingContainer;
                int num3 = row3.RowIndex;
                string transID = e.CommandArgument.ToString();
                reg.updateInterSwitchVisibleStatus(transID, "0");
                base.Response.Redirect("./xreport_payments.aspx");
            }
            if (e.CommandName == "TmDetailsClick")
            {
                GridViewRow row4 = (GridViewRow)((ImageButton)e.CommandSource).NamingContainer;
                int num4 = row4.RowIndex;
                string str7 = e.CommandArgument.ToString();
                lt_twall = ret.getTwalletByMemberID(adminID, str7, Session["agentType"].ToString());
                //if (lt_twall.Count > 0) {  }

                if (lt_twall.Count > 0)
                {
                    isw_fields = ret.getISWtransactionByTransactionID(lt_twall[0].transID);
                    isw_fields.TransactionDate = isw_fields.TransactionDate.Substring(0, 11).Trim();

                    c_app = ret.getApplicantByID(lt_twall[0].applicantID);
                    string str8 = lt_twall[0].xpay_status;
                    lt_fdets = ret.getFee_detailsByTwalletID(lt_twall[0].xid);
                    Session["transID"] = str7;
                    Session["memberID"] = adminID;
                    show_inv = 1;
                    switch (str8)
                    {
                        case "0":
                            str8 = "PAYMENT UNCOMPLETED!!!";
                            return;

                        case "1":
                            str8 = "PAYMENT SUCCESSFUL!!!";
                            return;

                        case "2":
                            str8 = "PAYMENT PENDING!!!";
                            return;

                        case "3":
                            str8 = "PAYMENT UNSUCCESSFUL!!!";
                            break;
                    }
                }
            }
        }
コード例 #2
0
ファイル: pay_his2.aspx.cs プロジェクト: ozotony/ipocldng
        protected void gvTm_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            if (e.CommandName == "TmPayClick")
            {
                GridViewRow namingContainer = (GridViewRow)((ImageButton)e.CommandSource).NamingContainer;
                int rowIndex = namingContainer.RowIndex;
                string txnref = e.CommandArgument.ToString();
                int num = 0;
                this.isw_fields = this.ret.getISWtransactionByTransactionID(txnref);
                this.isr = this.tx.myRedirect(this.check_trans_page + "?productid=" + this.isw_fields.product_id + "&transactionreference=" + this.isw_fields.txn_ref + "&amount=" + this.isw_fields.amount, "Hash", this.isw_fields.hash);
                num = this.reg.updateInterSwitchRecords(this.isw_fields.txn_ref, this.isw_fields.pay_ref, this.isw_fields.ret_ref, this.isr.ResponseCode, this.isr.TransactionDate, this.isr.MerchantReference, this.isr.ResponseDescription);
                if (!(this.isr.ResponseCode == "") && (this.isr.ResponseCode != null))
                {
                    bool flag1 = this.isr.ResponseCode == "00";
                }
                string str2 = DateTime.Now.ToString("dd-MMM-yy HH:MM:ss");
                this.reg.updateInterSwitchPostFieldsDate(this.isw_fields.txn_ref, str2);
                base.Response.Redirect("./v_bask_tmp.aspx");
            }
            if (e.CommandName == "TmDeleteClick")
            {
                GridViewRow row2 = (GridViewRow)((ImageButton)e.CommandSource).NamingContainer;
                int num2 = row2.RowIndex;
                string transID = e.CommandArgument.ToString();
                this.reg.updateInterSwitchVisibleStatus(transID, "0");
                base.Response.Redirect("./v_bask_tmp.aspx");
            }
            if (e.CommandName == "TmDetailsClick")
            {
                GridViewRow row3 = (GridViewRow)((ImageButton)e.CommandSource).NamingContainer;
                int num3 = row3.RowIndex;
                string str4 = e.CommandArgument.ToString();
                this.lt_twall = this.ret.getTwalletByMemberID(this.adminID, str4, this.Session["agentType"].ToString());
                if (this.lt_twall.Count > 0)
                {
                    string str5 = this.lt_twall[0].xpay_status;
                    this.lt_fdets = this.ret.getFee_detailsByTwalletID(this.lt_twall[0].xid);
                    this.Session["transID"] = str4;
                    this.Session["memberID"] = this.adminID;
                    this.show_inv = 1;
                    switch (str5)
                    {
                        case "0":
                            str5 = "PAYMENT UNCOMPLETED!!!";
                            return;

                        case "1":
                            str5 = "PAYMENT SUCCESSFUL!!!";
                            return;

                        case "2":
                            str5 = "PAYMENT PENDING!!!";
                            return;

                        case "3":
                            str5 = "PAYMENT UNSUCCESSFUL!!!";
                            break;
                    }
                }
            }
        }