// Decompiled with JetBrains decompiler
// Type: SE0085.CTdB.clsLaborVouchers
// Assembly: SE0085CTdB, Version=1.0.0.1, Culture=neutral, PublicKeyToken=null
// MVID: F67560B6-58CB-4471-AAC9-80007CA3AF52
// Assembly location: C:\Users\Abishek\Downloads\SchneiderCode_Breaker_09292016\Breaker Schedule-20160930T014118Z\Breaker Schedule\Solution for gathering Breaker Data\DMS\bin\Debug\SE0085CTdB.dll

using Microsoft.Office.Interop.Excel;
using Microsoft.VisualBasic;
using Microsoft.VisualBasic.CompilerServices;
using SE0085.dBc;
using SE0085.StCl;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Data;
using System.Data.Odbc;
using System.Linq;
using System.Linq.Expressions;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Threading;

namespace SE0085.CTdB
{
  public class clsLaborVouchers
  {
    private string _CTConnection;
    private scLevels _Plant;
    private scLevels _AssemblyLine;
    private clsLogWriter lcLogWriter;

    public clsLaborVouchers(scLevels Plant, scLevels AssemblyLine)
    {
      this.lcLogWriter = new clsLogWriter("C:\\MESdata\\LaborImport.log");
      this.GetdBConnString();
      this._Plant = Plant;
      this._AssemblyLine = AssemblyLine;
    }

    ~clsLaborVouchers()
    {
      try
      {
        this.lcLogWriter.logClose();
        this.lcLogWriter = (clsLogWriter) null;
      }
      catch (Exception ex)
      {
        ProjectData.SetProjectError(ex);
        ProjectData.ClearProjectError();
      }
      // ISSUE: explicit finalizer call
      base.Finalize();
    }

    private void GetdBConnString()
    {
      clsDBC clsDbc = new clsDBC();
      clsDbc.GetServer((object) "SE0085CTEntities1");
      this._CTConnection = Conversions.ToString(clsDbc.ConnectionString);
    }

    public List<scLaborVouchersInfo> getLaborForSections(int SectionId, string Workcenter)
    {
      // ISSUE: object of a compiler-generated type is created
      // ISSUE: variable of a compiler-generated type
      clsLaborVouchers._Closure\u0024__88 closure88 = new clsLaborVouchers._Closure\u0024__88();
      List<scLaborVouchersInfo> laborVouchersInfoList = new List<scLaborVouchersInfo>();
      // ISSUE: reference to a compiler-generated field
      closure88.\u0024VB\u0024Local_ldWorkCenter = Workcenter;
      // ISSUE: reference to a compiler-generated field
      closure88.\u0024VB\u0024Local_ldSectionId = SectionId;
      using (SE0085CTEntities1 se0085CtEntities1 = new SE0085CTEntities1())
      {
        se0085CtEntities1.Database.Connection.ConnectionString = this._CTConnection;
        ParameterExpression parameterExpression1;
        ParameterExpression parameterExpression2;
        // ISSUE: method reference
        // ISSUE: type reference
        // ISSUE: method reference
        // ISSUE: field reference
        // ISSUE: method reference
        // ISSUE: method reference
        // ISSUE: type reference
        // ISSUE: method reference
        // ISSUE: field reference
        // ISSUE: method reference
        // ISSUE: method reference
        // ISSUE: type reference
        // ISSUE: method reference
        // ISSUE: field reference
        // ISSUE: method reference
        // ISSUE: method reference
        // ISSUE: method reference
        // ISSUE: type reference
        // ISSUE: method reference
        // ISSUE: method reference
        // ISSUE: method reference
        // ISSUE: type reference
        // ISSUE: method reference
        // ISSUE: method reference
        // ISSUE: method reference
        // ISSUE: type reference
        // ISSUE: method reference
        // ISSUE: method reference
        // ISSUE: method reference
        // ISSUE: type reference
        // ISSUE: method reference
        // ISSUE: method reference
        // ISSUE: method reference
        // ISSUE: type reference
        // ISSUE: method reference
        // ISSUE: method reference
        // ISSUE: method reference
        // ISSUE: type reference
        // ISSUE: method reference
        IQueryable<scLaborVouchersInfo> source = (IQueryable<scLaborVouchersInfo>) Queryable.Select(Queryable.Where((IQueryable<M0>) Queryable.Join((IQueryable<M0>) Queryable.Join((IQueryable<M0>) Queryable.Join((IQueryable<M0>) Queryable.Join((IQueryable<M0>) Queryable.Join((IQueryable<M0>) se0085CtEntities1.SEPlants, (IEnumerable<M1>) se0085CtEntities1.AssemblyLines, (Expression<Func<M0, M2>>) (pl => pl.SEPlantId), (Expression<Func<M1, M2>>) (al => al.SEPlant.SEPlantId), (Expression<Func<M0, M1, M3>>) ((pl, al) => new{ pl = pl, al = al })), (IEnumerable<M1>) se0085CtEntities1.OrderLines, (Expression<Func<M0, M2>>) (data => data.al.AssemLineId), (Expression<Func<M1, M2>>) (ol => ol.AssemblyLine.AssemLineId), (Expression<Func<M0, M1, M3>>) ((data, ol) => new
        {
          \u0024VB\u0024It1 = data,
          ol = ol
        })), (IEnumerable<M1>) se0085CtEntities1.OrdSections, (Expression<Func<M0, M2>>) (data => data.ol.OrderLineId), (Expression<Func<M1, M2>>) (sc => sc.OrderLine.OrderLineId), (Expression<Func<M0, M1, M3>>) ((data, sc) => new
        {
          \u0024VB\u0024It1 = data,
          sc = sc
        })), (IEnumerable<M1>) se0085CtEntities1.SectionsRoutings, (Expression<Func<M0, M2>>) (data => data.sc.OrdSectsId), (Expression<Func<M1, M2>>) (rt => rt.OrdSection.OrdSectsId), (Expression<Func<M0, M1, M3>>) ((data, rt) => new
        {
          \u0024VB\u0024It1 = data,
          rt = rt
        })), (IEnumerable<M1>) se0085CtEntities1.LaborVouchers, (Expression<Func<M0, M2>>) (data => data.rt.RoutingId), (Expression<Func<M1, M2>>) (la => la.SectionsRouting.RoutingId), (Expression<Func<M0, M1, M3>>) ((data, la) => new
        {
          pl = data.\u0024VB\u0024It1.\u0024VB\u0024It1.\u0024VB\u0024It1.pl,
          al = data.\u0024VB\u0024It1.\u0024VB\u0024It1.\u0024VB\u0024It1.al,
          ol = data.\u0024VB\u0024It1.\u0024VB\u0024It1.ol,
          sc = data.\u0024VB\u0024It1.sc,
          rt = data.rt,
          la = la
        })), (Expression<Func<M0, bool>>) Expression.Lambda<Func<VB\u0024AnonymousType_37<SEPlant, AssemblyLine, OrderLine, OrdSection, SectionsRouting, LaborVoucher>, bool>>((Expression) Expression.And((Expression) Expression.And((Expression) Expression.And((Expression) Expression.Equal(\u0024VB\u0024It.pl.SEPlantId, this._Plant.LevelId, true, (MethodInfo) null), (Expression) Expression.Equal((Expression) Expression.Property((Expression) Expression.Property((Expression) parameterExpression1, (MethodInfo) MethodBase.GetMethodFromHandle(__methodref (VB\u0024AnonymousType_37<SEPlant, AssemblyLine, OrderLine, OrdSection, SectionsRouting, LaborVoucher>.get_al), __typeref (VB\u0024AnonymousType_37<SEPlant, AssemblyLine, OrderLine, OrdSection, SectionsRouting, LaborVoucher>))), (MethodInfo) MethodBase.GetMethodFromHandle(__methodref (AssemblyLine.get_AssemLineId))), (Expression) Expression.Property((Expression) Expression.Field((Expression) Expression.Constant((object) this, typeof (clsLaborVouchers)), FieldInfo.GetFieldFromHandle(__fieldref (clsLaborVouchers._AssemblyLine))), (MethodInfo) MethodBase.GetMethodFromHandle(__methodref (scLevels.get_LevelId))), true, (MethodInfo) null)), (Expression) Expression.Equal((Expression) Expression.Property((Expression) Expression.Property((Expression) parameterExpression1, (MethodInfo) MethodBase.GetMethodFromHandle(__methodref (VB\u0024AnonymousType_37<SEPlant, AssemblyLine, OrderLine, OrdSection, SectionsRouting, LaborVoucher>.get_sc), __typeref (VB\u0024AnonymousType_37<SEPlant, AssemblyLine, OrderLine, OrdSection, SectionsRouting, LaborVoucher>))), (MethodInfo) MethodBase.GetMethodFromHandle(__methodref (OrdSection.get_OrdSectsId))), (Expression) Expression.Field((Expression) Expression.Constant((object) closure88, typeof (clsLaborVouchers._Closure\u0024__88)), FieldInfo.GetFieldFromHandle(__fieldref (clsLaborVouchers._Closure\u0024__88.\u0024VB\u0024Local_ldSectionId))), true, (MethodInfo) null)), (Expression) Expression.Equal((Expression) Expression.Call((Expression) null, (MethodInfo) MethodBase.GetMethodFromHandle(__methodref (Microsoft.VisualBasic.CompilerServices.Operators.CompareString)), (Expression) Expression.Property((Expression) Expression.Property((Expression) parameterExpression1, (MethodInfo) MethodBase.GetMethodFromHandle(__methodref (VB\u0024AnonymousType_37<SEPlant, AssemblyLine, OrderLine, OrdSection, SectionsRouting, LaborVoucher>.get_rt), __typeref (VB\u0024AnonymousType_37<SEPlant, AssemblyLine, OrderLine, OrdSection, SectionsRouting, LaborVoucher>))), (MethodInfo) MethodBase.GetMethodFromHandle(__methodref (SectionsRouting.get_RoutingWorkCenter))), (Expression) Expression.Field((Expression) Expression.Constant((object) closure88, typeof (clsLaborVouchers._Closure\u0024__88)), FieldInfo.GetFieldFromHandle(__fieldref (clsLaborVouchers._Closure\u0024__88.\u0024VB\u0024Local_ldWorkCenter))), (Expression) Expression.Constant((object) false, typeof (bool))), (Expression) Expression.Constant((object) 0, typeof (int)))), new ParameterExpression[1]
        {
          parameterExpression1
        })), (Expression<Func<M0, M1>>) Expression.Lambda<Func<VB\u0024AnonymousType_37<SEPlant, AssemblyLine, OrderLine, OrdSection, SectionsRouting, LaborVoucher>, scLaborVouchersInfo>>((Expression) Expression.MemberInit(Expression.New((ConstructorInfo) MethodBase.GetMethodFromHandle(__methodref (scLaborVouchersInfo.\u002Ector)), (Expression[]) null), (MemberBinding) Expression.Bind((MethodInfo) MethodBase.GetMethodFromHandle(__methodref (scLaborVouchersInfo.set_LaborVohId)), (Expression) Expression.Property((Expression) Expression.Property((Expression) parameterExpression2, (MethodInfo) MethodBase.GetMethodFromHandle(__methodref (VB\u0024AnonymousType_37<SEPlant, AssemblyLine, OrderLine, OrdSection, SectionsRouting, LaborVoucher>.get_la), __typeref (VB\u0024AnonymousType_37<SEPlant, AssemblyLine, OrderLine, OrdSection, SectionsRouting, LaborVoucher>))), (MethodInfo) MethodBase.GetMethodFromHandle(__methodref (LaborVoucher.get_LaborVohId)))), (MemberBinding) Expression.Bind((MethodInfo) MethodBase.GetMethodFromHandle(__methodref (scLaborVouchersInfo.set_LaborVohOperId)), (Expression) Expression.Property((Expression) Expression.Property((Expression) parameterExpression2, (MethodInfo) MethodBase.GetMethodFromHandle(__methodref (VB\u0024AnonymousType_37<SEPlant, AssemblyLine, OrderLine, OrdSection, SectionsRouting, LaborVoucher>.get_la), __typeref (VB\u0024AnonymousType_37<SEPlant, AssemblyLine, OrderLine, OrdSection, SectionsRouting, LaborVoucher>))), (MethodInfo) MethodBase.GetMethodFromHandle(__methodref (LaborVoucher.get_LaborVohOperId)))), (MemberBinding) Expression.Bind((MethodInfo) MethodBase.GetMethodFromHandle(__methodref (scLaborVouchersInfo.set_LaborVohStartDt)), (Expression) Expression.Convert((Expression) Expression.Property((Expression) Expression.Property((Expression) parameterExpression2, (MethodInfo) MethodBase.GetMethodFromHandle(__methodref (VB\u0024AnonymousType_37<SEPlant, AssemblyLine, OrderLine, OrdSection, SectionsRouting, LaborVoucher>.get_la), __typeref (VB\u0024AnonymousType_37<SEPlant, AssemblyLine, OrderLine, OrdSection, SectionsRouting, LaborVoucher>))), (MethodInfo) MethodBase.GetMethodFromHandle(__methodref (LaborVoucher.get_LaborVohStartDt))), typeof (DateTime))), (MemberBinding) Expression.Bind((MethodInfo) MethodBase.GetMethodFromHandle(__methodref (scLaborVouchersInfo.set_LaborVohEndDt)), (Expression) Expression.Convert((Expression) Expression.Property((Expression) Expression.Property((Expression) parameterExpression2, (MethodInfo) MethodBase.GetMethodFromHandle(__methodref (VB\u0024AnonymousType_37<SEPlant, AssemblyLine, OrderLine, OrdSection, SectionsRouting, LaborVoucher>.get_la), __typeref (VB\u0024AnonymousType_37<SEPlant, AssemblyLine, OrderLine, OrdSection, SectionsRouting, LaborVoucher>))), (MethodInfo) MethodBase.GetMethodFromHandle(__methodref (LaborVoucher.get_LaborVohEndDt))), typeof (DateTime))), (MemberBinding) Expression.Bind((MethodInfo) MethodBase.GetMethodFromHandle(__methodref (scLaborVouchersInfo.set_LaborVohStandardMin)), (Expression) Expression.ConvertChecked((Expression) Expression.Property((Expression) Expression.Property((Expression) parameterExpression2, (MethodInfo) MethodBase.GetMethodFromHandle(__methodref (VB\u0024AnonymousType_37<SEPlant, AssemblyLine, OrderLine, OrdSection, SectionsRouting, LaborVoucher>.get_la), __typeref (VB\u0024AnonymousType_37<SEPlant, AssemblyLine, OrderLine, OrdSection, SectionsRouting, LaborVoucher>))), (MethodInfo) MethodBase.GetMethodFromHandle(__methodref (LaborVoucher.get_LaborVohStandardMin))), typeof (int))), (MemberBinding) Expression.Bind((MethodInfo) MethodBase.GetMethodFromHandle(__methodref (scLaborVouchersInfo.set_LaborVohActualMin)), (Expression) Expression.ConvertChecked((Expression) Expression.Property((Expression) Expression.Property((Expression) parameterExpression2, (MethodInfo) MethodBase.GetMethodFromHandle(__methodref (VB\u0024AnonymousType_37<SEPlant, AssemblyLine, OrderLine, OrdSection, SectionsRouting, LaborVoucher>.get_la), __typeref (VB\u0024AnonymousType_37<SEPlant, AssemblyLine, OrderLine, OrdSection, SectionsRouting, LaborVoucher>))), (MethodInfo) MethodBase.GetMethodFromHandle(__methodref (LaborVoucher.get_LaborVohActualMin))), typeof (int)))), new ParameterExpression[1]
        {
          parameterExpression2
        }));
        if (source.Count<scLaborVouchersInfo>() > 0)
          laborVouchersInfoList = source.ToList<scLaborVouchersInfo>();
        se0085CtEntities1.Database.Connection.Close();
      }
      return laborVouchersInfoList;
    }

    public List<scLaborData> ImportLaborData(string ImportFilename)
    {
      // ISSUE: variable of a compiler-generated type
      Application instance = (Application) Activator.CreateInstance(Type.GetTypeFromCLSID(new Guid("00024500-0000-0000-C000-000000000046")));
      // ISSUE: reference to a compiler-generated method
      // ISSUE: variable of a compiler-generated type
      Workbook workbook = instance.Workbooks.Open(ImportFilename, (object) Missing.Value, (object) Missing.Value, (object) Missing.Value, (object) Missing.Value, (object) Missing.Value, (object) Missing.Value, (object) Missing.Value, (object) Missing.Value, (object) Missing.Value, (object) Missing.Value, (object) Missing.Value, (object) Missing.Value, (object) Missing.Value, (object) Missing.Value);
      // ISSUE: reference to a compiler-generated method
      // ISSUE: variable of a compiler-generated type
      Worksheet worksheet = (Worksheet) workbook.Worksheets.get_Item((object) 1);
      // ISSUE: variable of a compiler-generated type
      Microsoft.Office.Interop.Excel.Range cell1 = (Microsoft.Office.Interop.Excel.Range) worksheet.Cells[(object) 1, (object) 8];
      List<scLaborData> scLaborDataList1 = new List<scLaborData>();
      int num1 = 0;
      int num2 = 2;
      int count = worksheet.Rows.Count;
      int num3 = num2;
      while (num3 <= count)
      {
        Thread.CurrentThread.Join(0);
        scLaborData scLaborData = new scLaborData();
        int num4 = 1;
        do
        {
          // ISSUE: variable of a compiler-generated type
          Microsoft.Office.Interop.Excel.Range cell2 = (Microsoft.Office.Interop.Excel.Range) worksheet.Cells[(object) num3, (object) num4];
          // ISSUE: reference to a compiler-generated method
          if (!(num4 == 1 & Microsoft.VisualBasic.Strings.Len(RuntimeHelpers.GetObjectValue(cell2.get_Value((object) Missing.Value))) == 0))
          {
            switch (num4)
            {
              case 1:
                // ISSUE: reference to a compiler-generated method
                string str1 = Conversions.ToString(cell2.get_Value((object) Missing.Value));
                scLaborData.ProductionOrder = str1.Trim();
                switch (Microsoft.VisualBasic.Strings.Len(scLaborData.ProductionOrder))
                {
                  case 1:
                    scLaborData.ProductionOrder = "00000000000" + scLaborData.ProductionOrder;
                    break;
                  case 2:
                    scLaborData.ProductionOrder = "0000000000" + scLaborData.ProductionOrder;
                    break;
                  case 3:
                    scLaborData.ProductionOrder = "000000000" + scLaborData.ProductionOrder;
                    break;
                  case 4:
                    scLaborData.ProductionOrder = "00000000" + scLaborData.ProductionOrder;
                    break;
                  case 5:
                    scLaborData.ProductionOrder = "0000000" + scLaborData.ProductionOrder;
                    break;
                  case 6:
                    scLaborData.ProductionOrder = "000000" + scLaborData.ProductionOrder;
                    break;
                  case 7:
                    scLaborData.ProductionOrder = "00000" + scLaborData.ProductionOrder;
                    break;
                  case 8:
                    scLaborData.ProductionOrder = "00000" + scLaborData.ProductionOrder;
                    break;
                  case 9:
                    scLaborData.ProductionOrder = "0000" + scLaborData.ProductionOrder;
                    break;
                  case 10:
                    scLaborData.ProductionOrder = "00" + scLaborData.ProductionOrder;
                    break;
                  case 11:
                    scLaborData.ProductionOrder = "0" + scLaborData.ProductionOrder;
                    break;
                  case 12:
                    scLaborData.ProductionOrder = scLaborData.ProductionOrder;
                    break;
                }
              case 2:
                // ISSUE: reference to a compiler-generated method
                scLaborData.FactoryOrder = Microsoft.VisualBasic.Strings.Left(Conversions.ToString(cell2.get_Value((object) Missing.Value)), 8);
                // ISSUE: reference to a compiler-generated method
                scLaborData.LineItem = Microsoft.VisualBasic.Strings.Mid(Conversions.ToString(cell2.get_Value((object) Missing.Value)), 10, 3);
                // ISSUE: reference to a compiler-generated method
                scLaborData.SLNumber = Microsoft.VisualBasic.Strings.Mid(Conversions.ToString(cell2.get_Value((object) Missing.Value)), 14, 2);
                // ISSUE: reference to a compiler-generated method
                scLaborData.SSNumber = Microsoft.VisualBasic.Strings.Mid(Conversions.ToString(cell2.get_Value((object) Missing.Value)), 17, 2);
                // ISSUE: reference to a compiler-generated method
                scLaborData.Section = Conversions.ToInteger(Microsoft.VisualBasic.Strings.Mid(Conversions.ToString(cell2.get_Value((object) Missing.Value)), 20, 2));
                break;
              case 3:
                // ISSUE: reference to a compiler-generated method
                string str2 = Conversions.ToString(cell2.get_Value((object) Missing.Value));
                scLaborData.WorkCenter = str2.Trim();
                break;
              case 4:
                // ISSUE: reference to a compiler-generated method
                string str3 = Conversions.ToString(cell2.get_Value((object) Missing.Value));
                scLaborData.OperatorName = str3.Trim();
                break;
              case 5:
                // ISSUE: reference to a compiler-generated method
                string str4 = Conversions.ToString(cell2.get_Value((object) Missing.Value));
                scLaborData.StartDate = Conversions.ToDate(str4.Trim());
                break;
              case 6:
                // ISSUE: reference to a compiler-generated method
                string str5 = Conversions.ToString(cell2.get_Value((object) Missing.Value));
                scLaborData.EndDate = Conversions.ToDate(str5.Trim());
                break;
              case 7:
                // ISSUE: reference to a compiler-generated method
                string str6 = Conversions.ToString(cell2.get_Value((object) Missing.Value));
                scLaborData.ActualTime = Conversions.ToInteger(str6.Trim());
                break;
              case 8:
                // ISSUE: reference to a compiler-generated method
                string str7 = Conversions.ToString(cell2.get_Value((object) Missing.Value));
                scLaborData.StandardTime = Conversions.ToInteger(str7.Trim());
                break;
            }
            checked { ++num4; }
          }
          else
            goto label_27;
        }
        while (num4 <= 8);
        Console.WriteLine();
        Console.Write(scLaborData.ProductionOrder + " ");
        Console.Write(scLaborData.FactoryOrder + "-");
        Console.Write(scLaborData.LineItem + "-");
        Console.Write(scLaborData.SLNumber + "-");
        Console.Write(scLaborData.SSNumber + ":");
        Console.Write(Conversions.ToString(scLaborData.Section) + " ");
        Console.Write(scLaborData.WorkCenter + " ");
        Console.Write(scLaborData.OperatorName + " ");
        Console.Write(Conversions.ToString(scLaborData.StartDate) + " ");
        Console.Write(Conversions.ToString(scLaborData.EndDate) + " ");
        Console.Write(Conversions.ToString(scLaborData.ActualTime) + " ");
        Console.Write(Conversions.ToString(scLaborData.StandardTime) + " ");
        Console.WriteLine();
        scLaborDataList1.Add(scLaborData);
        checked { ++num1; }
        checked { ++num3; }
      }
label_27:
      List<scLaborData> scLaborDataList2 = scLaborDataList1;
      // ISSUE: reference to a compiler-generated method
      workbook.Close((object) Missing.Value, (object) Missing.Value, (object) Missing.Value);
      // ISSUE: reference to a compiler-generated method
      instance.Quit();
      return scLaborDataList2;
    }

    public List<scLaborData> LoadQuickLabor()
    {
      clsRoutings clsRoutings = new clsRoutings(this._Plant, this._AssemblyLine);
      List<scLaborData> scLaborDataList1 = new List<scLaborData>();
      List<scLaborData> scLaborDataList2 = new List<scLaborData>();
      List<scLaborData> scLaborDataList3 = clsRoutings.rtnWIP4QuickLabor(this._Plant, this._AssemblyLine, "x");
      if (scLaborDataList3 == null || scLaborDataList3.Count == 0)
        return (List<scLaborData>) null;
      DataSet dataSet = new DataSet();
      OdbcConnection odbcConnection = new OdbcConnection();
      odbcConnection.ConnectionString = "Driver={Sybase ASE ODBC Driver};NA=mcldb01.m087.us.schneider-electric.com,5000;Database=dbmes;Uid=misuser;Pwd=misuser;";
      OdbcCommand selectCommand = new OdbcCommand();
      selectCommand.Connection = odbcConnection;
      odbcConnection.Open();
      OdbcDataAdapter odbcDataAdapter = new OdbcDataAdapter(selectCommand);
      odbcDataAdapter.SelectCommand.CommandTimeout = 2000;
      string str1 = "SELECT TOP 50 meslabordtl.operator, meslabordtl.strt_dt FROM meslabordtl WHERE meslabordtl.plnt='0085' AND meslabordtl.prdn_ord_nbr=? AND meslabordtl.eto_workctr=? ORDER BY meslabordtl.strt_dt DESC";
      selectCommand.CommandText = str1;
      List<scLaborData>.Enumerator enumerator1;
      try
      {
        enumerator1 = scLaborDataList3.GetEnumerator();
        while (enumerator1.MoveNext())
        {
          scLaborData current1 = enumerator1.Current;
          string productionOrder = current1.ProductionOrder;
          string workCenter = current1.WorkCenter;
          selectCommand.Parameters.Clear();
          string str2 = productionOrder;
          selectCommand.Parameters.AddWithValue("prdn_ord_nbr", (object) str2);
          string str3 = workCenter;
          selectCommand.Parameters.AddWithValue("eto_workctr", (object) str3);
          odbcDataAdapter.SelectCommand = selectCommand;
          dataSet.Tables.Clear();
          odbcDataAdapter.Fill(dataSet);
          List<string> stringList = new List<string>();
          short num;
          try
          {
            foreach (DataColumn column in (InternalDataCollectionBase) dataSet.Tables[0].Columns)
            {
              stringList.Add(column.ColumnName);
              checked { ++num; }
            }
          }
          finally
          {
            IEnumerator enumerator2;
            if (enumerator2 is IDisposable)
              (enumerator2 as IDisposable).Dispose();
          }
          try
          {
            foreach (DataRow row in dataSet.Tables[0].Rows)
            {
              num = (short) 0;
              List<string>.Enumerator enumerator2;
              try
              {
                enumerator2 = stringList.GetEnumerator();
                while (enumerator2.MoveNext())
                {
                  string current2 = enumerator2.Current;
                  Console.WriteLine(Microsoft.VisualBasic.CompilerServices.Operators.ConcatenateObject(Microsoft.VisualBasic.CompilerServices.Operators.ConcatenateObject(Microsoft.VisualBasic.CompilerServices.Operators.ConcatenateObject(Microsoft.VisualBasic.CompilerServices.Operators.ConcatenateObject((object) (Conversions.ToString((int) num) + " - " + current2 + "\t" + "\t" + " "), row[(int) num]), (object) '\t'), (object) '\t'), (object) row[(int) num].GetType().FullName));
                  if (Microsoft.VisualBasic.CompilerServices.Operators.CompareString(current2, "strt_dt", false) == 0)
                    current1.StartDate = Conversions.ToDate(row[(int) num]);
                  else if (Microsoft.VisualBasic.CompilerServices.Operators.CompareString(current2, "operator", false) == 0)
                    current1.OperatorName = Microsoft.VisualBasic.Strings.Trim(Conversions.ToString(row[(int) num]));
                  else if (Microsoft.VisualBasic.CompilerServices.Operators.CompareString(current2, "total_tm", false) == 0)
                    current1.ActualTime = Conversions.ToInteger(row[(int) num]);
                  checked { ++num; }
                }
              }
              finally
              {
                enumerator2.Dispose();
              }
              scLaborDataList2.Add(current1);
            }
          }
          finally
          {
            IEnumerator enumerator2;
            if (enumerator2 is IDisposable)
              (enumerator2 as IDisposable).Dispose();
          }
        }
      }
      finally
      {
        enumerator1.Dispose();
      }
      return scLaborDataList2;
    }

    public void UpdatedBLabor(List<scLaborData> LaborData, bool QuickUpdate = false)
    {
      // ISSUE: object of a compiler-generated type is created
      // ISSUE: variable of a compiler-generated type
      clsLaborVouchers._Closure\u0024__89 closure89 = new clsLaborVouchers._Closure\u0024__89();
      // ISSUE: reference to a compiler-generated field
      closure89.\u0024VB\u0024Local_ldLaborData = new scLaborData();
      using (SE0085CTEntities1 se0085CtEntities1 = new SE0085CTEntities1())
      {
        se0085CtEntities1.Database.Connection.ConnectionString = this._CTConnection;
        List<scLaborData>.Enumerator enumerator1;
        try
        {
          enumerator1 = LaborData.GetEnumerator();
          while (enumerator1.MoveNext())
          {
            scLaborData current1 = enumerator1.Current;
            Thread.CurrentThread.Join(0);
            bool flag1;
            if (current1.OperatorName.Length == 8)
            {
              try
              {
                int integer = Conversions.ToInteger(current1.OperatorName);
                flag1 = integer > 10000000 & integer < 99999999;
              }
              catch (Exception ex)
              {
                ProjectData.SetProjectError(ex);
                flag1 = false;
                ProjectData.ClearProjectError();
              }
            }
            else
              flag1 = false;
            if (!flag1)
            {
              // ISSUE: reference to a compiler-generated field
              closure89.\u0024VB\u0024Local_ldLaborName = Microsoft.VisualBasic.Strings.Trim(current1.OperatorName);
              // ISSUE: method reference
              // ISSUE: reference to a compiler-generated field
              IQueryable<int> source = (IQueryable<int>) Queryable.Select<Associate, int>(Queryable.Where<Associate>((IQueryable<M0>) se0085CtEntities1.Associates, (Expression<Func<M0, bool>>) (ac => Expression.Call((Expression) null, (MethodInfo) MethodBase.GetMethodFromHandle(__methodref (Microsoft.VisualBasic.CompilerServices.Operators.CompareString)), Microsoft.VisualBasic.Strings.Trim(ac.AssocLaborName), closure89.\u0024VB\u0024Local_ldLaborName, false) == 0)), (Expression<Func<M0, M1>>) (ac => ac.AssocEmpId));
              if (source.Count<int>() == 1)
              {
                current1.OperatorName = Conversions.ToString(source.First<int>());
                flag1 = true;
              }
              else
              {
                // ISSUE: reference to a compiler-generated field
                this.lcLogWriter.logData("Operator Id not found; " + closure89.\u0024VB\u0024Local_ldLaborName + " for workcenter " + current1.WorkCenter);
              }
            }
            if (flag1)
            {
              // ISSUE: reference to a compiler-generated field
              closure89.\u0024VB\u0024Local_ldLaborData = current1;
              ParameterExpression parameterExpression;
              // ISSUE: method reference
              // ISSUE: reference to a compiler-generated field
              // ISSUE: method reference
              // ISSUE: reference to a compiler-generated field
              // ISSUE: reference to a compiler-generated field
              // ISSUE: method reference
              // ISSUE: type reference
              // ISSUE: method reference
              // ISSUE: field reference
              // ISSUE: method reference
              // ISSUE: method reference
              IQueryable<LaborVoucher> source1 = (IQueryable<LaborVoucher>) Queryable.Select(Queryable.Where((IQueryable<M0>) Queryable.Join((IQueryable<M0>) Queryable.Join((IQueryable<M0>) se0085CtEntities1.OrdSections, (IEnumerable<M1>) se0085CtEntities1.SectionsRoutings, (Expression<Func<M0, M2>>) (s => s.OrdSectsId), (Expression<Func<M1, M2>>) (r => r.OrdSection.OrdSectsId), (Expression<Func<M0, M1, M3>>) ((s, r) => new{ s = s, r = r })), (IEnumerable<M1>) se0085CtEntities1.LaborVouchers, (Expression<Func<M0, M2>>) (data => data.r.RoutingId), (Expression<Func<M1, M2>>) (l => l.SectionsRouting.RoutingId), (Expression<Func<M0, M1, M3>>) ((data, l) => new
              {
                s = data.s,
                r = data.r,
                l = l
              })), (Expression<Func<M0, bool>>) Expression.Lambda<Func<VB\u0024AnonymousType_39<OrdSection, SectionsRouting, LaborVoucher>, bool>>((Expression) Expression.Coalesce((Expression) Expression.And((Expression) Expression.Convert((Expression) Expression.And(Expression.Call((Expression) null, (MethodInfo) MethodBase.GetMethodFromHandle(__methodref (Microsoft.VisualBasic.CompilerServices.Operators.CompareString)), \u0024VB\u0024It.s.OrdSectsProdNum, closure89.\u0024VB\u0024Local_ldLaborData.ProductionOrder, false) == 0 & Expression.Call((Expression) null, (MethodInfo) MethodBase.GetMethodFromHandle(__methodref (Microsoft.VisualBasic.CompilerServices.Operators.CompareString)), \u0024VB\u0024It.r.RoutingWorkCenter, closure89.\u0024VB\u0024Local_ldLaborData.WorkCenter, false) == 0, (Expression) Expression.Equal((double) \u0024VB\u0024It.l.LaborVohOperId, (double) closure89.\u0024VB\u0024Local_ldLaborData.OperatorName, true, (MethodInfo) null)), typeof (bool?)), (Expression) Expression.Equal((Expression) Expression.Property((Expression) Expression.Property((Expression) parameterExpression, (MethodInfo) MethodBase.GetMethodFromHandle(__methodref (VB\u0024AnonymousType_39<OrdSection, SectionsRouting, LaborVoucher>.get_l), __typeref (VB\u0024AnonymousType_39<OrdSection, SectionsRouting, LaborVoucher>))), (MethodInfo) MethodBase.GetMethodFromHandle(__methodref (LaborVoucher.get_LaborVohStartDt))), (Expression) Expression.Convert((Expression) Expression.Property((Expression) Expression.Field((Expression) Expression.Constant((object) closure89, typeof (clsLaborVouchers._Closure\u0024__89)), FieldInfo.GetFieldFromHandle(__fieldref (clsLaborVouchers._Closure\u0024__89.\u0024VB\u0024Local_ldLaborData))), (MethodInfo) MethodBase.GetMethodFromHandle(__methodref (scLaborData.get_StartDate))), typeof (DateTime?)), true, (MethodInfo) MethodBase.GetMethodFromHandle(__methodref (DateTime.op_Equality)))), (Expression) Expression.Constant((object) false, typeof (bool))), new ParameterExpression[1]
              {
                parameterExpression
              })), (Expression<Func<M0, M1>>) (data => data.l));
              if (source1.Count<LaborVoucher>() == 0)
              {
                // ISSUE: method reference
                // ISSUE: reference to a compiler-generated field
                // ISSUE: method reference
                // ISSUE: reference to a compiler-generated field
                IQueryable<SectionsRouting> source2 = (IQueryable<SectionsRouting>) Queryable.Select(Queryable.Where((IQueryable<M0>) Queryable.Join((IQueryable<M0>) se0085CtEntities1.OrdSections, (IEnumerable<M1>) se0085CtEntities1.SectionsRoutings, (Expression<Func<M0, M2>>) (s => s.OrdSectsId), (Expression<Func<M1, M2>>) (r => r.OrdSection.OrdSectsId), (Expression<Func<M0, M1, M3>>) ((s, r) => new{ s = s, r = r })), (Expression<Func<M0, bool>>) (data => Expression.Call((Expression) null, (MethodInfo) MethodBase.GetMethodFromHandle(__methodref (Microsoft.VisualBasic.CompilerServices.Operators.CompareString)), data.s.OrdSectsProdNum, closure89.\u0024VB\u0024Local_ldLaborData.ProductionOrder, false) == 0 & Expression.Call((Expression) null, (MethodInfo) MethodBase.GetMethodFromHandle(__methodref (Microsoft.VisualBasic.CompilerServices.Operators.CompareString)), data.r.RoutingWorkCenter, closure89.\u0024VB\u0024Local_ldLaborData.WorkCenter, false) == 0)), (Expression<Func<M0, M1>>) (data => data.r));
                if (source2.Count<SectionsRouting>() != 0 && source2.Count<SectionsRouting>() == 1)
                {
                  SectionsRouting sectionsRouting = (SectionsRouting) null;
                  try
                  {
                    sectionsRouting = source2.First<SectionsRouting>();
                  }
                  catch (Exception ex)
                  {
                    ProjectData.SetProjectError(ex);
                    // ISSUE: reference to a compiler-generated field
                    // ISSUE: reference to a compiler-generated field
                    int num = (int) Interaction.MsgBox((object) ("Error importing data, aborting MES import for production order; " + closure89.\u0024VB\u0024Local_ldLaborData.ProductionOrder + " and Workcenter; " + closure89.\u0024VB\u0024Local_ldLaborData.WorkCenter), MsgBoxStyle.Information, (object) "ONE QMS MES Import Error - E0001");
                    ProjectData.ClearProjectError();
                  }
                  sectionsRouting.LaborVouchers.Add(new LaborVoucher()
                  {
                    LaborVohOperId = Conversions.ToInteger(current1.OperatorName),
                    LaborVohStartDt = (DateTime?) current1.StartDate,
                    LaborVohEndDt = (DateTime?) current1.EndDate,
                    LaborVohActualMin = (int?) current1.ActualTime,
                    LaborVohStandardMin = (int?) current1.StandardTime
                  });
                  se0085CtEntities1.SaveChanges();
                }
              }
              else if (source1.Count<LaborVoucher>() == 1)
              {
                if (!QuickUpdate)
                {
                  IEnumerator<LaborVoucher> enumerator2;
                  bool flag2;
                  try
                  {
                    enumerator2 = source1.GetEnumerator();
                    while (enumerator2.MoveNext())
                    {
                      LaborVoucher current2 = enumerator2.Current;
                      DateTime endDate = current1.EndDate;
                      DateTime? laborVohEndDt = current2.LaborVohEndDt;
                      bool? nullable1 = laborVohEndDt.HasValue ? new bool?(DateTime.Compare(laborVohEndDt.GetValueOrDefault(), endDate) == 0) : new bool?();
                      int standardTime = current1.StandardTime;
                      int? laborVohStandardMin = current2.LaborVohStandardMin;
                      bool? nullable2 = laborVohStandardMin.HasValue ? new bool?(laborVohStandardMin.GetValueOrDefault() == standardTime) : new bool?();
                      bool? nullable3 = !nullable1.HasValue || nullable1.GetValueOrDefault() ? (nullable2.HasValue ? (nullable2.GetValueOrDefault() ? nullable1 : new bool?(false)) : new bool?()) : new bool?(false);
                      int actualTime = current1.ActualTime;
                      int? laborVohActualMin = current2.LaborVohActualMin;
                      bool? nullable4 = laborVohActualMin.HasValue ? new bool?(laborVohActualMin.GetValueOrDefault() == actualTime) : new bool?();
                      bool? nullable5 = !nullable3.HasValue || nullable3.GetValueOrDefault() ? (nullable4.HasValue ? (nullable4.GetValueOrDefault() ? nullable3 : new bool?(false)) : new bool?()) : new bool?(false);
                      if ((nullable5.HasValue ? new bool?(!nullable5.GetValueOrDefault()) : new bool?()).GetValueOrDefault())
                      {
                        current2.LaborVohEndDt = (DateTime?) current1.EndDate;
                        current2.LaborVohStandardMin = (int?) current1.StandardTime;
                        current2.LaborVohActualMin = (int?) current1.ActualTime;
                        flag2 = true;
                      }
                    }
                  }
                  finally
                  {
                    if (enumerator2 != null)
                      enumerator2.Dispose();
                  }
                  if (flag2)
                  {
                    se0085CtEntities1.SaveChanges();
                    flag2 = false;
                  }
                }
              }
              else
              {
                int num1 = (int) Interaction.MsgBox((object) ("Error importing data, aborting MES import for production order; " + current1.ProductionOrder + " and Workcenter; " + current1.WorkCenter), MsgBoxStyle.Information, (object) "ONE QMS MES Import Error - E0001");
              }
            }
          }
        }
        finally
        {
          enumerator1.Dispose();
        }
        se0085CtEntities1.Database.Connection.Close();
      }
    }

    public scLaborData rtnCurrentWCPlusLabor(int SectionId)
    {
      // ISSUE: object of a compiler-generated type is created
      // ISSUE: variable of a compiler-generated type
      clsLaborVouchers._Closure\u0024__90 closure90 = new clsLaborVouchers._Closure\u0024__90();
      scLaborData scLaborData = new scLaborData();
      // ISSUE: reference to a compiler-generated field
      closure90.\u0024VB\u0024Local_ldLaborBuild = new scLaborData();
      // ISSUE: reference to a compiler-generated field
      closure90.\u0024VB\u0024Local_ldWorkCenter = "";
      // ISSUE: reference to a compiler-generated field
      closure90.\u0024VB\u0024Local_ldSectionId = SectionId;
      using (SE0085CTEntities1 se0085CtEntities1 = new SE0085CTEntities1())
      {
        se0085CtEntities1.Database.Connection.ConnectionString = this._CTConnection;
        ParameterExpression parameterExpression1;
        // ISSUE: reference to a compiler-generated field
        IQueryable<string> source1 = (IQueryable<string>) Queryable.Select<OrdSection, string>(Queryable.Where<OrdSection>((IQueryable<M0>) se0085CtEntities1.OrdSections, (Expression<Func<M0, bool>>) Expression.Lambda<Func<OrdSection, bool>>((Expression) Expression.Equal(sc.OrdSectsId, closure90.\u0024VB\u0024Local_ldSectionId, true, (MethodInfo) null), new ParameterExpression[1]
        {
          parameterExpression1
        })), (Expression<Func<M0, M1>>) (sc => sc.OrdSectsCurrWorkCtr));
        if (source1.Count<string>() == 1)
        {
          // ISSUE: reference to a compiler-generated field
          closure90.\u0024VB\u0024Local_ldWorkCenter = source1.First<string>();
          ParameterExpression parameterExpression2;
          ParameterExpression parameterExpression3;
          // ISSUE: reference to a compiler-generated field
          // ISSUE: method reference
          // ISSUE: method reference
          // ISSUE: type reference
          // ISSUE: method reference
          // ISSUE: field reference
          // ISSUE: method reference
          // ISSUE: method reference
          // ISSUE: method reference
          // ISSUE: type reference
          // ISSUE: method reference
          // ISSUE: method reference
          // ISSUE: method reference
          // ISSUE: type reference
          // ISSUE: method reference
          // ISSUE: method reference
          // ISSUE: method reference
          // ISSUE: type reference
          // ISSUE: method reference
          // ISSUE: method reference
          // ISSUE: method reference
          // ISSUE: type reference
          // ISSUE: method reference
          // ISSUE: method reference
          // ISSUE: method reference
          // ISSUE: type reference
          // ISSUE: method reference
          // ISSUE: method reference
          // ISSUE: method reference
          // ISSUE: type reference
          // ISSUE: method reference
          // ISSUE: method reference
          // ISSUE: method reference
          // ISSUE: type reference
          // ISSUE: method reference
          IQueryable<scLaborData> source2 = (IQueryable<scLaborData>) Queryable.Select(Queryable.Where((IQueryable<M0>) Queryable.Join((IQueryable<M0>) Queryable.Join((IQueryable<M0>) Queryable.Join((IQueryable<M0>) se0085CtEntities1.OrdSections, (IEnumerable<M1>) se0085CtEntities1.SectionsRoutings, (Expression<Func<M0, M2>>) (sc => sc.OrdSectsId), (Expression<Func<M1, M2>>) (rt => rt.OrdSection.OrdSectsId), (Expression<Func<M0, M1, M3>>) ((sc, rt) => new{ sc = sc, rt = rt })), (IEnumerable<M1>) se0085CtEntities1.OrderLines, (Expression<Func<M0, M2>>) (data => data.sc.OrderLine.OrderLineId), (Expression<Func<M1, M2>>) (ol => ol.OrderLineId), (Expression<Func<M0, M1, M3>>) ((data, ol) => new
          {
            \u0024VB\u0024It1 = data,
            ol = ol
          })), (IEnumerable<M1>) se0085CtEntities1.SEOrders, (Expression<Func<M0, M2>>) (data => data.ol.SEOrder.OrderId), (Expression<Func<M1, M2>>) (so => so.OrderId), (Expression<Func<M0, M1, M3>>) ((data, so) => new
          {
            sc = data.\u0024VB\u0024It1.sc,
            rt = data.\u0024VB\u0024It1.rt,
            ol = data.ol,
            so = so
          })), (Expression<Func<M0, bool>>) Expression.Lambda<Func<VB\u0024AnonymousType_40<OrdSection, SectionsRouting, OrderLine, SEOrder>, bool>>((Expression) Expression.And((Expression) Expression.Equal(\u0024VB\u0024It.sc.OrdSectsId, closure90.\u0024VB\u0024Local_ldSectionId, true, (MethodInfo) null), (Expression) Expression.Equal((Expression) Expression.Call((Expression) null, (MethodInfo) MethodBase.GetMethodFromHandle(__methodref (Microsoft.VisualBasic.CompilerServices.Operators.CompareString)), (Expression) Expression.Property((Expression) Expression.Property((Expression) parameterExpression2, (MethodInfo) MethodBase.GetMethodFromHandle(__methodref (VB\u0024AnonymousType_40<OrdSection, SectionsRouting, OrderLine, SEOrder>.get_rt), __typeref (VB\u0024AnonymousType_40<OrdSection, SectionsRouting, OrderLine, SEOrder>))), (MethodInfo) MethodBase.GetMethodFromHandle(__methodref (SectionsRouting.get_RoutingWorkCenter))), (Expression) Expression.Field((Expression) Expression.Constant((object) closure90, typeof (clsLaborVouchers._Closure\u0024__90)), FieldInfo.GetFieldFromHandle(__fieldref (clsLaborVouchers._Closure\u0024__90.\u0024VB\u0024Local_ldWorkCenter))), (Expression) Expression.Constant((object) false, typeof (bool))), (Expression) Expression.Constant((object) 0, typeof (int)))), new ParameterExpression[1]
          {
            parameterExpression2
          })), (Expression<Func<M0, M1>>) Expression.Lambda<Func<VB\u0024AnonymousType_40<OrdSection, SectionsRouting, OrderLine, SEOrder>, scLaborData>>((Expression) Expression.MemberInit(Expression.New((ConstructorInfo) MethodBase.GetMethodFromHandle(__methodref (scLaborData.\u002Ector)), (Expression[]) null), (MemberBinding) Expression.Bind((MethodInfo) MethodBase.GetMethodFromHandle(__methodref (scLaborData.set_Section)), (Expression) Expression.Property((Expression) Expression.Property((Expression) parameterExpression3, (MethodInfo) MethodBase.GetMethodFromHandle(__methodref (VB\u0024AnonymousType_40<OrdSection, SectionsRouting, OrderLine, SEOrder>.get_sc), __typeref (VB\u0024AnonymousType_40<OrdSection, SectionsRouting, OrderLine, SEOrder>))), (MethodInfo) MethodBase.GetMethodFromHandle(__methodref (OrdSection.get_OrdSectsNum)))), (MemberBinding) Expression.Bind((MethodInfo) MethodBase.GetMethodFromHandle(__methodref (scLaborData.set_ProductionOrder)), (Expression) Expression.Property((Expression) Expression.Property((Expression) parameterExpression3, (MethodInfo) MethodBase.GetMethodFromHandle(__methodref (VB\u0024AnonymousType_40<OrdSection, SectionsRouting, OrderLine, SEOrder>.get_sc), __typeref (VB\u0024AnonymousType_40<OrdSection, SectionsRouting, OrderLine, SEOrder>))), (MethodInfo) MethodBase.GetMethodFromHandle(__methodref (OrdSection.get_OrdSectsProdNum)))), (MemberBinding) Expression.Bind((MethodInfo) MethodBase.GetMethodFromHandle(__methodref (scLaborData.set_LineItem)), (Expression) Expression.Property((Expression) Expression.Property((Expression) parameterExpression3, (MethodInfo) MethodBase.GetMethodFromHandle(__methodref (VB\u0024AnonymousType_40<OrdSection, SectionsRouting, OrderLine, SEOrder>.get_ol), __typeref (VB\u0024AnonymousType_40<OrdSection, SectionsRouting, OrderLine, SEOrder>))), (MethodInfo) MethodBase.GetMethodFromHandle(__methodref (OrderLine.get_OrderLineNum)))), (MemberBinding) Expression.Bind((MethodInfo) MethodBase.GetMethodFromHandle(__methodref (scLaborData.set_SLNumber)), (Expression) Expression.Property((Expression) Expression.Property((Expression) parameterExpression3, (MethodInfo) MethodBase.GetMethodFromHandle(__methodref (VB\u0024AnonymousType_40<OrdSection, SectionsRouting, OrderLine, SEOrder>.get_ol), __typeref (VB\u0024AnonymousType_40<OrdSection, SectionsRouting, OrderLine, SEOrder>))), (MethodInfo) MethodBase.GetMethodFromHandle(__methodref (OrderLine.get_OrderLineSL)))), (MemberBinding) Expression.Bind((MethodInfo) MethodBase.GetMethodFromHandle(__methodref (scLaborData.set_SSNumber)), (Expression) Expression.Property((Expression) Expression.Property((Expression) parameterExpression3, (MethodInfo) MethodBase.GetMethodFromHandle(__methodref (VB\u0024AnonymousType_40<OrdSection, SectionsRouting, OrderLine, SEOrder>.get_ol), __typeref (VB\u0024AnonymousType_40<OrdSection, SectionsRouting, OrderLine, SEOrder>))), (MethodInfo) MethodBase.GetMethodFromHandle(__methodref (OrderLine.get_OrderLineSS)))), (MemberBinding) Expression.Bind((MethodInfo) MethodBase.GetMethodFromHandle(__methodref (scLaborData.set_FactoryOrder)), (Expression) Expression.Property((Expression) Expression.Property((Expression) parameterExpression3, (MethodInfo) MethodBase.GetMethodFromHandle(__methodref (VB\u0024AnonymousType_40<OrdSection, SectionsRouting, OrderLine, SEOrder>.get_so), __typeref (VB\u0024AnonymousType_40<OrdSection, SectionsRouting, OrderLine, SEOrder>))), (MethodInfo) MethodBase.GetMethodFromHandle(__methodref (SEOrder.get_OrderFO)))), (MemberBinding) Expression.Bind((MethodInfo) MethodBase.GetMethodFromHandle(__methodref (scLaborData.set_WorkCenter)), (Expression) Expression.Property((Expression) Expression.Property((Expression) parameterExpression3, (MethodInfo) MethodBase.GetMethodFromHandle(__methodref (VB\u0024AnonymousType_40<OrdSection, SectionsRouting, OrderLine, SEOrder>.get_sc), __typeref (VB\u0024AnonymousType_40<OrdSection, SectionsRouting, OrderLine, SEOrder>))), (MethodInfo) MethodBase.GetMethodFromHandle(__methodref (OrdSection.get_OrdSectsCurrWorkCtr))))), new ParameterExpression[1]
          {
            parameterExpression3
          }));
          if (source2.Count<scLaborData>() == 1)
          {
            scLaborData = source2.First<scLaborData>();
            ParameterExpression parameterExpression4;
            ParameterExpression parameterExpression5;
            // ISSUE: reference to a compiler-generated field
            // ISSUE: method reference
            // ISSUE: method reference
            // ISSUE: type reference
            // ISSUE: method reference
            // ISSUE: field reference
            // ISSUE: method reference
            // ISSUE: method reference
            // ISSUE: method reference
            // ISSUE: type reference
            // ISSUE: method reference
            // ISSUE: method reference
            // ISSUE: method reference
            // ISSUE: type reference
            // ISSUE: method reference
            // ISSUE: method reference
            // ISSUE: method reference
            // ISSUE: type reference
            // ISSUE: method reference
            // ISSUE: method reference
            // ISSUE: method reference
            // ISSUE: method reference
            // ISSUE: type reference
            // ISSUE: method reference
            // ISSUE: method reference
            // ISSUE: method reference
            // ISSUE: type reference
            // ISSUE: method reference
            // ISSUE: method reference
            // ISSUE: method reference
            // ISSUE: type reference
            // ISSUE: method reference
            // ISSUE: method reference
            // ISSUE: method reference
            // ISSUE: type reference
            // ISSUE: method reference
            // ISSUE: method reference
            // ISSUE: method reference
            // ISSUE: type reference
            // ISSUE: method reference
            IQueryable<scLaborData> source3 = (IQueryable<scLaborData>) Queryable.Select((IQueryable<M0>) Queryable.OrderByDescending(Queryable.Where((IQueryable<M0>) Queryable.Join((IQueryable<M0>) Queryable.Join((IQueryable<M0>) se0085CtEntities1.OrdSections, (IEnumerable<M1>) se0085CtEntities1.SectionsRoutings, (Expression<Func<M0, M2>>) (sc => sc.OrdSectsId), (Expression<Func<M1, M2>>) (rt => rt.OrdSection.OrdSectsId), (Expression<Func<M0, M1, M3>>) ((sc, rt) => new{ sc = sc, rt = rt })), (IEnumerable<M1>) se0085CtEntities1.LaborVouchers, (Expression<Func<M0, M2>>) (data => data.rt.RoutingId), (Expression<Func<M1, M2>>) (la => la.SectionsRouting.RoutingId), (Expression<Func<M0, M1, M3>>) ((data, la) => new
            {
              sc = data.sc,
              rt = data.rt,
              la = la
            })), (Expression<Func<M0, bool>>) Expression.Lambda<Func<VB\u0024AnonymousType_32<OrdSection, SectionsRouting, LaborVoucher>, bool>>((Expression) Expression.And((Expression) Expression.Equal(\u0024VB\u0024It.sc.OrdSectsId, closure90.\u0024VB\u0024Local_ldSectionId, true, (MethodInfo) null), (Expression) Expression.Equal((Expression) Expression.Call((Expression) null, (MethodInfo) MethodBase.GetMethodFromHandle(__methodref (Microsoft.VisualBasic.CompilerServices.Operators.CompareString)), (Expression) Expression.Property((Expression) Expression.Property((Expression) parameterExpression4, (MethodInfo) MethodBase.GetMethodFromHandle(__methodref (VB\u0024AnonymousType_32<OrdSection, SectionsRouting, LaborVoucher>.get_rt), __typeref (VB\u0024AnonymousType_32<OrdSection, SectionsRouting, LaborVoucher>))), (MethodInfo) MethodBase.GetMethodFromHandle(__methodref (SectionsRouting.get_RoutingWorkCenter))), (Expression) Expression.Field((Expression) Expression.Constant((object) closure90, typeof (clsLaborVouchers._Closure\u0024__90)), FieldInfo.GetFieldFromHandle(__fieldref (clsLaborVouchers._Closure\u0024__90.\u0024VB\u0024Local_ldWorkCenter))), (Expression) Expression.Constant((object) false, typeof (bool))), (Expression) Expression.Constant((object) 0, typeof (int)))), new ParameterExpression[1]
            {
              parameterExpression4
            })), (Expression<Func<M0, M1>>) (data => data.la.LaborVohStartDt)), (Expression<Func<M0, M1>>) Expression.Lambda<Func<VB\u0024AnonymousType_32<OrdSection, SectionsRouting, LaborVoucher>, scLaborData>>((Expression) Expression.MemberInit(Expression.New((ConstructorInfo) MethodBase.GetMethodFromHandle(__methodref (scLaborData.\u002Ector)), (Expression[]) null), (MemberBinding) Expression.Bind((MethodInfo) MethodBase.GetMethodFromHandle(__methodref (scLaborData.set_Section)), (Expression) Expression.Property((Expression) Expression.Property((Expression) parameterExpression5, (MethodInfo) MethodBase.GetMethodFromHandle(__methodref (VB\u0024AnonymousType_32<OrdSection, SectionsRouting, LaborVoucher>.get_sc), __typeref (VB\u0024AnonymousType_32<OrdSection, SectionsRouting, LaborVoucher>))), (MethodInfo) MethodBase.GetMethodFromHandle(__methodref (OrdSection.get_OrdSectsNum)))), (MemberBinding) Expression.Bind((MethodInfo) MethodBase.GetMethodFromHandle(__methodref (scLaborData.set_ProductionOrder)), (Expression) Expression.Property((Expression) Expression.Property((Expression) parameterExpression5, (MethodInfo) MethodBase.GetMethodFromHandle(__methodref (VB\u0024AnonymousType_32<OrdSection, SectionsRouting, LaborVoucher>.get_sc), __typeref (VB\u0024AnonymousType_32<OrdSection, SectionsRouting, LaborVoucher>))), (MethodInfo) MethodBase.GetMethodFromHandle(__methodref (OrdSection.get_OrdSectsProdNum)))), (MemberBinding) Expression.Bind((MethodInfo) MethodBase.GetMethodFromHandle(__methodref (scLaborData.set_OperatorName)), (Expression) Expression.Convert((Expression) Expression.Property((Expression) Expression.Property((Expression) parameterExpression5, (MethodInfo) MethodBase.GetMethodFromHandle(__methodref (VB\u0024AnonymousType_32<OrdSection, SectionsRouting, LaborVoucher>.get_la), __typeref (VB\u0024AnonymousType_32<OrdSection, SectionsRouting, LaborVoucher>))), (MethodInfo) MethodBase.GetMethodFromHandle(__methodref (LaborVoucher.get_LaborVohOperId))), typeof (string), (MethodInfo) MethodBase.GetMethodFromHandle(__methodref (Conversions.ToString)))), (MemberBinding) Expression.Bind((MethodInfo) MethodBase.GetMethodFromHandle(__methodref (scLaborData.set_StartDate)), (Expression) Expression.Convert((Expression) Expression.Property((Expression) Expression.Property((Expression) parameterExpression5, (MethodInfo) MethodBase.GetMethodFromHandle(__methodref (VB\u0024AnonymousType_32<OrdSection, SectionsRouting, LaborVoucher>.get_la), __typeref (VB\u0024AnonymousType_32<OrdSection, SectionsRouting, LaborVoucher>))), (MethodInfo) MethodBase.GetMethodFromHandle(__methodref (LaborVoucher.get_LaborVohStartDt))), typeof (DateTime))), (MemberBinding) Expression.Bind((MethodInfo) MethodBase.GetMethodFromHandle(__methodref (scLaborData.set_EndDate)), (Expression) Expression.Convert((Expression) Expression.Property((Expression) Expression.Property((Expression) parameterExpression5, (MethodInfo) MethodBase.GetMethodFromHandle(__methodref (VB\u0024AnonymousType_32<OrdSection, SectionsRouting, LaborVoucher>.get_la), __typeref (VB\u0024AnonymousType_32<OrdSection, SectionsRouting, LaborVoucher>))), (MethodInfo) MethodBase.GetMethodFromHandle(__methodref (LaborVoucher.get_LaborVohEndDt))), typeof (DateTime))), (MemberBinding) Expression.Bind((MethodInfo) MethodBase.GetMethodFromHandle(__methodref (scLaborData.set_ActualTime)), (Expression) Expression.ConvertChecked((Expression) Expression.Property((Expression) Expression.Property((Expression) parameterExpression5, (MethodInfo) MethodBase.GetMethodFromHandle(__methodref (VB\u0024AnonymousType_32<OrdSection, SectionsRouting, LaborVoucher>.get_la), __typeref (VB\u0024AnonymousType_32<OrdSection, SectionsRouting, LaborVoucher>))), (MethodInfo) MethodBase.GetMethodFromHandle(__methodref (LaborVoucher.get_LaborVohActualMin))), typeof (int))), (MemberBinding) Expression.Bind((MethodInfo) MethodBase.GetMethodFromHandle(__methodref (scLaborData.set_StandardTime)), (Expression) Expression.ConvertChecked((Expression) Expression.Property((Expression) Expression.Property((Expression) parameterExpression5, (MethodInfo) MethodBase.GetMethodFromHandle(__methodref (VB\u0024AnonymousType_32<OrdSection, SectionsRouting, LaborVoucher>.get_rt), __typeref (VB\u0024AnonymousType_32<OrdSection, SectionsRouting, LaborVoucher>))), (MethodInfo) MethodBase.GetMethodFromHandle(__methodref (SectionsRouting.get_RoutingRunTimeMin))), typeof (int))), (MemberBinding) Expression.Bind((MethodInfo) MethodBase.GetMethodFromHandle(__methodref (scLaborData.set_WorkCenter)), (Expression) Expression.Property((Expression) Expression.Property((Expression) parameterExpression5, (MethodInfo) MethodBase.GetMethodFromHandle(__methodref (VB\u0024AnonymousType_32<OrdSection, SectionsRouting, LaborVoucher>.get_sc), __typeref (VB\u0024AnonymousType_32<OrdSection, SectionsRouting, LaborVoucher>))), (MethodInfo) MethodBase.GetMethodFromHandle(__methodref (OrdSection.get_OrdSectsCurrWorkCtr))))), new ParameterExpression[1]
            {
              parameterExpression5
            }));
            if (source3.Count<scLaborData>() == 1)
            {
              // ISSUE: reference to a compiler-generated field
              closure90.\u0024VB\u0024Local_ldLaborBuild = source3.First<scLaborData>();
              // ISSUE: reference to a compiler-generated field
              scLaborData.OperatorName = closure90.\u0024VB\u0024Local_ldLaborBuild.OperatorName;
              // ISSUE: reference to a compiler-generated field
              scLaborData.StartDate = closure90.\u0024VB\u0024Local_ldLaborBuild.StartDate;
              // ISSUE: reference to a compiler-generated field
              scLaborData.EndDate = closure90.\u0024VB\u0024Local_ldLaborBuild.EndDate;
              // ISSUE: reference to a compiler-generated field
              scLaborData.ActualTime = closure90.\u0024VB\u0024Local_ldLaborBuild.ActualTime;
              // ISSUE: reference to a compiler-generated field
              scLaborData.StandardTime = closure90.\u0024VB\u0024Local_ldLaborBuild.StandardTime;
              if (scLaborData.OperatorName.Length == 8)
              {
                ParameterExpression parameterExpression6;
                ParameterExpression parameterExpression7;
                // ISSUE: reference to a compiler-generated field
                // ISSUE: method reference
                // ISSUE: method reference
                // ISSUE: method reference
                // ISSUE: method reference
                // ISSUE: method reference
                IQueryable<scAssociateData> source4 = (IQueryable<scAssociateData>) Queryable.Select<Associate, scAssociateData>(Queryable.Where<Associate>((IQueryable<M0>) se0085CtEntities1.Associates, (Expression<Func<M0, bool>>) Expression.Lambda<Func<Associate, bool>>((Expression) Expression.Equal((double) ac.AssocEmpId, (double) closure90.\u0024VB\u0024Local_ldLaborBuild.OperatorName, true, (MethodInfo) null), new ParameterExpression[1]
                {
                  parameterExpression6
                })), (Expression<Func<M0, M1>>) Expression.Lambda<Func<Associate, scAssociateData>>((Expression) Expression.MemberInit(Expression.New((ConstructorInfo) MethodBase.GetMethodFromHandle(__methodref (scAssociateData.\u002Ector)), (Expression[]) null), (MemberBinding) Expression.Bind((MethodInfo) MethodBase.GetMethodFromHandle(__methodref (scAssociateData.set_AssocFirstName)), (Expression) Expression.Property((Expression) parameterExpression7, (MethodInfo) MethodBase.GetMethodFromHandle(__methodref (Associate.get_AssocFirstName)))), (MemberBinding) Expression.Bind((MethodInfo) MethodBase.GetMethodFromHandle(__methodref (scAssociateData.set_AssocLastName)), (Expression) Expression.Property((Expression) parameterExpression7, (MethodInfo) MethodBase.GetMethodFromHandle(__methodref (Associate.get_AssocLastName))))), new ParameterExpression[1]
                {
                  parameterExpression7
                }));
                if (source4.Count<scAssociateData>() == 1)
                {
                  scAssociateData scAssociateData1 = new scAssociateData();
                  scAssociateData scAssociateData2 = source4.First<scAssociateData>();
                  scLaborData.OperatorName = scAssociateData2.AssocFirstName + " " + scAssociateData2.AssocLastName;
                }
              }
            }
          }
        }
        se0085CtEntities1.Database.Connection.Close();
      }
      return scLaborData;
    }

    public scLaborData savegetCurrentWCPlusLabor(int SectionId)
    {
      // ISSUE: object of a compiler-generated type is created
      // ISSUE: variable of a compiler-generated type
      clsLaborVouchers._Closure\u0024__91 closure91 = new clsLaborVouchers._Closure\u0024__91();
      scLaborData scLaborData = new scLaborData();
      // ISSUE: reference to a compiler-generated field
      closure91.\u0024VB\u0024Local_ldWorkCenter = "";
      // ISSUE: reference to a compiler-generated field
      closure91.\u0024VB\u0024Local_ldSectionId = SectionId;
      using (SE0085CTEntities1 se0085CtEntities1 = new SE0085CTEntities1())
      {
        se0085CtEntities1.Database.Connection.ConnectionString = this._CTConnection;
        ParameterExpression parameterExpression1;
        // ISSUE: reference to a compiler-generated field
        IQueryable<string> source1 = (IQueryable<string>) Queryable.Select<OrdSection, string>(Queryable.Where<OrdSection>((IQueryable<M0>) se0085CtEntities1.OrdSections, (Expression<Func<M0, bool>>) Expression.Lambda<Func<OrdSection, bool>>((Expression) Expression.Equal(sc.OrdSectsId, closure91.\u0024VB\u0024Local_ldSectionId, true, (MethodInfo) null), new ParameterExpression[1]
        {
          parameterExpression1
        })), (Expression<Func<M0, M1>>) (sc => sc.OrdSectsCurrWorkCtr));
        if (source1.Count<string>() == 1)
        {
          // ISSUE: reference to a compiler-generated field
          closure91.\u0024VB\u0024Local_ldWorkCenter = source1.First<string>();
          ParameterExpression parameterExpression2;
          ParameterExpression parameterExpression3;
          // ISSUE: method reference
          // ISSUE: type reference
          // ISSUE: method reference
          // ISSUE: field reference
          // ISSUE: method reference
          // ISSUE: method reference
          // ISSUE: type reference
          // ISSUE: method reference
          // ISSUE: field reference
          // ISSUE: method reference
          // ISSUE: method reference
          // ISSUE: type reference
          // ISSUE: method reference
          // ISSUE: field reference
          // ISSUE: method reference
          // ISSUE: method reference
          // ISSUE: method reference
          // ISSUE: type reference
          // ISSUE: method reference
          // ISSUE: method reference
          // ISSUE: method reference
          // ISSUE: type reference
          // ISSUE: method reference
          // ISSUE: method reference
          // ISSUE: method reference
          // ISSUE: type reference
          // ISSUE: method reference
          // ISSUE: method reference
          // ISSUE: method reference
          // ISSUE: type reference
          // ISSUE: method reference
          IQueryable<scLaborData> source2 = (IQueryable<scLaborData>) Queryable.Select(Queryable.Where((IQueryable<M0>) Queryable.Join((IQueryable<M0>) Queryable.Join((IQueryable<M0>) Queryable.Join((IQueryable<M0>) Queryable.Join((IQueryable<M0>) Queryable.Join((IQueryable<M0>) se0085CtEntities1.SEPlants, (IEnumerable<M1>) se0085CtEntities1.AssemblyLines, (Expression<Func<M0, M2>>) (pl => pl.SEPlantId), (Expression<Func<M1, M2>>) (al => al.SEPlant.SEPlantId), (Expression<Func<M0, M1, M3>>) ((pl, al) => new{ pl = pl, al = al })), (IEnumerable<M1>) se0085CtEntities1.OrderLines, (Expression<Func<M0, M2>>) (data => data.al.AssemLineId), (Expression<Func<M1, M2>>) (ol => ol.AssemblyLine.AssemLineId), (Expression<Func<M0, M1, M3>>) ((data, ol) => new
          {
            \u0024VB\u0024It1 = data,
            ol = ol
          })), (IEnumerable<M1>) se0085CtEntities1.OrdSections, (Expression<Func<M0, M2>>) (data => data.ol.OrderLineId), (Expression<Func<M1, M2>>) (sc => sc.OrderLine.OrderLineId), (Expression<Func<M0, M1, M3>>) ((data, sc) => new
          {
            \u0024VB\u0024It1 = data,
            sc = sc
          })), (IEnumerable<M1>) se0085CtEntities1.SectionsRoutings, (Expression<Func<M0, M2>>) (data => data.sc.OrdSectsId), (Expression<Func<M1, M2>>) (rt => rt.OrdSection.OrdSectsId), (Expression<Func<M0, M1, M3>>) ((data, rt) => new
          {
            \u0024VB\u0024It1 = data,
            rt = rt
          })), (IEnumerable<M1>) se0085CtEntities1.LaborVouchers, (Expression<Func<M0, M2>>) (data => data.rt.RoutingId), (Expression<Func<M1, M2>>) (la => la.SectionsRouting.RoutingId), (Expression<Func<M0, M1, M3>>) ((data, la) => new
          {
            pl = data.\u0024VB\u0024It1.\u0024VB\u0024It1.\u0024VB\u0024It1.pl,
            al = data.\u0024VB\u0024It1.\u0024VB\u0024It1.\u0024VB\u0024It1.al,
            ol = data.\u0024VB\u0024It1.\u0024VB\u0024It1.ol,
            sc = data.\u0024VB\u0024It1.sc,
            rt = data.rt,
            la = la
          })), (Expression<Func<M0, bool>>) Expression.Lambda<Func<VB\u0024AnonymousType_37<SEPlant, AssemblyLine, OrderLine, OrdSection, SectionsRouting, LaborVoucher>, bool>>((Expression) Expression.And((Expression) Expression.And((Expression) Expression.And((Expression) Expression.Equal(\u0024VB\u0024It.pl.SEPlantId, this._Plant.LevelId, true, (MethodInfo) null), (Expression) Expression.Equal((Expression) Expression.Property((Expression) Expression.Property((Expression) parameterExpression2, (MethodInfo) MethodBase.GetMethodFromHandle(__methodref (VB\u0024AnonymousType_37<SEPlant, AssemblyLine, OrderLine, OrdSection, SectionsRouting, LaborVoucher>.get_al), __typeref (VB\u0024AnonymousType_37<SEPlant, AssemblyLine, OrderLine, OrdSection, SectionsRouting, LaborVoucher>))), (MethodInfo) MethodBase.GetMethodFromHandle(__methodref (AssemblyLine.get_AssemLineId))), (Expression) Expression.Property((Expression) Expression.Field((Expression) Expression.Constant((object) this, typeof (clsLaborVouchers)), FieldInfo.GetFieldFromHandle(__fieldref (clsLaborVouchers._AssemblyLine))), (MethodInfo) MethodBase.GetMethodFromHandle(__methodref (scLevels.get_LevelId))), true, (MethodInfo) null)), (Expression) Expression.Equal((Expression) Expression.Property((Expression) Expression.Property((Expression) parameterExpression2, (MethodInfo) MethodBase.GetMethodFromHandle(__methodref (VB\u0024AnonymousType_37<SEPlant, AssemblyLine, OrderLine, OrdSection, SectionsRouting, LaborVoucher>.get_sc), __typeref (VB\u0024AnonymousType_37<SEPlant, AssemblyLine, OrderLine, OrdSection, SectionsRouting, LaborVoucher>))), (MethodInfo) MethodBase.GetMethodFromHandle(__methodref (OrdSection.get_OrdSectsId))), (Expression) Expression.Field((Expression) Expression.Constant((object) closure91, typeof (clsLaborVouchers._Closure\u0024__91)), FieldInfo.GetFieldFromHandle(__fieldref (clsLaborVouchers._Closure\u0024__91.\u0024VB\u0024Local_ldSectionId))), true, (MethodInfo) null)), (Expression) Expression.Equal((Expression) Expression.Call((Expression) null, (MethodInfo) MethodBase.GetMethodFromHandle(__methodref (Microsoft.VisualBasic.CompilerServices.Operators.CompareString)), (Expression) Expression.Property((Expression) Expression.Property((Expression) parameterExpression2, (MethodInfo) MethodBase.GetMethodFromHandle(__methodref (VB\u0024AnonymousType_37<SEPlant, AssemblyLine, OrderLine, OrdSection, SectionsRouting, LaborVoucher>.get_rt), __typeref (VB\u0024AnonymousType_37<SEPlant, AssemblyLine, OrderLine, OrdSection, SectionsRouting, LaborVoucher>))), (MethodInfo) MethodBase.GetMethodFromHandle(__methodref (SectionsRouting.get_RoutingWorkCenter))), (Expression) Expression.Field((Expression) Expression.Constant((object) closure91, typeof (clsLaborVouchers._Closure\u0024__91)), FieldInfo.GetFieldFromHandle(__fieldref (clsLaborVouchers._Closure\u0024__91.\u0024VB\u0024Local_ldWorkCenter))), (Expression) Expression.Constant((object) false, typeof (bool))), (Expression) Expression.Constant((object) 0, typeof (int)))), new ParameterExpression[1]
          {
            parameterExpression2
          })), (Expression<Func<M0, M1>>) Expression.Lambda<Func<VB\u0024AnonymousType_37<SEPlant, AssemblyLine, OrderLine, OrdSection, SectionsRouting, LaborVoucher>, scLaborData>>((Expression) Expression.MemberInit(Expression.New((ConstructorInfo) MethodBase.GetMethodFromHandle(__methodref (scLaborData.\u002Ector)), (Expression[]) null), (MemberBinding) Expression.Bind((MethodInfo) MethodBase.GetMethodFromHandle(__methodref (scLaborData.set_LineItem)), (Expression) Expression.Property((Expression) Expression.Property((Expression) parameterExpression3, (MethodInfo) MethodBase.GetMethodFromHandle(__methodref (VB\u0024AnonymousType_37<SEPlant, AssemblyLine, OrderLine, OrdSection, SectionsRouting, LaborVoucher>.get_ol), __typeref (VB\u0024AnonymousType_37<SEPlant, AssemblyLine, OrderLine, OrdSection, SectionsRouting, LaborVoucher>))), (MethodInfo) MethodBase.GetMethodFromHandle(__methodref (OrderLine.get_OrderLineNum)))), (MemberBinding) Expression.Bind((MethodInfo) MethodBase.GetMethodFromHandle(__methodref (scLaborData.set_Section)), (Expression) Expression.Property((Expression) Expression.Property((Expression) parameterExpression3, (MethodInfo) MethodBase.GetMethodFromHandle(__methodref (VB\u0024AnonymousType_37<SEPlant, AssemblyLine, OrderLine, OrdSection, SectionsRouting, LaborVoucher>.get_sc), __typeref (VB\u0024AnonymousType_37<SEPlant, AssemblyLine, OrderLine, OrdSection, SectionsRouting, LaborVoucher>))), (MethodInfo) MethodBase.GetMethodFromHandle(__methodref (OrdSection.get_OrdSectsNum)))), (MemberBinding) Expression.Bind((MethodInfo) MethodBase.GetMethodFromHandle(__methodref (scLaborData.set_ProductionOrder)), (Expression) Expression.Property((Expression) Expression.Property((Expression) parameterExpression3, (MethodInfo) MethodBase.GetMethodFromHandle(__methodref (VB\u0024AnonymousType_37<SEPlant, AssemblyLine, OrderLine, OrdSection, SectionsRouting, LaborVoucher>.get_sc), __typeref (VB\u0024AnonymousType_37<SEPlant, AssemblyLine, OrderLine, OrdSection, SectionsRouting, LaborVoucher>))), (MethodInfo) MethodBase.GetMethodFromHandle(__methodref (OrdSection.get_OrdSectsProdNum)))), (MemberBinding) Expression.Bind((MethodInfo) MethodBase.GetMethodFromHandle(__methodref (scLaborData.set_WorkCenter)), (Expression) Expression.Property((Expression) Expression.Property((Expression) parameterExpression3, (MethodInfo) MethodBase.GetMethodFromHandle(__methodref (VB\u0024AnonymousType_37<SEPlant, AssemblyLine, OrderLine, OrdSection, SectionsRouting, LaborVoucher>.get_sc), __typeref (VB\u0024AnonymousType_37<SEPlant, AssemblyLine, OrderLine, OrdSection, SectionsRouting, LaborVoucher>))), (MethodInfo) MethodBase.GetMethodFromHandle(__methodref (OrdSection.get_OrdSectsCurrWorkCtr))))), new ParameterExpression[1]
          {
            parameterExpression3
          }));
          if (source2.Count<scLaborData>() == 1)
            scLaborData = source2.First<scLaborData>();
        }
        se0085CtEntities1.Database.Connection.Close();
      }
      return scLaborData;
    }
  }
}
