107 lines
6.1 KiB
C#
107 lines
6.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 06.11.2018 11:07:38
|
|
using System;
|
|
using System.Collections.Generic;
|
|
|
|
namespace com.itac.oib.siplacesetupcenter.contracts.data
|
|
{
|
|
// source: assembly 5.1.0.84
|
|
// source: assembly ASM.AS.OIB.SIPLACESetupCenter.Contracts
|
|
public class ComponentLocationResultMapper
|
|
{
|
|
// used for itac->asm: True
|
|
// used for asm->itac: True
|
|
|
|
// maps iTAC namespace conform type to ASM namespace type
|
|
public static Asm.As.Oib.SiplaceSetupCenter.Contracts.Data.ComponentLocationResult get(ComponentLocationResult itacComponentLocationResult)
|
|
{
|
|
if (itacComponentLocationResult == null) { return null; }
|
|
Asm.As.Oib.SiplaceSetupCenter.Contracts.Data.ComponentLocationResult asmComponentLocationResult = new Asm.As.Oib.SiplaceSetupCenter.Contracts.Data.ComponentLocationResult();
|
|
mapItac2Asm(asmComponentLocationResult, itacComponentLocationResult);
|
|
return asmComponentLocationResult;
|
|
}
|
|
|
|
public static void mapItac2Asm(Asm.As.Oib.SiplaceSetupCenter.Contracts.Data.ComponentLocationResult asmComponentLocationResult, ComponentLocationResult itacComponentLocationResult)
|
|
{
|
|
asmComponentLocationResult.ResultState = itacComponentLocationResult.ResultState;
|
|
// complex property ComponentLocation, isArray:False, isGeneric:False
|
|
asmComponentLocationResult.ComponentLocation = com.itac.oib.siplacesetupcenter.contracts.data.ComponentLocationMapper.get( itacComponentLocationResult.ComponentLocation);
|
|
// complex property Messages, isArray:False, isGeneric:True
|
|
asmComponentLocationResult.Messages = PackagingUnitResultMessageMapper.getList(itacComponentLocationResult.Messages);
|
|
}
|
|
|
|
// maps iTAC namespace conform array to ASM namespace array
|
|
public static Asm.As.Oib.SiplaceSetupCenter.Contracts.Data.ComponentLocationResult[] get(ComponentLocationResult[] itacComponentLocationResult)
|
|
{
|
|
if (itacComponentLocationResult == null) { return null; }
|
|
Asm.As.Oib.SiplaceSetupCenter.Contracts.Data.ComponentLocationResult[] asmComponentLocationResult = new Asm.As.Oib.SiplaceSetupCenter.Contracts.Data.ComponentLocationResult[itacComponentLocationResult.Length];
|
|
for (int i = 0; i < itacComponentLocationResult.Length; i++)
|
|
{
|
|
// to itac array
|
|
asmComponentLocationResult[i] = ComponentLocationResultMapper.get(itacComponentLocationResult[i]);
|
|
}
|
|
return asmComponentLocationResult;
|
|
}
|
|
|
|
// maps iTAC namespace conform array to ASM namespace list
|
|
public static List<Asm.As.Oib.SiplaceSetupCenter.Contracts.Data.ComponentLocationResult> getList(ComponentLocationResult[] asmComponentLocationResult)
|
|
{
|
|
if (asmComponentLocationResult == null) { return null; }
|
|
List<Asm.As.Oib.SiplaceSetupCenter.Contracts.Data.ComponentLocationResult> itacComponentLocationResult = new List<Asm.As.Oib.SiplaceSetupCenter.Contracts.Data.ComponentLocationResult>();
|
|
for (int i = 0; i < asmComponentLocationResult.Length; i++)
|
|
{
|
|
itacComponentLocationResult.Add(ComponentLocationResultMapper.get(asmComponentLocationResult[i]));
|
|
}
|
|
return itacComponentLocationResult;
|
|
}
|
|
|
|
// map type from ASM namespace to iTAC namespace
|
|
public static ComponentLocationResult get(Asm.As.Oib.SiplaceSetupCenter.Contracts.Data.ComponentLocationResult asmComponentLocationResult)
|
|
{
|
|
if (asmComponentLocationResult == null) { return null; }
|
|
ComponentLocationResult itacComponentLocationResult = new ComponentLocationResult();
|
|
mapAsm2Itac(asmComponentLocationResult, itacComponentLocationResult);
|
|
return itacComponentLocationResult;
|
|
}
|
|
|
|
public static void mapAsm2Itac(Asm.As.Oib.SiplaceSetupCenter.Contracts.Data.ComponentLocationResult asmComponentLocationResult, ComponentLocationResult itacComponentLocationResult)
|
|
{
|
|
itacComponentLocationResult.ResultState = asmComponentLocationResult.ResultState;
|
|
itacComponentLocationResult.ComponentLocation = com.itac.oib.siplacesetupcenter.contracts.data.ComponentLocationMapper.get(asmComponentLocationResult.ComponentLocation);
|
|
// complex asm property ComponentLocation
|
|
// maps ASM list 2 iTAC array
|
|
itacComponentLocationResult.Messages = PackagingUnitResultMessageMapper.getArray(asmComponentLocationResult.Messages);
|
|
}
|
|
|
|
// maps ASM namespace conform list to iTAC namespace array
|
|
public static ComponentLocationResult[] getArray(IList<Asm.As.Oib.SiplaceSetupCenter.Contracts.Data.ComponentLocationResult> asmComponentLocationResult)
|
|
{
|
|
if (asmComponentLocationResult == null) { return null; }
|
|
ComponentLocationResult[] itacComponentLocationResult = new ComponentLocationResult[asmComponentLocationResult.Count];
|
|
for (int i = 0; i < asmComponentLocationResult.Count; i++)
|
|
{
|
|
itacComponentLocationResult[i] = ComponentLocationResultMapper.get(asmComponentLocationResult[i]);
|
|
}
|
|
return itacComponentLocationResult;
|
|
}
|
|
|
|
// maps ASM namespace conform array to iTAC namespace array
|
|
public static ComponentLocationResult[] getArray(Asm.As.Oib.SiplaceSetupCenter.Contracts.Data.ComponentLocationResult[] asmComponentLocationResult)
|
|
{
|
|
if (asmComponentLocationResult == null) { return null; }
|
|
ComponentLocationResult[] itacComponentLocationResult = new ComponentLocationResult[asmComponentLocationResult.Length];
|
|
for (int i = 0; i < asmComponentLocationResult.Length; i++)
|
|
{
|
|
itacComponentLocationResult[i] = ComponentLocationResultMapper.get(asmComponentLocationResult[i]);
|
|
}
|
|
return itacComponentLocationResult;
|
|
}
|
|
}
|
|
}
|