Browse Source

close window open

Ime-london-webcore
shakun 10 months ago
parent
commit
57470d06d3
  1. 45
      Swift.web/Payment/trans_payment_success.aspx
  2. 20
      Swift.web/Payment/trans_payment_success.aspx.cs

45
Swift.web/Payment/trans_payment_success.aspx

@ -27,6 +27,7 @@
table.no-border th {
border: none !important;
}
.table-condensed {
font-size: 18px;
}
@ -36,6 +37,50 @@
font-size: 20px !important;
}
</style>
<script >
var isChrome = navigator.userAgent.toLowerCase().indexOf('chrome') > -1;
var isSafari = navigator.userAgent.toLowerCase().indexOf('safari') > -1;
var is_mobile = false;
function ManageMessage(mes, invoicePrintMode) {
if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) {
is_mobile = true;
}
window.returnValue = mes + '-:::-' + invoicePrintMode;
if (is_mobile) {
var s = GetBrowserDetails();
if (s.osName == 'iPad' || s.osName == 'iPhone') {
if (s.browserVersion != '0') {
isSafari = true;
isChrome = false;
}
else {
isSafari = false;
isChrome = true;
}
}
if (isSafari) {
window.opener.parent.focus();
}
if (isChrome) {
window.opener.document.getElementById("ContentPlaceHolder1_txtPayMsg").focus();
}
window.close();
return true;
}
if (isChrome) {
window.opener.focus();
window.opener.PostMessageToParent(window.returnValue);
}
window.close();
}
</script>
</head>
<body>
<%--<div class="container">

20
Swift.web/Payment/trans_payment_success.aspx.cs

@ -2,6 +2,7 @@
using Swift.web.Library;
using System;
using System.Data;
using System.Web.UI;
namespace Swift.web.Payment
{
@ -68,11 +69,26 @@ namespace Swift.web.Payment
if (dt.Rows[0]["tranType"].ToString() == "I")
{
string controlNo = dt.Rows[0]["ControlNo"].ToString();
lnkBack.NavigateUrl = $"{GetStatic.ReadWebConfig("CR_Trust_Receipt_url")}?invoicePrint=d&cn={controlNo}";
// lnkBack.NavigateUrl = $"{GetStatic.ReadWebConfig("CR_Trust_Receipt_url")}?invoicePrint=d&controlNo={controlNo}";
DAL.SwiftDAL.DbResult dbResult = new DAL.SwiftDAL.DbResult() { Msg = "OK", Id = controlNo };
var mes = GetStatic.ParseResultJsPrint(dbResult);
mes = mes.Replace("'", "");
mes = mes.Replace("<center>", "");
mes = mes.Replace("</center>", "");
var invPrintMode = "d";
var functionName = "ManageMessage('" + mes + "','" + invPrintMode + "');";
lnkBack.Attributes.Add("onclick", functionName);
// GetStatic.CallBackJs1(Page, scriptName, functionName);
}
else
{
lnkBack.NavigateUrl = GetStatic.ReadWebConfig("sitesuccess_back", "");
lnkBack.NavigateUrl = GetStatic.ReadWebConfig("sitesuccess_back", "");
}
}
}

Loading…
Cancel
Save