- Timestamp:
- 05/21/11 16:13:05 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/WebApplication/MVC2/HLWebOKBQueryPlugin/ViewModels/ComparisonsHelper.cs
r6191 r6245 22 22 private static String STRING_COMPARISONS_NOT_LIKE = "not like"; 23 23 24 private static String BOOL_COMPARISONS_EQUAL = "="; 25 private static String BOOL_COMPARISONS_NOT_EQUAL = "<>"; 26 27 public static List<ComparisonItem> boolComparisons = new List<ComparisonItem>() 28 { new ComparisonItem((int)OKBQueryService.EqualityComparison.Equal, BOOL_COMPARISONS_EQUAL), 29 new ComparisonItem((int)OKBQueryService.EqualityComparison.NotEqual, BOOL_COMPARISONS_NOT_EQUAL) 30 }; 24 31 public static List<ComparisonItem> ordinalComparisons = new List<ComparisonItem>() 25 32 { new ComparisonItem((int)OKBQueryService.OrdinalComparison.Less, ORDINAL_COMPARISONS_LESS), … … 40 47 41 48 42 public static String GetValueForStringComparision(OKBQueryService.StringComparison comparisionValue) 43 { 44 switch (comparisionValue) 45 { 46 case OKBQueryService.StringComparison.Equal: 47 return STRING_COMPARISONS_EQUAL; 48 case OKBQueryService.StringComparison.Contains: 49 return STRING_COMPARISONS_CONTAINS; 50 case OKBQueryService.StringComparison.Like: 51 return STRING_COMPARISONS_LIKE; 52 case OKBQueryService.StringComparison.NotContains: 53 return STRING_COMPARISONS_NOT_CONTAINS; 54 case OKBQueryService.StringComparison.NotEqual: 55 return STRING_COMPARISONS_NOT_EQUAL; 56 case OKBQueryService.StringComparison.NotLike: 57 return STRING_COMPARISONS_NOT_LIKE; 58 default: 59 return STRING_COMPARISONS_EQUAL; //TODO 60 } 61 } 49 //public static String GetValueForStringComparision(OKBQueryService.StringComparison comparisionValue) 50 //{ 51 // switch (comparisionValue) 52 // { 53 // case OKBQueryService.StringComparison.Equal: 54 // return STRING_COMPARISONS_EQUAL; 55 // case OKBQueryService.StringComparison.Contains: 56 // return STRING_COMPARISONS_CONTAINS; 57 // case OKBQueryService.StringComparison.Like: 58 // return STRING_COMPARISONS_LIKE; 59 // case OKBQueryService.StringComparison.NotContains: 60 // return STRING_COMPARISONS_NOT_CONTAINS; 61 // case OKBQueryService.StringComparison.NotEqual: 62 // return STRING_COMPARISONS_NOT_EQUAL; 63 // case OKBQueryService.StringComparison.NotLike: 64 // return STRING_COMPARISONS_NOT_LIKE; 65 // default: 66 // return STRING_COMPARISONS_EQUAL; //TODO 67 // } 68 //} 69 70 62 71 63 72 … … 85 94 } 86 95 } 96 97 public static OKBQueryService.EqualityComparison GetEqualityComparisonForValue(string comparisonValue) 98 { 99 int v = Int32.Parse(comparisonValue); 100 101 switch (v) 102 { 103 case (int)OKBQueryService.EqualityComparison.Equal: 104 return OKBQueryService.EqualityComparison.Equal; 105 case (int)OKBQueryService.EqualityComparison.NotEqual: 106 return OKBQueryService.EqualityComparison.NotEqual; 107 default: 108 return OKBQueryService.EqualityComparison.Equal; //TODO 109 } 110 } 111 112 public static OKBQueryService.OrdinalComparison GetOrdinalComparisonForValue(string comparisonValue) 113 { 114 int v = Int32.Parse(comparisonValue); 115 116 117 118 switch (v) 119 { 120 case (int)OKBQueryService.OrdinalComparison.Equal: 121 return OKBQueryService.OrdinalComparison.Equal; 122 case (int)OKBQueryService.OrdinalComparison.Greater: 123 return OKBQueryService.OrdinalComparison.Greater; 124 case (int)OKBQueryService.OrdinalComparison.GreaterOrEqual: 125 return OKBQueryService.OrdinalComparison.GreaterOrEqual; 126 case (int)OKBQueryService.OrdinalComparison.Less: 127 return OKBQueryService.OrdinalComparison.Less; 128 case (int)OKBQueryService.OrdinalComparison.NotEqual: 129 return OKBQueryService.OrdinalComparison.NotEqual; 130 case (int)OKBQueryService.OrdinalComparison.LessOrEqual: 131 return OKBQueryService.OrdinalComparison.LessOrEqual; 132 default: 133 return OKBQueryService.OrdinalComparison.Equal; //TODO 134 } 135 136 137 } 87 138 } 88 139 }
Note: See TracChangeset
for help on using the changeset viewer.