FineUI 官方论坛
标题:
textchange事件
[打印本页]
作者:
′訫冇所屬.
时间:
2013-4-19 16:49
标题:
textchange事件
第一次修改现金支付文本框的值时没有问题 但是第二次修改后 现金支付文本框的值老是第一次修改后的值
<x:SimpleForm ID="SimpleForm1" runat="server" BodyPadding="5px" LabelAlign="Right"
Title="SimpleForm" ShowBorder="false" ShowHeader="false" FooterBarAlign="Center">
<Items>
<x
abel ID="labTotal" runat="server" Label="订单总价" Text="0.00" CssClass="font_color_tip_01">
</x
abel>
<x
abel ID="labDisCountPrice" runat="server" Label="需支付" Text="0.00" CssClass="font_color_tip_01">
</x
abel>
<x:NumberBox ID="txtBalance" runat="server" Label="账户支付" Required="true" Text="0"
MinValue="0" AutoPostBack="True" OnTextChanged="txtBalance_TextChanged">
</x:NumberBox>
<x:NumberBox ID="txtCash" runat="server" Label="现金支付" Required="true" MinValue="0"
Text="0" AutoPostBack="True" OnTextChanged="txtCash_TextChanged">
</x:NumberBox>
protected void txtBalance_TextChanged(object sender, EventArgs e)
{
decimal total = decimal.Parse(labDisCountPrice.Text);
decimal balance = decimal.Parse(txtBalance.Text.Trim());
if (balance > total)
{
Alert.ShowInTop(string.Format("请输入小于{0}的账户支付金额", total));
txtBalance.Text = "0";
txtBalance.Focus();
return;
}
txtCash.Text = (total - balance).ToString();
}
protected void txtCash_TextChanged(object sender, EventArgs e)
{
decimal total = decimal.Parse(labDisCountPrice.Text);
decimal cash = decimal.Parse(txtCash.Text.Trim());
if (cash > total)
{
Alert.ShowInTop(string.Format("请输入小于{0}的现金支付金额", total));
txtCash.Text = "0";
txtCash.Focus();
return;
}
txtBalance.Text = (total - cash).ToString();
}
作者:
′訫冇所屬.
时间:
2013-4-19 16:53
解决了 这个地方不能用decimal的数据类型
欢迎光临 FineUI 官方论坛 (https://fineui.com/BBS/)
Powered by Discuz! X3.4