This commit is contained in:
@@ -55,7 +55,7 @@ namespace AyaNova.Biz
|
|||||||
{
|
{
|
||||||
switch (sDataType)
|
switch (sDataType)
|
||||||
{
|
{
|
||||||
case "text":
|
case AyDataType.Text:
|
||||||
{
|
{
|
||||||
if (sOperator == FilterComparisonOperator.Equality)
|
if (sOperator == FilterComparisonOperator.Equality)
|
||||||
{
|
{
|
||||||
@@ -132,7 +132,7 @@ namespace AyaNova.Biz
|
|||||||
#region Build for specific type
|
#region Build for specific type
|
||||||
switch (sDataType)
|
switch (sDataType)
|
||||||
{
|
{
|
||||||
case "text":
|
case AyDataType.Text:
|
||||||
//escape any pre-existing apostrophes
|
//escape any pre-existing apostrophes
|
||||||
//i.e. "O'Flaherty's pub" would cause fits
|
//i.e. "O'Flaherty's pub" would cause fits
|
||||||
//if this wasn't done
|
//if this wasn't done
|
||||||
@@ -234,7 +234,7 @@ namespace AyaNova.Biz
|
|||||||
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case "bool":
|
case AyDataType.Bool:
|
||||||
{
|
{
|
||||||
switch (sOperator)
|
switch (sOperator)
|
||||||
{
|
{
|
||||||
@@ -261,7 +261,7 @@ namespace AyaNova.Biz
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "date":
|
case AyDataType.Date:
|
||||||
{
|
{
|
||||||
//Note: it is assumed all dates come into here from the CLIENT in UTC iso8601 format
|
//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
|
//suitable for the database to handle as all database dates are in UTC
|
||||||
@@ -655,7 +655,6 @@ namespace AyaNova.Biz
|
|||||||
|
|
||||||
switch (sOperator)
|
switch (sOperator)
|
||||||
{
|
{
|
||||||
|
|
||||||
case FilterComparisonOperator.Equality:
|
case FilterComparisonOperator.Equality:
|
||||||
sb.Append(">='");
|
sb.Append(">='");
|
||||||
sb.Append(sLowEnd);
|
sb.Append(sLowEnd);
|
||||||
@@ -689,7 +688,6 @@ namespace AyaNova.Biz
|
|||||||
sb.Append("'");
|
sb.Append("'");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
||||||
case FilterComparisonOperator.NotEqual:
|
case FilterComparisonOperator.NotEqual:
|
||||||
sb.Append("<'");
|
sb.Append("<'");
|
||||||
sb.Append(sLowEnd);
|
sb.Append(sLowEnd);
|
||||||
@@ -711,15 +709,15 @@ namespace AyaNova.Biz
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "System.Decimal":
|
case AyDataType.Decimal:
|
||||||
case "System.Int32":
|
case AyDataType.Integer: //whole numbers, not only integer
|
||||||
case "System.Int64"://case 808
|
|
||||||
{
|
{
|
||||||
//case 1795 - it's numeric, convert to locale independant format
|
//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;
|
NumberFormatInfo nfi = System.Globalization.CultureInfo.CurrentCulture.NumberFormat;
|
||||||
switch (sDataType)
|
switch (sDataType)
|
||||||
{
|
{
|
||||||
case "System.Decimal":
|
case AyDataType.Decimal:
|
||||||
{
|
{
|
||||||
if (nfi.CurrencyDecimalSeparator != ".")
|
if (nfi.CurrencyDecimalSeparator != ".")
|
||||||
{
|
{
|
||||||
@@ -728,16 +726,7 @@ namespace AyaNova.Biz
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case "System.Int32":
|
case AyDataType.Integer:
|
||||||
{
|
|
||||||
if (nfi.NumberDecimalSeparator != ".")
|
|
||||||
{
|
|
||||||
sValue = sValue.Replace(nfi.NumberGroupSeparator, "");
|
|
||||||
sValue = sValue.Replace(nfi.NumberDecimalSeparator, ".");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case "System.Int64":
|
|
||||||
{
|
{
|
||||||
if (nfi.NumberDecimalSeparator != ".")
|
if (nfi.NumberDecimalSeparator != ".")
|
||||||
{
|
{
|
||||||
@@ -750,7 +739,6 @@ namespace AyaNova.Biz
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
switch (sOperator)
|
switch (sOperator)
|
||||||
{
|
{
|
||||||
case FilterComparisonOperator.Equality:
|
case FilterComparisonOperator.Equality:
|
||||||
@@ -783,7 +771,7 @@ namespace AyaNova.Biz
|
|||||||
sb.Append(sValue);
|
sb.Append(sValue);
|
||||||
break;
|
break;
|
||||||
default:
|
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