Public Function rtnOrderLineData(ByVal FOLineSLSS As String) As scOrderLinesInfo
    Dim e$__ As New _Closure$__21 With { _
        .$VB$Local_ldOrder = New scOrderData _
    }
    e$__.$VB$Local_ldOrder.FactoryOrder = FOLineSLSS
    Dim info As New scOrderLinesInfo
    Using entities As SE0085CTEntities1 = New SE0085CTEntities1
        Dim expression14 As ParameterExpression
        entities.Database.Connection.ConnectionString = Me._CTConnection
        Dim source As IQueryable(Of scOrderLinesInfo) = Queryable.Select(Of VB$AnonymousType_2(Of SEOrder, OrderLine, AssemblyLine, SEPlant), scOrderLinesInfo)((From $VB$It In (From od In entities.SEOrders
            Join ol In entities.OrderLines On od.OrderId Equals ol.SEOrder.OrderId
            Select New VB$AnonymousType_0(Of SEOrder, OrderLine)(od, ol) Into $VB$It
            Join al In entities.AssemblyLines On $VB$It.ol.AssemblyLine.AssemLineId Equals al.AssemLineId
            Select New VB$AnonymousType_1(Of VB$AnonymousType_0(Of SEOrder, OrderLine), AssemblyLine)($VB$It, al))
            Join pl In entities.SEPlants On $VB$It.al.SEPlant.SEPlantId Equals pl.SEPlantId
            Select New VB$AnonymousType_2(Of SEOrder, OrderLine, AssemblyLine, SEPlant)($VB$It.$VB$It1.od, $VB$It.$VB$It1.ol, $VB$It.al, pl) Into $VB$It
            Where (((($VB$It.od.OrderFO = e$__.$VB$Local_ldOrder.OrderFO) And ($VB$It.ol.OrderLineNum = e$__.$VB$Local_ldOrder.OrderLineNum)) And ($VB$It.ol.OrderLineSL = e$__.$VB$Local_ldOrder.OrderLineSL)) And ($VB$It.ol.OrderLineSS = e$__.$VB$Local_ldOrder.OrderLineSS))
            Select $VB$It), Expression.Lambda(Of Func(Of VB$AnonymousType_2(Of SEOrder, OrderLine, AssemblyLine, SEPlant), scOrderLinesInfo))(Expression.MemberInit(Expression.New(DirectCast(GetMethod(scOrderLinesInfo..ctor), ConstructorInfo), DirectCast(Nothing, Expression())), New MemberBinding() { Expression.Bind(DirectCast(GetMethod(scOrderLinesInfo.set_OrderLineId), MethodInfo), Expression.Property(Expression.Property(expression14 = Expression.Parameter(GetType(VB$AnonymousType_2(Of SEOrder, OrderLine, AssemblyLine, SEPlant)), "$VB$It"), DirectCast(GetMethod(VB$AnonymousType_2(Of SEOrder, OrderLine, AssemblyLine, SEPlant).get_ol, VB$AnonymousType_2(Of SEOrder, OrderLine, AssemblyLine, SEPlant)), MethodInfo)), DirectCast(GetMethod(OrderLine.get_OrderLineId), MethodInfo))), Expression.Bind(DirectCast(GetMethod(scOrderLinesInfo.set_AssemblyLineId), MethodInfo), Expression.Property(Expression.Property(expression14, DirectCast(GetMethod(VB$AnonymousType_2(Of SEOrder, OrderLine, AssemblyLine, SEPlant).get_al, VB$AnonymousType_2(Of SEOrder, OrderLine, AssemblyLine, SEPlant)), MethodInfo)), DirectCast(GetMethod(AssemblyLine.get_AssemLineId), MethodInfo))), Expression.Bind(DirectCast(GetMethod(scOrderLinesInfo.set_OrderLineNum), MethodInfo), Expression.Property(Expression.Property(expression14, DirectCast(GetMethod(VB$AnonymousType_2(Of SEOrder, OrderLine, AssemblyLine, SEPlant).get_ol, VB$AnonymousType_2(Of SEOrder, OrderLine, AssemblyLine, SEPlant)), MethodInfo)), DirectCast(GetMethod(OrderLine.get_OrderLineNum), MethodInfo))), Expression.Bind(DirectCast(GetMethod(scOrderLinesInfo.set_OrderLineQty), MethodInfo), Expression.ConvertChecked(Expression.Property(Expression.Property(expression14, DirectCast(GetMethod(VB$AnonymousType_2(Of SEOrder, OrderLine, AssemblyLine, SEPlant).get_ol, VB$AnonymousType_2(Of SEOrder, OrderLine, AssemblyLine, SEPlant)), MethodInfo)), DirectCast(GetMethod(OrderLine.get_OrderLineQty), MethodInfo)), GetType(Integer))), Expression.Bind(DirectCast(GetMethod(scOrderLinesInfo.set_OrderLineSS), MethodInfo), Expression.Property(Expression.Property(expression14, DirectCast(GetMethod(VB$AnonymousType_2(Of SEOrder, OrderLine, AssemblyLine, SEPlant).get_ol, VB$AnonymousType_2(Of SEOrder, OrderLine, AssemblyLine, SEPlant)), MethodInfo)), DirectCast(GetMethod(OrderLine.get_OrderLineSS), MethodInfo))), Expression.Bind(DirectCast(GetMethod(scOrderLinesInfo.set_OrderLineSL), MethodInfo), Expression.Property(Expression.Property(expression14, DirectCast(GetMethod(VB$AnonymousType_2(Of SEOrder, OrderLine, AssemblyLine, SEPlant).get_ol, VB$AnonymousType_2(Of SEOrder, OrderLine, AssemblyLine, SEPlant)), MethodInfo)), DirectCast(GetMethod(OrderLine.get_OrderLineSL), MethodInfo))), Expression.Bind(DirectCast(GetMethod(scOrderLinesInfo.set_OrderLineTargetDt), MethodInfo), Expression.Convert(Expression.Property(Expression.Property(expression14, DirectCast(GetMethod(VB$AnonymousType_2(Of SEOrder, OrderLine, AssemblyLine, SEPlant).get_ol, VB$AnonymousType_2(Of SEOrder, OrderLine, AssemblyLine, SEPlant)), MethodInfo)), DirectCast(GetMethod(OrderLine.get_OrderLineTargetDt), MethodInfo)), GetType(DateTime))), Expression.Bind(DirectCast(GetMethod(scOrderLinesInfo.set_OrderLineShipDt), MethodInfo), Expression.Convert(Expression.Property(Expression.Property(expression14, DirectCast(GetMethod(VB$AnonymousType_2(Of SEOrder, OrderLine, AssemblyLine, SEPlant).get_ol, VB$AnonymousType_2(Of SEOrder, OrderLine, AssemblyLine, SEPlant)), MethodInfo)), DirectCast(GetMethod(OrderLine.get_OrderLineShipDt), MethodInfo)), GetType(DateTime))), Expression.Bind(DirectCast(GetMethod(scOrderLinesInfo.set_OrderLineShippedDt), MethodInfo), Expression.Convert(Expression.Property(Expression.Property(expression14, DirectCast(GetMethod(VB$AnonymousType_2(Of SEOrder, OrderLine, AssemblyLine, SEPlant).get_ol, VB$AnonymousType_2(Of SEOrder, OrderLine, AssemblyLine, SEPlant)), MethodInfo)), DirectCast(GetMethod(OrderLine.get_OrderLineShippedDt), MethodInfo)), GetType(DateTime))), Expression.Bind(DirectCast(GetMethod(scOrderLinesInfo.set_OrderLineShippedbln), MethodInfo), Expression.Convert(Expression.Property(Expression.Property(expression14, DirectCast(GetMethod(VB$AnonymousType_2(Of SEOrder, OrderLine, AssemblyLine, SEPlant).get_ol, VB$AnonymousType_2(Of SEOrder, OrderLine, AssemblyLine, SEPlant)), MethodInfo)), DirectCast(GetMethod(OrderLine.get_OrderLineShipped), MethodInfo)), GetType(Boolean))), Expression.Bind(DirectCast(GetMethod(scOrderLinesInfo.set_OrderLineAssyStartDt), MethodInfo), Expression.Convert(Expression.Property(Expression.Property(expression14, DirectCast(GetMethod(VB$AnonymousType_2(Of SEOrder, OrderLine, AssemblyLine, SEPlant).get_ol, VB$AnonymousType_2(Of SEOrder, OrderLine, AssemblyLine, SEPlant)), MethodInfo)), DirectCast(GetMethod(OrderLine.get_OrderLineAssyStartDt), MethodInfo)), GetType(DateTime))) }), New ParameterExpression() { expression14 }))
        If ((Not source Is Nothing) AndAlso (Queryable.Count(Of scOrderLinesInfo)(source) > 0)) Then
            Try 
                info = Queryable.First(Of scOrderLinesInfo)(source)
            Catch exception1 As Exception
                ProjectData.SetProjectError(exception1)
                Dim exception As Exception = exception1
                info = Nothing
                ProjectData.ClearProjectError
            End Try
        End If
        entities.Database.Connection.Close
    End Using
    Return info
End Function

 

------------------------------------------------------
Public Function rtnAttrCUPlating() As List(Of scPartAttr1)
    Dim list As New List(Of scPartAttr1)
    Using entities As SE0085CTEntities1 = New SE0085CTEntities1
        Dim expression5 As ParameterExpression
        Dim expression7 As ParameterExpression
        entities.Database.Connection.ConnectionString = Me._CTConnection
        Dim source As IQueryable(Of scPartAttr1) = Queryable.Select(Of VB$AnonymousType_5(Of PartType, PartAttr1), scPartAttr1)((From $VB$It In Queryable.Where(Of VB$AnonymousType_5(Of PartType, PartAttr1))((From p In entities.PartTypes
            Join a In entities.PartAttr1 On p.PartTypeId Equals a.PartType.PartTypeId
            Select New VB$AnonymousType_5(Of PartType, PartAttr1)(p, a)), Expression.Lambda(Of Func(Of VB$AnonymousType_5(Of PartType, PartAttr1), Boolean))(Expression.Coalesce(Expression.And(Expression.And(Expression.And(Expression.Equal(Expression.Property(Expression.Property(expression5 = Expression.Parameter(GetType(VB$AnonymousType_5(Of PartType, PartAttr1)), "$VB$It"), DirectCast(GetMethod(VB$AnonymousType_5(Of PartType, PartAttr1).get_p, VB$AnonymousType_5(Of PartType, PartAttr1)), MethodInfo)), DirectCast(GetMethod(PartType.get_PartTypeActive), MethodInfo)), Expression.Convert(Expression.Constant(True, GetType(Boolean)), GetType(Boolean?)), True, Nothing), Expression.Equal(Expression.Property(Expression.Property(expression5, DirectCast(GetMethod(VB$AnonymousType_5(Of PartType, PartAttr1).get_a, VB$AnonymousType_5(Of PartType, PartAttr1)), MethodInfo)), DirectCast(GetMethod(PartAttr1.get_PartAttrActive), MethodInfo)), Expression.Convert(Expression.Constant(True, GetType(Boolean)), GetType(Boolean?)), True, Nothing)), Expression.Convert(Expression.And(Expression.GreaterThanOrEqual(Expression.Property(Expression.Property(expression5, DirectCast(GetMethod(VB$AnonymousType_5(Of PartType, PartAttr1).get_p, VB$AnonymousType_5(Of PartType, PartAttr1)), MethodInfo)), DirectCast(GetMethod(PartType.get_PartTypeCode), MethodInfo)), Expression.Constant(&H2000000, GetType(Long)), True, Nothing), Expression.LessThanOrEqual(Expression.Property(Expression.Property(expression5, DirectCast(GetMethod(VB$AnonymousType_5(Of PartType, PartAttr1).get_p, VB$AnonymousType_5(Of PartType, PartAttr1)), MethodInfo)), DirectCast(GetMethod(PartType.get_PartTypeCode), MethodInfo)), Expression.Constant(&H2FFFFFF, GetType(Long)), True, Nothing)), GetType(Boolean?))), Expression.Convert(Expression.LessThanOrEqual(Expression.Property(Expression.Property(expression5, DirectCast(GetMethod(VB$AnonymousType_5(Of PartType, PartAttr1).get_a, VB$AnonymousType_5(Of PartType, PartAttr1)), MethodInfo)), DirectCast(GetMethod(PartAttr1.get_PartAttrCode), MethodInfo)), Expression.Constant(&HFFF, GetType(Long)), True, Nothing), GetType(Boolean?))), Expression.Constant(False, GetType(Boolean))), New ParameterExpression() { expression5 }))
            Order By $VB$It.a.PartAttrDesc
            Select $VB$It), Expression.Lambda(Of Func(Of VB$AnonymousType_5(Of PartType, PartAttr1), scPartAttr1))(Expression.MemberInit(Expression.New(DirectCast(GetMethod(scPartAttr1..ctor), ConstructorInfo), DirectCast(Nothing, Expression())), New MemberBinding() { Expression.Bind(DirectCast(GetMethod(scPartAttr1.set_FKPartTypeID), MethodInfo), Expression.Property(Expression.Property(expression7 = Expression.Parameter(GetType(VB$AnonymousType_5(Of PartType, PartAttr1)), "$VB$It"), DirectCast(GetMethod(VB$AnonymousType_5(Of PartType, PartAttr1).get_p, VB$AnonymousType_5(Of PartType, PartAttr1)), MethodInfo)), DirectCast(GetMethod(PartType.get_PartTypeId), MethodInfo))), Expression.Bind(DirectCast(GetMethod(scPartAttr1.set_PKPartAttr1ID), MethodInfo), Expression.Property(Expression.Property(expression7, DirectCast(GetMethod(VB$AnonymousType_5(Of PartType, PartAttr1).get_a, VB$AnonymousType_5(Of PartType, PartAttr1)), MethodInfo)), DirectCast(GetMethod(PartAttr1.get_PartAttr1Id), MethodInfo))), Expression.Bind(DirectCast(GetMethod(scPartAttr1.set_PartAttrDesc), MethodInfo), Expression.Property(Expression.Property(expression7, DirectCast(GetMethod(VB$AnonymousType_5(Of PartType, PartAttr1).get_a, VB$AnonymousType_5(Of PartType, PartAttr1)), MethodInfo)), DirectCast(GetMethod(PartAttr1.get_PartAttrDesc), MethodInfo))), Expression.Bind(DirectCast(GetMethod(scPartAttr1.set_PartAttrCode), MethodInfo), Expression.Property(Expression.Property(expression7, DirectCast(GetMethod(VB$AnonymousType_5(Of PartType, PartAttr1).get_a, VB$AnonymousType_5(Of PartType, PartAttr1)), MethodInfo)), DirectCast(GetMethod(PartAttr1.get_PartAttrCode), MethodInfo))) }), New ParameterExpression() { expression7 }))
        If ((Not source Is Nothing) AndAlso (Queryable.Count(Of scPartAttr1)(source) > 0)) Then
            list = Enumerable.ToList(Of scPartAttr1)(source)
        End If
        entities.Database.Connection.Close
    End Using
    Return list
End Function

-----------------------------------------------------------
Public Function rtnAssocWORequestor() As List(Of scAssociateData)
    Dim list As New List(Of scAssociateData)
    Using entities As SE0085CTEntities1 = New SE0085CTEntities1
        Dim expression As ParameterExpression
        Dim expression2 As ParameterExpression
        entities.Database.Connection.ConnectionString = Me._CTConnection
        Dim source As IQueryable(Of scAssociateData) = Queryable.Select(Of Associate, scAssociateData)(Queryable.Where(Of Associate)(entities.Associates, Expression.Lambda(Of Func(Of Associate, Boolean))(Expression.Coalesce(Expression.GreaterThan(Expression.And(Expression.Property(expression = Expression.Parameter(GetType(Associate), "a"), DirectCast(GetMethod(Associate.get_AssocUserPriv), MethodInfo)), Expression.ConvertChecked(Expression.Constant(&H20, GetType(Long)), GetType(Long?), DirectCast(GetMethod(Long?.op_Implicit, Long?), MethodInfo))), Expression.ConvertChecked(Expression.Constant(0, GetType(Long)), GetType(Long?), DirectCast(GetMethod(Long?.op_Implicit, Long?), MethodInfo)), True, Nothing), Expression.Constant(False, GetType(Boolean))), New ParameterExpression() { expression })), Expression.Lambda(Of Func(Of Associate, scAssociateData))(Expression.MemberInit(Expression.New(DirectCast(GetMethod(scAssociateData..ctor), ConstructorInfo), DirectCast(Nothing, Expression())), New MemberBinding() { Expression.Bind(DirectCast(GetMethod(scAssociateData.set_AssocId), MethodInfo), Expression.Property(expression2 = Expression.Parameter(GetType(Associate), "a"), DirectCast(GetMethod(Associate.get_AssocId), MethodInfo))), Expression.Bind(DirectCast(GetMethod(scAssociateData.set_AssocEmpId), MethodInfo), Expression.Property(expression2, DirectCast(GetMethod(Associate.get_AssocEmpId), MethodInfo))), Expression.Bind(DirectCast(GetMethod(scAssociateData.set_AssocLaborName), MethodInfo), Expression.Property(expression2, DirectCast(GetMethod(Associate.get_AssocLaborName), MethodInfo))), Expression.Bind(DirectCast(GetMethod(scAssociateData.set_AssocFirstName), MethodInfo), Expression.Property(expression2, DirectCast(GetMethod(Associate.get_AssocFirstName), MethodInfo))), Expression.Bind(DirectCast(GetMethod(scAssociateData.set_AssocLastName), MethodInfo), Expression.Property(expression2, DirectCast(GetMethod(Associate.get_AssocLastName), MethodInfo))), Expression.Bind(DirectCast(GetMethod(scAssociateData.set_AssocLogin), MethodInfo), Expression.Property(expression2, DirectCast(GetMethod(Associate.get_AssocLogin), MethodInfo))), Expression.Bind(DirectCast(GetMethod(scAssociateData.set_AssocSESA), MethodInfo), Expression.Property(expression2, DirectCast(GetMethod(Associate.get_AssocSESA), MethodInfo))), Expression.Bind(DirectCast(GetMethod(scAssociateData.set_AssocEmail), MethodInfo), Expression.Property(expression2, DirectCast(GetMethod(Associate.get_AssocEmail), MethodInfo))), Expression.Bind(DirectCast(GetMethod(scAssociateData.set_AssocQCInsp), MethodInfo), Expression.Convert(Expression.Property(expression2, DirectCast(GetMethod(Associate.get_AssocQCInsp), MethodInfo)), GetType(Boolean))), Expression.Bind(DirectCast(GetMethod(scAssociateData.set_AssocUserPriv), MethodInfo), Expression.ConvertChecked(Expression.Property(expression2, DirectCast(GetMethod(Associate.get_AssocUserPriv), MethodInfo)), GetType(Long))), Expression.Bind(DirectCast(GetMethod(scAssociateData.set_AssocPhone), MethodInfo), Expression.Property(expression2, DirectCast(GetMethod(Associate.get_AssocPhone), MethodInfo))), Expression.Bind(DirectCast(GetMethod(scAssociateData.set_AssocExt), MethodInfo), Expression.Property(expression2, DirectCast(GetMethod(Associate.get_AssocExt), MethodInfo))), Expression.Bind(DirectCast(GetMethod(scAssociateData.set_AssocActive), MethodInfo), Expression.Convert(Expression.Property(expression2, DirectCast(GetMethod(Associate.get_AssocActive), MethodInfo)), GetType(Boolean))) }), New ParameterExpression() { expression2 }))
        If (Queryable.Count(Of scAssociateData)(source) > 0) Then
            list = Enumerable.ToList(Of scAssociateData)(source)
        End If
        entities.Database.Connection.Close
    End Using
    Return list
End Function

 


 
