Commit c24ead45 authored by VTHIEN's avatar VTHIEN

fixed sieve

parent f7b6a462
...@@ -39,7 +39,7 @@ namespace Sieve.Models ...@@ -39,7 +39,7 @@ namespace Sieve.Models
"ÝỲỴỶỸ" "ÝỲỴỶỸ"
}; };
public string RemoveSignVietnameseString(string str) public string RemoveSignAndUpperVietnameseString(string str)
{ {
if (str==null) if (str==null)
{ {
...@@ -50,7 +50,7 @@ namespace Sieve.Models ...@@ -50,7 +50,7 @@ namespace Sieve.Models
for (int j = 0; j < VietnameseSigns[i].Length; j++) for (int j = 0; j < VietnameseSigns[i].Length; j++)
str = str.Replace(VietnameseSigns[i][j], VietnameseSigns[0][i - 1]); str = str.Replace(VietnameseSigns[i][j], VietnameseSigns[0][i - 1]);
} }
return str; return str.ToUpper();
} }
} }
} }
...@@ -421,7 +421,7 @@ namespace Sieve.Services ...@@ -421,7 +421,7 @@ namespace Sieve.Services
foreach (var filterTermValue1 in filterTerm.Values) foreach (var filterTermValue1 in filterTerm.Values)
{ {
var filterTermValue = (new RemoveVietNamSign()).RemoveSignVietnameseString(filterTermValue1); var filterTermValue = (new RemoveVietNamSign()).RemoveSignAndUpperVietnameseString(filterTermValue1);
//string filterTermValue = this.RemoveSign4VietnameseString(filterTermValue1); //Added by thien to emove vietnam //string filterTermValue = this.RemoveSign4VietnameseString(filterTermValue1); //Added by thien to emove vietnam
dynamic constantVal = converter.CanConvertFrom(typeof(string)) dynamic constantVal = converter.CanConvertFrom(typeof(string))
...@@ -435,12 +435,12 @@ namespace Sieve.Services ...@@ -435,12 +435,12 @@ namespace Sieve.Services
{ {
//if (property.PropertyType.Name.ToLower().Equals("string")) //if (property.PropertyType.Name.ToLower().Equals("string"))
//{ //{
var upperData = Expression.Call(propertyValue,typeof(string).GetMethods() //var upperData = Expression.Call(propertyValue,typeof(string).GetMethods()
.First(m => m.Name == "ToUpper" && m.GetParameters().Length == 0)); // .First(m => m.Name == "ToUpper" && m.GetParameters().Length == 0));
propertyValue = Expression.Call( propertyValue = Expression.Call(
Expression.New(typeof(RemoveVietNamSign)), Expression.New(typeof(RemoveVietNamSign)),
typeof(RemoveVietNamSign).GetMethod("RemoveSignVietnameseString", new Type[] { typeof(string) }), typeof(RemoveVietNamSign).GetMethod("RemoveSignAndUpperVietnameseString", new Type[] { typeof(string) }),
upperData propertyValue
); );
/*}else /*}else
{ {
...@@ -453,9 +453,9 @@ namespace Sieve.Services ...@@ -453,9 +453,9 @@ namespace Sieve.Services
/**/ /**/
filterValue = Expression.Call(filterValue, //filterValue = Expression.Call(filterValue,
typeof(string).GetMethods() // typeof(string).GetMethods()
.First(m => m.Name == "ToUpper" && m.GetParameters().Length == 0)); // .First(m => m.Name == "ToUpper" && m.GetParameters().Length == 0));
} }
var expression = GetExpression(filterTerm, filterValue, propertyValue, bCaseSensitive); var expression = GetExpression(filterTerm, filterValue, propertyValue, bCaseSensitive);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment