Commit 38e6514e authored by VTHIEN's avatar VTHIEN

fixed

parent 8f28442d
......@@ -501,13 +501,58 @@ namespace Sieve.Services
case FilterOperator.LessThanOrEqualTo:
return sResult + "<=" + value;
case FilterOperator.Contains:
return sResult + ".Contains(" + value.ToLower() + ")";
return sResult + ".Contains(" + RemoveSignAndLowerCase4VietnameseString(value) + ")";
case FilterOperator.StartsWith:
return sResult + ".Contains(" + value.ToLower() + ")";
return sResult + ".Contains(" + RemoveSignAndLowerCase4VietnameseString(value) + ")";
default:
return sResult + "=" + value;
}
}
private static string[] VietnameseSigns = new string[]
{
"aAeEoOuUiIdDyY",
"áàạảãâấầậẩẫăắằặẳẵ",
"ÁÀẠẢÃÂẤẦẬẨẪĂẮẰẶẲẴ",
"éèẹẻẽêếềệểễ",
"ÉÈẸẺẼÊẾỀỆỂỄ",
"óòọỏõôốồộổỗơớờợởỡ",
"ÓÒỌỎÕÔỐỒỘỔỖƠỚỜỢỞỠ",
"úùụủũưứừựửữ",
"ÚÙỤỦŨƯỨỪỰỬỮ",
"íìịỉĩ",
"ÍÌỊỈĨ",
"đ",
"Đ",
"ýỳỵỷỹ",
"ÝỲỴỶỸ"
};
public static string RemoveSignAndLowerCase4VietnameseString(string str)
{
str = str.ToLower();
for (int i = 1; i < VietnameseSigns.Length; i++)
{
for (int j = 0; j < VietnameseSigns[i].Length; j++)
str = str.Replace(VietnameseSigns[i][j], VietnameseSigns[0][i - 1]);
}
return str;
}
private static Expression GetExpression(TFilterTerm filterTerm, dynamic filterValue, dynamic propertyValue, bool bCaseSensitive)
{
switch (filterTerm.OperatorParsed)
......
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