public decimal GetDecimal(string name, decimal defaultValue = 0) { name = name.ToLower(); var value = Get(name); return(string.IsNullOrWhiteSpace(value) ? defaultValue : TranslateUtils.ToDecimalWithNagetive(value, defaultValue)); }
public decimal GetQueryDecimal(string name, decimal defaultValue = 0) { if (IsQueryExists(name)) { return(TranslateUtils.ToDecimalWithNagetive(QueryString[name])); } return(defaultValue); }
public decimal GetDecimal(string key, decimal defaultValue = 0) { var value = Get(key); if (value == null) { return(defaultValue); } if (value is decimal) { return((decimal)value); } return(TranslateUtils.ToDecimalWithNagetive(value.ToString(), defaultValue)); }
public decimal GetQueryDecimal(string name, decimal defaultValue = 0) { return(!string.IsNullOrEmpty(HttpRequest.QueryString[name]) ? TranslateUtils.ToDecimalWithNagetive(HttpRequest.QueryString[name]) : defaultValue); }
public decimal GetPostDecimal(string name, decimal defaultValue = 0) { return(TranslateUtils.ToDecimalWithNagetive(PostData[name]?.ToString(), defaultValue)); }