Skip to content

Commit

Permalink
385:MDataTable 修正Select条件为<=的数字判断问题(2016-10-08)
Browse files Browse the repository at this point in the history
  • Loading branch information
cyq1162 committed Oct 8, 2016
1 parent bde60b0 commit 16c99a4
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
4 changes: 2 additions & 2 deletions Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@
//
// 可以指定所有这些值,也可以使用“修订号”和“内部版本号”的默认值,
// 方法是按如下所示使用“*”:
[assembly: AssemblyVersion("5.6.6.0")]
[assembly: AssemblyFileVersion("5.6.6.0")]
[assembly: AssemblyVersion("5.6.6.1")]
[assembly: AssemblyFileVersion("5.6.6.1")]
8 changes: 4 additions & 4 deletions Table/MDataTableFilter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -648,9 +648,9 @@ private static bool Compare(SqlDbType sqlType, object valueA, Op op, object valu
switch (DataType.GetGroup(sqlType))
{
case 1://int
return op == Op.Big ? (Convert.ToDecimal(valueA) > Convert.ToDecimal(valueB)) : (Convert.ToDecimal(valueA) >= Convert.ToDecimal(valueB));
return op == Op.Big ? Convert.ToDecimal(valueA) > Convert.ToDecimal(valueB) : Convert.ToDecimal(valueA) >= Convert.ToDecimal(valueB);
case 2://datetime
return op == Op.Big ? (DateTime)valueA > Convert.ToDateTime(valueB) : (DateTime)valueA >= Convert.ToDateTime(valueB);
return op == Op.Big ? Convert.ToDateTime(valueA) > Convert.ToDateTime(valueB) : Convert.ToDateTime(valueA) >= Convert.ToDateTime(valueB);
default:
int value = Convert.ToString(valueA).CompareTo(valueB);
return op == Op.Big ? value == 1 : value > -1;
Expand All @@ -665,9 +665,9 @@ private static bool Compare(SqlDbType sqlType, object valueA, Op op, object valu
switch (DataType.GetGroup(sqlType))
{
case 1://int
return op == Op.Small ? ((Double)valueA < Convert.ToDouble(valueB)) : ((Double)valueA <= Convert.ToDouble(valueB));
return op == Op.Small ? Convert.ToDecimal(valueA) < Convert.ToDecimal(valueB) : Convert.ToDecimal(valueA) <= Convert.ToDecimal(valueB);
case 2://datetime
return op == Op.Small ? (DateTime)valueA < Convert.ToDateTime(valueB) : (DateTime)valueA <= Convert.ToDateTime(valueB);
return op == Op.Small ? Convert.ToDateTime(valueA) < Convert.ToDateTime(valueB) : Convert.ToDateTime(valueA) <= Convert.ToDateTime(valueB);
default:
int value = Convert.ToString(valueA).CompareTo(valueB);
return op == Op.Small ? value == -1 : value <= 0;
Expand Down
3 changes: 2 additions & 1 deletion 更新记录.txt
Original file line number Diff line number Diff line change
Expand Up @@ -597,4 +597,5 @@
381��MDataTable �����������µķ���ֵ���⣨2016-09-30)
382��MAction �ڲ�����IsIgnoreDeleteField �ڲ����ԣ�2016-09-30)
383��XHtmlBase ������Xml�ļ��أ�2016-10-08)
384��SqlValue �����������ƣ�GUID��ISNULL����������2016-10-08)
384��SqlValue �����������ƣ�GUID��ISNULL����������2016-10-08)
385��MDataTable ����Select����Ϊ<=�������ж����⣨2016-10-08)

0 comments on commit 16c99a4

Please sign in to comment.