This commit is contained in:
@@ -5,6 +5,7 @@ using System.Text;
|
||||
using System.Linq;
|
||||
using AyaNova.Models;
|
||||
using AyaNova.Biz;
|
||||
using AyaNova.Util;
|
||||
|
||||
namespace AyaNova.DataList
|
||||
{
|
||||
@@ -238,45 +239,33 @@ namespace AyaNova.DataList
|
||||
sb.Append(sValue);
|
||||
sb.Append("'");
|
||||
break;
|
||||
|
||||
|
||||
/* NOTE: CASE - I decided to NOT do case insensitive for now for datalists like I did for picklists because it's a bit of a different situation
|
||||
I would need to make big changes to the select builder and this criteria builder so it's TTM at the moment because it's all tested and working
|
||||
however also the use is a bit different in that it's much more necessary to be hyper accurate here since this drives reporting and potentially a lot
|
||||
of important business data. Matching two different clients inadvertantly because of a case issue would be a bit of a kerfuffle potentially so I'd rather err on the side of accuracy
|
||||
and also I'm not certain how the case code will work with other languages so it's a bit more risky here, if a picklist doesn't work I get a support call but if a report is missing data then maybe
|
||||
the user doesn't realize it and has bad reports.
|
||||
|
||||
code from picklist in case I decide to do it later
|
||||
if (ServerGlobalBizSettings.SearchCaseSensitiveOnly)
|
||||
sWhere = $"({valueColumnName} like '%{autoCompleteQuery}%')";
|
||||
else
|
||||
sWhere = $"(lower({valueColumnName}) like lower('%{autoCompleteQuery}%'))";
|
||||
*/
|
||||
|
||||
//Following 7 operators added 14-June-2006
|
||||
|
||||
case DataListFilterComparisonOperator.NotContains:
|
||||
sb.Append("Not Like '%");
|
||||
sb.Append(sValue);
|
||||
sb.Append("%'");
|
||||
if (ServerGlobalBizSettings.Cache.FilterCaseSensitive)
|
||||
sb.Append($"NOT LIKE '%{sValue}%'");
|
||||
else
|
||||
sb.Append($"NOT LIKE lower('%{sValue}%')");
|
||||
break;
|
||||
|
||||
case DataListFilterComparisonOperator.Contains:
|
||||
sb.Append("Like '%");
|
||||
sb.Append(sValue);
|
||||
sb.Append("%'");
|
||||
if (ServerGlobalBizSettings.Cache.FilterCaseSensitive)
|
||||
sb.Append($"LIKE '%{sValue}%'");
|
||||
else
|
||||
sb.Append($"LIKE lower('%{sValue}%')");
|
||||
break;
|
||||
|
||||
case DataListFilterComparisonOperator.StartsWith:
|
||||
sb.Append("Like '");
|
||||
sb.Append(sValue);
|
||||
sb.Append("%'");
|
||||
if (ServerGlobalBizSettings.Cache.FilterCaseSensitive)
|
||||
sb.Append($"LIKE '{sValue}%'");
|
||||
else
|
||||
sb.Append($"LIKE lower('{sValue}%')");
|
||||
break;
|
||||
|
||||
case DataListFilterComparisonOperator.EndsWith:
|
||||
sb.Append("Like '%");
|
||||
sb.Append(sValue);
|
||||
sb.Append("'");
|
||||
if (ServerGlobalBizSettings.Cache.FilterCaseSensitive)
|
||||
sb.Append($"LIKE '%{sValue}'");
|
||||
else
|
||||
sb.Append($"LIKE lower('%{sValue}')");
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
Reference in New Issue
Block a user