更新后台smtp发信配置;更新组件
This commit is contained in:
@@ -728,6 +728,34 @@ namespace COMCMS.Common
|
||||
return url;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取post表单金钱字段值
|
||||
/// </summary>
|
||||
/// <param name="inputName"></param>
|
||||
/// <returns></returns>
|
||||
public static decimal GetPostFormMoney(string inputName)
|
||||
{
|
||||
string v = MyHttpContext.Current.Request.Form[inputName];
|
||||
decimal price = 0M;
|
||||
if (!IsDecimal(v) && decimal.Parse(v) < 0) v = "0";
|
||||
price = decimal.Parse(v);
|
||||
return price;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取get表单金钱字段值
|
||||
/// </summary>
|
||||
/// <param name="inputName"></param>
|
||||
/// <returns></returns>
|
||||
public static decimal GetQueryStringMoney(string inputName)
|
||||
{
|
||||
string v = MyHttpContext.Current.Request.Query[inputName];
|
||||
decimal price = 0M;
|
||||
if (!IsDecimal(v) && decimal.Parse(v) < 0) v = "0";
|
||||
price = decimal.Parse(v);
|
||||
return price;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 处理部分
|
||||
@@ -979,4 +1007,36 @@ namespace COMCMS.Common
|
||||
#endregion
|
||||
|
||||
}
|
||||
|
||||
#region 常用扩展方法
|
||||
/// <summary>
|
||||
/// 扩展方法
|
||||
/// </summary>
|
||||
public static class CommExtension
|
||||
{
|
||||
#region 货币转换
|
||||
/// <summary>
|
||||
/// 数据库中金额换成元单位
|
||||
/// </summary>
|
||||
/// <param name="price"></param>
|
||||
/// <returns></returns>
|
||||
public static decimal ConvertToMoney(this int price)
|
||||
{
|
||||
decimal realPrice = (decimal)price / 100;
|
||||
return realPrice;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 元单位的金额换算成分
|
||||
/// </summary>
|
||||
/// <param name="price"></param>
|
||||
/// <returns></returns>
|
||||
public static int ConvertMoneyToInt(this decimal price)
|
||||
{
|
||||
return (int)(price * 100);
|
||||
}
|
||||
#endregion
|
||||
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user