无为清净楼资源网 Design By www.qnjia.com
复制代码 代码如下:
protected void txtQty_TextChanged(object sender, EventArgs e)
{
checkForm();
}
//检验文本信息是否合法,如果合法则开始计算
protected void checkForm()
{
try
{
if (!IsNumberic(txtQty.Text) && txtQty.Text != "")
{
checkbool = false;
Response.Write("<script>alert('数量只能为数字,请输入数字信息,谢谢合作!')</script>");
txtQty.Text = "";
txtQty.Focus();
}
else if (txtQty.Text != "")
{
Qty = int.Parse(txtQty.Text);
}
if (!IsNumberic(txtVat.Text) && txtVat.Text != "")
{
Response.Write("<script>alert('税额只能是数字,请输入数字信息,谢谢合作!')</script>");
checkbool = false;
txtVat.Text = "";
txtVat.Focus();
}
else if (txtVat.Text != "")
{
Vat = Double.Parse(txtVat.Text);
}
if (!IsNumberic(txtUnitPrice.Text) && txtUnitPrice.Text != "")
{
Response.Write("<script>alert('价格只能是数字,请输入数字信息,谢谢合作!')</script>");
checkbool = false;
txtUnitPrice.Text = "";
txtUnitPrice.Focus();
}
else if (txtUnitPrice.Text != "")
{
UnitPrice = Double.Parse(txtUnitPrice.Text);
}
if (checkbool == true)
{
if (Vat != 0 && ExVatAmount != 0)
{
AmountVat = ExVatAmount / (1 - Vat / 100);
txtAmountVat.Text = AmountVat.ToString();
}
}
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
}
/// <summary>
/// 名称:IsNumberic
/// 功能:判断输入的是否是数字
/// 参数:string oText:源文本
/// 返回值: bool true:是 false:否
/// </summary>
public bool IsNumberic(string oText)
{
try
{
//从字符串到双精度值的转换,字符串转换为Double,如果成功则返回为真,否则返回为假。
Double var1 = Convert.ToDouble(oText);
return true;
}
catch
{
return false;
}
}
}
标签:
ASp.net,文本框,数字

无为清净楼资源网 Design By www.qnjia.com
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
无为清净楼资源网 Design By www.qnjia.com

P70系列延期,华为新旗舰将在下月发布

3月20日消息,近期博主@数码闲聊站 透露,原定三月份发布的华为新旗舰P70系列延期发布,预计4月份上市。

而博主@定焦数码 爆料,华为的P70系列在定位上已经超过了Mate60,成为了重要的旗舰系列之一。它肩负着重返影像领域顶尖的使命。那么这次P70会带来哪些令人惊艳的创新呢?

根据目前爆料的消息来看,华为P70系列将推出三个版本,其中P70和P70 Pro采用了三角形的摄像头模组设计,而P70 Art则采用了与上一代P60 Art相似的不规则形状设计。这样的外观是否好看见仁见智,但辨识度绝对拉满。