Files
2025-06-06 09:15:13 +02:00

104 lines
4.1 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 PanelRefDes
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 PanelRefDesMapper
{
// 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.PanelRefDes get(PanelRefDes itacPanelRefDes)
{
if (itacPanelRefDes == null) { return null; }
www.siplace.com.OIB._2012._03.Traceability.Contracts.Data.PanelRefDes asmPanelRefDes = new www.siplace.com.OIB._2012._03.Traceability.Contracts.Data.PanelRefDes();
mapItac2Asm(asmPanelRefDes, itacPanelRefDes);
return asmPanelRefDes;
}
public static void mapItac2Asm(www.siplace.com.OIB._2012._03.Traceability.Contracts.Data.PanelRefDes asmPanelRefDes, PanelRefDes itacPanelRefDes)
{
// skip property ExtensionDataObject, declared in PanelRefDes
asmPanelRefDes.Name = itacPanelRefDes.Name;
asmPanelRefDes.ComponentBarcode = itacPanelRefDes.ComponentBarcode;
}
// maps iTAC namespace conform array to ASM namespace array
public static www.siplace.com.OIB._2012._03.Traceability.Contracts.Data.PanelRefDes[] get(PanelRefDes[] itacPanelRefDes)
{
if (itacPanelRefDes == null) { return null; }
www.siplace.com.OIB._2012._03.Traceability.Contracts.Data.PanelRefDes[] asmPanelRefDes = new www.siplace.com.OIB._2012._03.Traceability.Contracts.Data.PanelRefDes[itacPanelRefDes.Length];
for (int i = 0; i < itacPanelRefDes.Length; i++)
{
// to itac array
asmPanelRefDes[i] = PanelRefDesMapper.get(itacPanelRefDes[i]);
}
return asmPanelRefDes;
}
// maps iTAC namespace conform array to ASM namespace list
public static List<www.siplace.com.OIB._2012._03.Traceability.Contracts.Data.PanelRefDes> getList(PanelRefDes[] asmPanelRefDes)
{
if (asmPanelRefDes == null) { return null; }
List<www.siplace.com.OIB._2012._03.Traceability.Contracts.Data.PanelRefDes> itacPanelRefDes = new List<www.siplace.com.OIB._2012._03.Traceability.Contracts.Data.PanelRefDes>();
for (int i = 0; i < asmPanelRefDes.Length; i++)
{
itacPanelRefDes.Add(PanelRefDesMapper.get(asmPanelRefDes[i]));
}
return itacPanelRefDes;
}
// map type from ASM namespace to iTAC namespace
public static PanelRefDes get(www.siplace.com.OIB._2012._03.Traceability.Contracts.Data.PanelRefDes asmPanelRefDes)
{
if (asmPanelRefDes == null) { return null; }
PanelRefDes itacPanelRefDes = new PanelRefDes();
mapAsm2Itac(asmPanelRefDes, itacPanelRefDes);
return itacPanelRefDes;
}
public static void mapAsm2Itac(www.siplace.com.OIB._2012._03.Traceability.Contracts.Data.PanelRefDes asmPanelRefDes, PanelRefDes itacPanelRefDes)
{
// skip property ExtensionDataObject, declared in PanelRefDes
itacPanelRefDes.Name = asmPanelRefDes.Name;
itacPanelRefDes.ComponentBarcode = asmPanelRefDes.ComponentBarcode;
}
// maps ASM namespace conform list to iTAC namespace array
public static PanelRefDes[] getArray(IList<www.siplace.com.OIB._2012._03.Traceability.Contracts.Data.PanelRefDes> asmPanelRefDes)
{
if (asmPanelRefDes == null) { return null; }
PanelRefDes[] itacPanelRefDes = new PanelRefDes[asmPanelRefDes.Count];
for (int i = 0; i < asmPanelRefDes.Count; i++)
{
itacPanelRefDes[i] = PanelRefDesMapper.get(asmPanelRefDes[i]);
}
return itacPanelRefDes;
}
// maps ASM namespace conform array to iTAC namespace array
public static PanelRefDes[] getArray(www.siplace.com.OIB._2012._03.Traceability.Contracts.Data.PanelRefDes[] asmPanelRefDes)
{
if (asmPanelRefDes == null) { return null; }
PanelRefDes[] itacPanelRefDes = new PanelRefDes[asmPanelRefDes.Length];
for (int i = 0; i < asmPanelRefDes.Length; i++)
{
itacPanelRefDes[i] = PanelRefDesMapper.get(asmPanelRefDes[i]);
}
return itacPanelRefDes;
}
}
}