private LiteFilter(LiteVariable leftVar, CompareTypeEnum _compareType, LiteVariable rightVar) { this.filterType = FilterTypeEnum.AND; this.filterType = FilterTypeEnum.CONDITION; this.LeftVar = leftVar; this.compareType = _compareType; this.RightVar = rightVar; }
private static LiteFilter CompareWith(object constValueLeft, CompareTypeEnum compareType, object constValueRight) { LiteVariable leftVar = LiteVariable.FromConst(constValueLeft); return(new LiteFilter(leftVar, compareType, LiteVariable.FromConst(constValueRight))); }
public static LiteFilter CompareWith(FilterField field, CompareTypeEnum compareType, object constValue) { LiteVariable leftVar = LiteVariable.FromField(field); return(new LiteFilter(leftVar, compareType, LiteVariable.FromConst(constValue))); }
/// <summary> /// This method Display the Settings /// </summary> private void DisplaySettings() { // if the settings object exist if (this.HasSettings) { // parse the CompareType CompareTypeEnum compareType = EnumHelper.GetEnumValue <CompareTypeEnum>(this.Settings.CompareType, CompareTypeEnum.CompareTwoSQLDatabases); // If the CompareType is CompareTwoSQLDatabases if (compareType == CompareTypeEnum.CompareTwoSQLDatabases) { // if StoreConnectionStrings is true if (this.Settings.StoreConnectionStrings) { // Display the Source ConnectionString this.SourceConnectionStringControl.Text = Settings.SourceConnectionString; // Display the Target ConnectionString this.TargetConnectionStringControl.Text = Settings.TargetConnectionString; } } else if (compareType == CompareTypeEnum.CompareXmlFileAndSQLDatabase) { // if StoreConnectionStrings is true if (this.Settings.StoreConnectionStrings) { // Display the Target ConnectionString this.TargetConnectionStringControl.Text = Settings.TargetConnectionString; } else { // Display the Target ConnectionString this.TargetConnectionStringControl.Text = null; } // Display the SourceXmlFilePath this.SourceConnectionStringControl.Text = Settings.SourceXmlFilePath; } else if (compareType == CompareTypeEnum.CreateXmlFile) { // if StoreConnectionStrings is true if (this.Settings.StoreConnectionStrings) { // Display the Target ConnectionString this.SourceConnectionStringControl.Text = Settings.SourceConnectionString; } else { // Display the Target ConnectionString this.TargetConnectionStringControl.Text = null; } // Display the SourceXmlFilePath this.TargetConnectionStringControl.Text = Settings.OutputXmlFilePath; } // Set the value for IgnoreDiagramProceduresCheckBox.Checked this.IgnoreDiagramProceduresCheckBox.Checked = Settings.IgnoreDiagramProcedures; // Set the value for StoreConnectionStringsCheckBox this.StoreConnectionStringsCheckBox.Checked = true; // Set the value for this.RemoteCompareCheckBox.Checked = Settings.RemoteComparison; this.CreateXmlFileCheckBox.Checked = Settings.CreateXmlFile; } // Control the UI UIControl(); }
public static string GetCompareExpression(this QueryParma qp, Type ptype) { string str = "< "; switch (qp.CompareTypeEnum) { case CompareTypeEnum.LessThan: str = " it.{0} < "; break; case CompareTypeEnum.LessThanOrEqual: str = " it.{0} <= "; break; case CompareTypeEnum.Equal: str = " it.{0} = "; break; case CompareTypeEnum.GreaterThanOrEqual: str = " it.{0} >= "; break; case CompareTypeEnum.GreaterThan: str = " it.{0} > "; break; case CompareTypeEnum.EndWith: str = " it.{0} LIKE \"%{1}\""; break; case CompareTypeEnum.StartWith: str = " it.{0} LIKE \"{1}%\""; break; case CompareTypeEnum.Contains: str = " it.{0} LIKE \"%{1}%\""; break; case CompareTypeEnum.NotEqual: str = " it.{0} != "; break; } Type[] source = new Type[] { typeof(DateTime), typeof(DateTime?), typeof(string) }; CompareTypeEnum[] enumArray = new CompareTypeEnum[] { CompareTypeEnum.StartWith, CompareTypeEnum.EndWith, CompareTypeEnum.Contains }; if (!enumArray.Contains <CompareTypeEnum>(qp.CompareTypeEnum)) { if (!source.Contains <Type>(ptype)) { str = str + "{1}"; } else { str = str + "\"{1}\""; } } Type[] typeArray2 = new Type[] { typeof(DateTime), typeof(DateTime?) }; if (typeArray2.Contains <Type>(ptype)) { str = str.Replace("\"", "").Replace("{1}", "cast('{1}' as System.DateTime)"); } return(str); }