javascript 模态并返回Response Rahkaran - 结果为js

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了javascript 模态并返回Response Rahkaran - 结果为js相关的知识,希望对你有一定的参考价值。

 SgWindow.ShowModalDialog<ReceiptActionPages.IssueReceiptBasedOnTourDialog>("", "IssueReceiptBasedOnTourDialog", null, null, "height:380,width:750,visibleStatusbar:false");

            ExecutionContext.Current.Executable.OnCallBack(
                () =>
                {
                    if (ExecutionContext.Current.Executable.Response.Dialogs[0] != null)
                    {
                        var returnedValues = (object[])ExecutionContext.Current.Executable.Response.Dialogs[0];                       

                        if (returnedValues[0] != null && returnedValues[1] != null)
                        {
                            var tourID = long.Parse(returnedValues[0].ToString());
                            var transformationType = (TourToReceiptTransformationType)returnedValues[1];
							var receiptType = (TourToReceiptTransformationReceiptType)returnedValues[2];

                            Receipt receipt = new Receipt();
                            Tour tour = ServiceFactory.Create<IOperationsService>().FetchAllTours().Where(t => t.ID == tourID).FirstOrDefault();
                            var transformer = new TourToReceiptTransformer();
                            transformer.Transform(tour, receipt, transformationType, receiptType);

                            var key = ShortTermSessionState.Current.Add(receipt);
                            SgShell.Show(typeof(SystemGroup.ReceiptAndPayment.ReceiptManagement.Web.ReceiptPages.Default), string.Format("{0}={1}", SgEditorPageHelper.EntityInstanceKeyParameterName, key));

                        }
                    }
                }
            );
function onClose(evt) {

    var tourID = $find("sltTour").get_selectedID();
    if (!tourID)
        throw Error.create("تور انتخاب نشده است.");
    var tourToReceiptTransformationType = 1;

    if ($get("srbInvoiceRelatedReceiptMoneyInfos").checked)
        tourToReceiptTransformationType = 2;

    if ($get("srbNonInvoiceRelatedReceiptMoneyInfos").checked)
        tourToReceiptTransformationType = 3;

    var receiptType = 0;
    if ($get("chkCashe").checked)
        receiptType |= 1;
    if ($get("chkCheque").checked)
        receiptType |= 2;
    if ($get("chkReseiptDeposit").checked)
        receiptType |= 4;

    createCookie("TourReceiptInvoiceTransformationType", tourToReceiptTransformationType);
    createCookie("TourReceiptInvoiceReceiptType", receiptType);

    var res = new Array(tourID, tourToReceiptTransformationType, receiptType);
    Sg.Window.getCurrent().close(res);

    return SgCancelBrowserEvent(evt);
}

以上是关于javascript 模态并返回Response Rahkaran - 结果为js的主要内容,如果未能解决你的问题,请参考以下文章

javascript中有几种模态框

javascript window.showModalDialog模态窗返回数据

javascript window.showModalDialog模态窗返回数据

JavaScript fetch API - 为啥 response.json() 返回一个 promise 对象(而不是 JSON)? [复制]

使用ajax请求,模态框调用并更改密码

如何在另一个线程中关闭 MFC 模态对话框并获得对话框返回值?