TinyMind
.net.cn
首页
资讯
文章
注册
登录
showModalDialog的刷新问题
simhare
关注文章
TinyMind专栏频道
<
asp:Button
ID
="btnVerify"
runat
="server"
CssClass
="btn2"
OnClientClick
="returnverifyDetail();"
Text
="确认选择"
OnClick
="btnVerify_Click"
/>
<
script
>
function
verifyDetail()
//
invokedby"确认选择"
{
if
(varNumber
==
0
)
{
alert(
"
请选择核销条目!
"
);
return
false
;
}
var
varCurClass
=
document.form1.ddlVerifyCurClass[document.form1.ddlVerifyCurClass.selectedIndex].value;
//
币种
var
varHidAmount
=
document.getElementById(
"
hidAmount
"
).value;
//
隐藏域中的金额
//
varvarSZDW=document.getElementById("hidSZDW").value;//涉帐单位,准备不传这个参数了!①.已改用根据发票id把
inv_main.company_id和pd_company.id两个字段关联,从pd_company中取COMP_C_CNAME字段
//
&szdw="+escape(varSZDW)+"//②.传参数时用escape()函数,接受页面(invoice_verify_confirm.aspx)用stringwd=
Server.UrlDecode(Request.QueryString[
"
szdw
"
]);则wd为正常汉字
var
varID
=
document.getElementById(
"
hidInvoiceId
"
).value;
//
隐藏域中的已选中项的ID
var
varCompID
=
document.getElementById(
"
hidSZDWID
"
).value;
//
隐藏域中的已选中项的对应公司的ID
//
vars=newObject();
//
s.name="aaa";
var
win
=
window.showModalDialog(
"
invoice_verify_confirm.aspx?
CurClass=
"
+
varCurClass
+
"
&HidAmount=
"
+
varHidAmount
+
"
&id=
"
+
varID
+
"
&compID=
"
+
varCompID
+
""
,
""
,
"
status:Modeless;edge:raised;unador
ned:no;scroll=yes;resizable:yes;center=yes;help:no;dialogwidth:890px;dialogheight:425px
"
);
if
(win
==
"
ref
"
)
{
//
self.location.reload();//如何触发OnClick="btnSearch_Click"
//
alert("aa");
//
document.all("btnSearch").click();
//
document.getElementById("btnSearch").onclick=function()
//
{
//
alert('a');
//
}
//
form1.submit();
return
true
;
}
else
{
return
false
;
//
有这句就不会刷新父窗口,因为不会再执行服务器代码,showModalDialog窗口以右上角“关闭”,以“取消”按钮关闭,都不刷新
}
//
if(win.type=="")//传递回的type为空的时候才刷新页面。
//
{
//
alert("刷新");
//
location.reload();
//
}
//
return;
//
alert("aa");
}
</
script
>
protected
void
btnVerify_Click(
object
sender,EventArgse)
{//该函数“顺便”回去服务器把页面上的其他控件“重新”取了回来,实现了“整个”页面的“刷新”
BindData();
}
private
void
BindData()
//
从inv_main表中选出已开票记录
{
Grid1.Levels[
0
].Columns.Clear();
//
在Grid1.DataBind();执行结束,所有列已Bindover不能再执行本句,否则会清除所有已经bind的列
string
strSql
=
@"
SELECT
dbo.INV_MAIN.ID,
cast(0asbit)aschoice,
dbo.INV_MAIN.INV_NO,
dbo.PD_COMPANY.COMP_C_CNAME,
dbo.INV_MAIN.CURRENCY,
dbo.INV_MAIN.AMOUNT,
cast(dbo.INV_MAIN.AMOUNT_HXasdecimal(18,2))asAMOUNT_HX,
dbo.INV_MAIN.AMOUNT_WHX,
'海运出口'asywlx,
dbo.JOB_SE.JOBNO,
dbo.PD_USER.USER_NAME,
convert(varchar(10),DATE_JOB,120)asDATE_JOB,
dbo.JOB_SE.WTBH,
dbo.PD_COMPANY.IDascompID
FROMdbo.FEE_INLEFTOUTERJOIN
dbo.PD_USERRIGHTOUTERJOIN
dbo.JOB_SEONdbo.PD_USER.USER_CODE=dbo.JOB_SE.CR_CODEONdbo.FEE_IN.PARENTID=dbo.JOB_SE.IDRIGHTOUTERJOIN
dbo.PD_COMPANYRIGHTOUTERJOIN
dbo.INV_MAINONdbo.PD_COMPANY.ID=dbo.INV_MAIN.COMPANY_IDONdbo.FEE_IN.INVOICE_ID=dbo.INV_MAIN.IDwhere(1=1)
"
;
//
dbo.JOB_SE.ETD,需不需要这个字段?dbo.INV_MAIN.DATE_JOB(业务日期)对应job_se中ETD
if
(ViewState[
"
strSqlBindData
"
]
==
null
)
{
ViewState[
"
strSqlBindData
"
]
=
strSql;
}
SqlDataAdaptersda
=
new
SqlDataAdapter(strSql,conn);
conn.Open();
DataSetds
=
new
DataSet();
sda.Fill(ds,
"
INV_MAIN
"
);
Grid1.DataSource
=
ds;
Grid1.DataBind();
Grid1.Levels[
0
].Columns[
"
ID
"
].Visible
=
false
;
Grid1.Levels[
0
].Columns[
"
choice
"
].HeadingText
=
"
选择
"
;
Grid1.Levels[
0
].Columns[
"
choice
"
].ColumnType
=
GridColumnType.CheckBox;
Grid1.Levels[
0
].Columns[
"
choice
"
].Align
=
ComponentArt.Web.UI.TextAlign.Center;
Grid1.Levels[
0
].Columns[
"
choice
"
].Width
=
26
;
Grid1.Levels[
0
].Columns[
"
INV_NO
"
].HeadingText
=
"
帐单号
"
;
Grid1.Levels[
0
].Columns[
"
INV_NO
"
].Align
=
ComponentArt.Web.UI.TextAlign.Center;
Grid1.Levels[
0
].Columns[
"
INV_NO
"
].Width
=
45
;
Grid1.Levels[
0
].Columns[
"
COMP_C_CNAME
"
].HeadingText
=
"
涉帐单位
"
;
Grid1.Levels[
0
].Columns[
"
COMP_C_CNAME
"
].Align
=
ComponentArt.Web.UI.TextAlign.Center;
Grid1.Levels[
0
].Columns[
"
COMP_C_CNAME
"
].Width
=
56
;
Grid1.Levels[
0
].Columns[
"
CURRENCY
"
].HeadingText
=
"
币种
"
;
Grid1.Levels[
0
].Columns[
"
CURRENCY
"
].Align
=
ComponentArt.Web.UI.TextAlign.Center;
Grid1.Levels[
0
].Columns[
"
CURRENCY
"
].Width
=
26
;
Grid1.Levels[
0
].Columns[
"
AMOUNT
"
].HeadingText
=
"
帐单金额
"
;
Grid1.Levels[
0
].Columns[
"
AMOUNT
"
].Align
=
ComponentArt.Web.UI.TextAlign.Right;
Grid1.Levels[
0
].Columns[
"
AMOUNT
"
].Width
=
56
;
Grid1.Levels[
0
].Columns[
"
AMOUNT
"
].FormatString
=
"
N2
"
;
Grid1.Levels[
0
].Columns[
"
AMOUNT_HX
"
].HeadingText
=
"
已核销
"
;
Grid1.Levels[
0
].Columns[
"
AMOUNT_HX
"
].Align
=
ComponentArt.Web.UI.TextAlign.Right;
Grid1.Levels[
0
].Columns[
"
AMOUNT_HX
"
].Width
=
45
;
//
Grid1.Levels[
0
].Columns[
"
AMOUNT_HX
"
].FormatString
=
"
N2
"
;
Grid1.Levels[
0
].Columns[
"
AMOUNT_WHX
"
].HeadingText
=
"
未核销
"
;
Grid1.Levels[
0
].Columns[
"
AMOUNT_WHX
"
].Align
=
ComponentArt.Web.UI.TextAlign.Right;
Grid1.Levels[
0
].Columns[
"
AMOUNT_WHX
"
].Width
=
45
;
Grid1.Levels[
0
].Columns[
"
AMOUNT_WHX
"
].FormatString
=
"
N2
"
;
//
两位小数,每三位有逗号
Grid1.Levels[
0
].Columns[
"
ywlx
"
].HeadingText
=
"
业务类型
"
;
Grid1.Levels[
0
].Columns[
"
ywlx
"
].Align
=
ComponentArt.Web.UI.TextAlign.Center;
Grid1.Levels[
0
].Columns[
"
ywlx
"
].Width
=
56
;
Grid1.Levels[
0
].Columns[
"
JOBNO
"
].HeadingText
=
"
工作编号
"
;
Grid1.Levels[
0
].Columns[
"
JOBNO
"
].Align
=
ComponentArt.Web.UI.TextAlign.Center;
Grid1.Levels[
0
].Columns[
"
JOBNO
"
].Width
=
56
;
Grid1.Levels[
0
].Columns[
"
USER_NAME
"
].HeadingText
=
"
操作人
"
;
Grid1.Levels[
0
].Columns[
"
USER_NAME
"
].Align
=
ComponentArt.Web.UI.TextAlign.Center;
Grid1.Levels[
0
].Columns[
"
USER_NAME
"
].Width
=
36
;
Grid1.Levels[
0
].Columns[
"
DATE_JOB
"
].HeadingText
=
"
抵离港日
"
;
//
?dateJOb还是ETD?dbo.INV_MAIN.DATE_JOB(业务日期)对应job_se中ETD
Grid1.Levels[
0
].Columns[
"
DATE_JOB
"
].Align
=
ComponentArt.Web.UI.TextAlign.Center;
Grid1.Levels[
0
].Columns[
"
DATE_JOB
"
].Width
=
56
;
Grid1.Levels[
0
].Columns[
"
WTBH
"
].HeadingText
=
"
委托编号
"
;
Grid1.Levels[
0
].Columns[
"
WTBH
"
].Align
=
ComponentArt.Web.UI.TextAlign.Center;
Grid1.Levels[
0
].Columns[
"
WTBH
"
].Width
=
56
;
Grid1.Levels[
0
].Columns[
"
compID
"
].HeadingText
=
"
涉帐ID
"
;
Grid1.Levels[
0
].Columns[
"
compID
"
].Align
=
ComponentArt.Web.UI.TextAlign.Center;
Grid1.Levels[
0
].Columns[
"
compID
"
].Visible
=
false
;
Grid1.Levels[
0
].Columns[
"
compID
"
].Width
=
56
;
}
优质内容筛选与推荐
>>
1、证明DES解密为加密的逆过程
2、1.1.4 启动另一个Activity
3、python-list.sort && lambda
4、Js操作Array数组
5、Centos7安装JDK+部署Tomcat8
赞赏
长按二维码向我转账
受苹果公司新规定影响,微信 iOS 版的赞赏功能被关闭,可通过二维码转账支持公众号。
阅读
好看
已推荐到看一看
你的朋友可以在“发现”-“看一看”看到你认为好看的文章。
取消
推荐
我知道了
已取消,“好看”想法已同步删除
知道了
已推荐到看一看
和朋友分享想法
最多200字,当前共
字
发送
已发送
朋友将在看一看看到
确定
分享你的想法...
取消
分享想法到看一看
确定
最多200字,当前共
字
发送中
网络异常,请稍后重试
知道了
微信扫一扫
关注该公众号
0
│
收藏
│
举报