This commit is contained in:
@@ -52,14 +52,14 @@ namespace AyaNova.Biz
|
||||
|
||||
//handle null values separately
|
||||
if (sValue == FilterSpecialToken.Null)
|
||||
{
|
||||
{
|
||||
switch (sDataType)
|
||||
{
|
||||
case "text":
|
||||
case AyDataType.Text:
|
||||
{
|
||||
if (sOperator == FilterComparisonOperator.Equality)
|
||||
{
|
||||
|
||||
|
||||
sb.Append("Is Null");
|
||||
sb.Append(" OR ");
|
||||
sb.Append(sColumn);
|
||||
@@ -132,7 +132,7 @@ namespace AyaNova.Biz
|
||||
#region Build for specific type
|
||||
switch (sDataType)
|
||||
{
|
||||
case "text":
|
||||
case AyDataType.Text:
|
||||
//escape any pre-existing apostrophes
|
||||
//i.e. "O'Flaherty's pub" would cause fits
|
||||
//if this wasn't done
|
||||
@@ -234,7 +234,7 @@ namespace AyaNova.Biz
|
||||
|
||||
}
|
||||
break;
|
||||
case "bool":
|
||||
case AyDataType.Bool:
|
||||
{
|
||||
switch (sOperator)
|
||||
{
|
||||
@@ -261,7 +261,7 @@ namespace AyaNova.Biz
|
||||
}
|
||||
break;
|
||||
|
||||
case "date":
|
||||
case AyDataType.Date:
|
||||
{
|
||||
//Note: it is assumed all dates come into here from the CLIENT in UTC iso8601 format
|
||||
//suitable for the database to handle as all database dates are in UTC
|
||||
@@ -649,13 +649,12 @@ namespace AyaNova.Biz
|
||||
//so a simple parse should be sufficient
|
||||
//https://docs.microsoft.com/en-us/dotnet/standard/base-types/standard-date-and-time-format-strings#Roundtrip
|
||||
System.DateTime dtData = DateTime.Parse(sValue);
|
||||
|
||||
|
||||
string sHighEnd = PostgresDateFormat(MaxMilliseconds(dtData));
|
||||
string sLowEnd = PostgresDateFormat(ZeroMilliseconds(dtData));
|
||||
|
||||
switch (sOperator)
|
||||
{
|
||||
|
||||
switch (sOperator)
|
||||
{
|
||||
case FilterComparisonOperator.Equality:
|
||||
sb.Append(">='");
|
||||
sb.Append(sLowEnd);
|
||||
@@ -689,7 +688,6 @@ namespace AyaNova.Biz
|
||||
sb.Append("'");
|
||||
break;
|
||||
|
||||
|
||||
case FilterComparisonOperator.NotEqual:
|
||||
sb.Append("<'");
|
||||
sb.Append(sLowEnd);
|
||||
@@ -711,15 +709,15 @@ namespace AyaNova.Biz
|
||||
}
|
||||
break;
|
||||
|
||||
case "System.Decimal":
|
||||
case "System.Int32":
|
||||
case "System.Int64"://case 808
|
||||
case AyDataType.Decimal:
|
||||
case AyDataType.Integer: //whole numbers, not only integer
|
||||
{
|
||||
//case 1795 - it's numeric, convert to locale independant format
|
||||
//RAVEN NOTE: this code looks suspect to me, but I'll leave it in for now
|
||||
NumberFormatInfo nfi = System.Globalization.CultureInfo.CurrentCulture.NumberFormat;
|
||||
switch (sDataType)
|
||||
{
|
||||
case "System.Decimal":
|
||||
case AyDataType.Decimal:
|
||||
{
|
||||
if (nfi.CurrencyDecimalSeparator != ".")
|
||||
{
|
||||
@@ -728,16 +726,7 @@ namespace AyaNova.Biz
|
||||
}
|
||||
}
|
||||
break;
|
||||
case "System.Int32":
|
||||
{
|
||||
if (nfi.NumberDecimalSeparator != ".")
|
||||
{
|
||||
sValue = sValue.Replace(nfi.NumberGroupSeparator, "");
|
||||
sValue = sValue.Replace(nfi.NumberDecimalSeparator, ".");
|
||||
}
|
||||
}
|
||||
break;
|
||||
case "System.Int64":
|
||||
case AyDataType.Integer:
|
||||
{
|
||||
if (nfi.NumberDecimalSeparator != ".")
|
||||
{
|
||||
@@ -750,7 +739,6 @@ namespace AyaNova.Biz
|
||||
|
||||
|
||||
|
||||
|
||||
switch (sOperator)
|
||||
{
|
||||
case FilterComparisonOperator.Equality:
|
||||
@@ -783,7 +771,7 @@ namespace AyaNova.Biz
|
||||
sb.Append(sValue);
|
||||
break;
|
||||
default:
|
||||
throw new System.ArgumentOutOfRangeException("OPERATOR_TYPE", sOperator, "GridToSqlCriteria unhandled operator type [" + sOperator + "] IN DECIMAL");
|
||||
throw new System.ArgumentOutOfRangeException("OPERATOR_TYPE", sOperator, "GridToSqlCriteria unhandled operator type [" + sOperator + "] IN NUMBER");
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user