ASP.NET,Report...
昨天经高手指导
测试使用了
==?: 和 if()else()
xzyHe 为 DropDownlist 值,如果为空取值为0
if (xzyHe ==""){int xzyHe==0;else{int xzyHe = DropDownlist.Text.Trim();}
另外一种写法:
int xzyHe = ConVert.ToInt32(xzyHe == ""?0:int.Parse(DropDownlist.Text.Trim()));
Powered by: 博客园 Copyright © 2024 Crdown Powered by .NET 8.0 on Kubernetes