public decimal DealWithNullValueWithDecimal(string txtBox)
{
if (string.IsNullOrEmpty(txtBox.Trim()))
{
return 0;
}
else
{
decimal dec = 0m;
try {
dec = Convert.ToDecimal(txtBox.Trim().ToString());
}
catch(Exception ex)
{
Alert("转换出错");
}
finally
{
}
return dec;
}
}
{
if (string.IsNullOrEmpty(txtBox.Trim()))
{
return 0;
}
else
{
decimal dec = 0m;
try {
dec = Convert.ToDecimal(txtBox.Trim().ToString());
}
catch(Exception ex)
{
Alert("转换出错");
}
finally
{
}
return dec;
}
}