110 lines
3.6 KiB
C#
110 lines
3.6 KiB
C#
/*
|
|
* Copyright (c) 2018 iTAC Software AG, Germany. All Rights Reserved.
|
|
*
|
|
* This software is protected by copyright. Under no circumstances may any part of this file in any form be copied,
|
|
* printed, edited or otherwise distributed, be stored in a retrieval system, or be translated into another language
|
|
* without the written permission of iTAC Software AG.
|
|
*/
|
|
// created 05.11.2018 15:39:46
|
|
// skip property ExtensionDataObject, declared in Job
|
|
using System;
|
|
using System.Collections.Generic;
|
|
|
|
namespace com.itac.oib.traceability.contracts.data
|
|
{
|
|
// source: assembly 3.0.0.0
|
|
// source: assembly ASM.AS.OIB.Client
|
|
public class JobMapper
|
|
{
|
|
// used for itac->asm: True
|
|
// used for asm->itac: True
|
|
|
|
// maps iTAC namespace conform type to ASM namespace type
|
|
public static www.siplace.com.OIB._2012._03.Traceability.Contracts.Data.Job get(Job itacJob)
|
|
{
|
|
if (itacJob == null) { return null; }
|
|
www.siplace.com.OIB._2012._03.Traceability.Contracts.Data.Job asmJob = new www.siplace.com.OIB._2012._03.Traceability.Contracts.Data.Job();
|
|
mapItac2Asm(asmJob, itacJob);
|
|
return asmJob;
|
|
}
|
|
|
|
public static void mapItac2Asm(www.siplace.com.OIB._2012._03.Traceability.Contracts.Data.Job asmJob, Job itacJob)
|
|
{
|
|
// skip property ExtensionDataObject, declared in Job
|
|
asmJob.BoardName = itacJob.BoardName;
|
|
asmJob.BoardSide = itacJob.BoardSide;
|
|
asmJob.OrderID = itacJob.OrderID;
|
|
asmJob.Recipe = itacJob.Recipe;
|
|
asmJob.Setup = itacJob.Setup;
|
|
}
|
|
|
|
// maps iTAC namespace conform array to ASM namespace array
|
|
public static www.siplace.com.OIB._2012._03.Traceability.Contracts.Data.Job[] get(Job[] itacJob)
|
|
{
|
|
if (itacJob == null) { return null; }
|
|
www.siplace.com.OIB._2012._03.Traceability.Contracts.Data.Job[] asmJob = new www.siplace.com.OIB._2012._03.Traceability.Contracts.Data.Job[itacJob.Length];
|
|
for (int i = 0; i < itacJob.Length; i++)
|
|
{
|
|
// to itac array
|
|
asmJob[i] = JobMapper.get(itacJob[i]);
|
|
}
|
|
return asmJob;
|
|
}
|
|
|
|
// maps iTAC namespace conform array to ASM namespace list
|
|
public static List<www.siplace.com.OIB._2012._03.Traceability.Contracts.Data.Job> getList(Job[] asmJob)
|
|
{
|
|
if (asmJob == null) { return null; }
|
|
List<www.siplace.com.OIB._2012._03.Traceability.Contracts.Data.Job> itacJob = new List<www.siplace.com.OIB._2012._03.Traceability.Contracts.Data.Job>();
|
|
for (int i = 0; i < asmJob.Length; i++)
|
|
{
|
|
itacJob.Add(JobMapper.get(asmJob[i]));
|
|
}
|
|
return itacJob;
|
|
}
|
|
|
|
// map type from ASM namespace to iTAC namespace
|
|
public static Job get(www.siplace.com.OIB._2012._03.Traceability.Contracts.Data.Job asmJob)
|
|
{
|
|
if (asmJob == null) { return null; }
|
|
Job itacJob = new Job();
|
|
mapAsm2Itac(asmJob, itacJob);
|
|
return itacJob;
|
|
}
|
|
|
|
public static void mapAsm2Itac(www.siplace.com.OIB._2012._03.Traceability.Contracts.Data.Job asmJob, Job itacJob)
|
|
{
|
|
// skip property ExtensionDataObject, declared in Job
|
|
itacJob.BoardName = asmJob.BoardName;
|
|
itacJob.BoardSide = asmJob.BoardSide;
|
|
itacJob.OrderID = asmJob.OrderID;
|
|
itacJob.Recipe = asmJob.Recipe;
|
|
itacJob.Setup = asmJob.Setup;
|
|
}
|
|
|
|
// maps ASM namespace conform list to iTAC namespace array
|
|
public static Job[] getArray(IList<www.siplace.com.OIB._2012._03.Traceability.Contracts.Data.Job> asmJob)
|
|
{
|
|
if (asmJob == null) { return null; }
|
|
Job[] itacJob = new Job[asmJob.Count];
|
|
for (int i = 0; i < asmJob.Count; i++)
|
|
{
|
|
itacJob[i] = JobMapper.get(asmJob[i]);
|
|
}
|
|
return itacJob;
|
|
}
|
|
|
|
// maps ASM namespace conform array to iTAC namespace array
|
|
public static Job[] getArray(www.siplace.com.OIB._2012._03.Traceability.Contracts.Data.Job[] asmJob)
|
|
{
|
|
if (asmJob == null) { return null; }
|
|
Job[] itacJob = new Job[asmJob.Length];
|
|
for (int i = 0; i < asmJob.Length; i++)
|
|
{
|
|
itacJob[i] = JobMapper.get(asmJob[i]);
|
|
}
|
|
return itacJob;
|
|
}
|
|
}
|
|
}
|