Employees emp = new Employees();
WhereParameter wp = emp.GetWhereParameter(\"EmployeeID\");using System.Reflection;
public class Employees : _Employees
{
public WhereParameter GetWhereParameter(string columnName)
{
Type t = this.Where.GetType();
PropertyInfo prop = t.GetProperty(columnName);
WhereParameter wp = prop.GetGetMethod(true).Invoke(this.Where, null) as WhereParameter;
return wp;
}
}Dim MyType As Type = Me.Where.GetType
Dim PropInfo As PropertyInfo = MyType.GetProperty(TheColumn)
Dim MyWhere As MyGeneration.dOOdads.WhereParameter = CType(PropInfo.GetGetMethod(True).Invoke(Me.Where, Nothing), MyGeneration.dOOdads.WhereParameter)
Dim MyWhere As MyGeneration.dOOdads.WhereParameter = CType(PropInfo.GetGetMethod(True).Invoke(Me.Where, Nothing), MyGeneration.dOOdads.WhereParameter)
Dim em As New Employees
Dim wp As WhereParameter
wp = em.GetWhereParameter(\"EmployeeID\")Imports System.Reflection
Imports MyGeneration.dOOdads
Public Class Employees
Inherits _Employees
Public Function GetWhereParameter(ByVal columnName As String) As WhereParameter
Dim MyType As Type = Me.Where.GetType
Dim PropInfo As PropertyInfo = MyType.GetProperty(columnName)
Dim MyWhere As WhereParameter = CType(PropInfo.GetGetMethod(True).Invoke(Me.Where, Nothing), WhereParameter)
Return MyWhere
End Function
End ClassDim MyWhere As MyGeneration.dOOdads.WhereParameter = CType(PropInfo.GetGetMethod(True).Invoke(Me.Where, Nothing), MyGeneration.dOOdads.WhereParameter) Public Function GetWhereParameter(ByVal TheColumn As String) As MyGeneration.dOOdads.WhereParameter
Dim MyType As Type = Me.Where.GetType()
Dim PropInfo As PropertyInfo = MyType.GetProperty(TheColumn)
Dim MyWhere As MyGeneration.dOOdads.WhereParameter = CType(PropInfo.GetGetMethod(True).Invoke(Me.Where, Nothing), MyGeneration.dOOdads.WhereParameter)
Return MyWhere
End FunctionDim MyWhere As WhereParameter = CType(PropInfo.GetGetMethod(True).Invoke(Me.Where, Nothing), WhereParameter)Dim MyWhere1 As MyGeneration.dOOdads.WhereParameter = _TheInvoiceList.GetWhereParameter(WhereParam1)_TheInvoiceList.Query.AddWhereParemeter(MyWhere1)Employees emp = new Employees();
// This code
WhereParameter wp = emp.GetWhereParameter(\"EmployeeID\");
// Equals this code
WhereParameter wp = emp.Where.EmployeeID;// This code
emps.Where.LastName.Value = \"%A%\";
emps.Where.LastName.Operator = WhereParameter.Operand.Like;
// Equals this code
emps.Where.GetWhereParameter(\"LastName\").Value = \"%A%\";
emps.Where.GetWhereParameter(\"LastName\").Operator = WhereParameter.Operand.Like;Dim FilterOut As String = \"City 1|City 2|City 3\"
Dim filters As String[] = FilterOut.Split('|')
emps.Query.AddConjunction(WhereParameter.Conj.And)
emps.Query.OpenParenthesis()
emps.Where.City.Value = \"%\" + filters[0] + \"%\"
emps.Where.City.Operator = WhereParameter.Operand.Like
If (filters.Length > 1) Then
WhereParameter wp = emps.Where.TearOff.City
For i As Integer = 0 To filters.Length
wp = emps.Where.TearOff.City
wp.Value = \"%\" + filters[i] + \"%\"
wp.Operator = WhereParameter.Operand.Like
If (i <> filters.Length) Then
wp.Conjuction = WhereParameter.Conj.Or
End If
Next i
End If
emps.Query.CloseParenthesis()AND (City LIKE '%City 1%' OR City LIKE '%City 2%' OR City LIKE '%City 3%')Return to dOOdads - MyGeneration's .NET Architecture
Users browsing this forum: Google [Bot] and 1 guest