106 lines
5.1 KiB
C#
106 lines
5.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 23.11.2018 08:02:34
|
|
// skip property ExtensionDataObject, declared in SubPanelState
|
|
using System;
|
|
using System.Collections.Generic;
|
|
|
|
namespace com.itac.oib.boardgatekeeper.contracts.data
|
|
{
|
|
// source: assembly 2.3.0.2
|
|
// source: assembly ASM.AS.OIB.Client
|
|
public class SubPanelStateMapper
|
|
{
|
|
// 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._2011._07.BoardGateKeeper.Contracts.Service.SubPanelState get(SubPanelState itacSubPanelState)
|
|
{
|
|
if (itacSubPanelState == null) { return null; }
|
|
www.siplace.com.OIB._2011._07.BoardGateKeeper.Contracts.Service.SubPanelState asmSubPanelState = new www.siplace.com.OIB._2011._07.BoardGateKeeper.Contracts.Service.SubPanelState();
|
|
mapItac2Asm(asmSubPanelState, itacSubPanelState);
|
|
return asmSubPanelState;
|
|
}
|
|
|
|
public static void mapItac2Asm(www.siplace.com.OIB._2011._07.BoardGateKeeper.Contracts.Service.SubPanelState asmSubPanelState, SubPanelState itacSubPanelState)
|
|
{
|
|
// skip property ExtensionDataObject, declared in SubPanelState
|
|
asmSubPanelState.PanelName = itacSubPanelState.PanelName;
|
|
asmSubPanelState.Place = itacSubPanelState.Place;
|
|
asmSubPanelState.Reason = itacSubPanelState.Reason;
|
|
}
|
|
|
|
// maps iTAC namespace conform array to ASM namespace array
|
|
public static www.siplace.com.OIB._2011._07.BoardGateKeeper.Contracts.Service.SubPanelState[] get(SubPanelState[] itacSubPanelState)
|
|
{
|
|
if (itacSubPanelState == null) { return null; }
|
|
www.siplace.com.OIB._2011._07.BoardGateKeeper.Contracts.Service.SubPanelState[] asmSubPanelState = new www.siplace.com.OIB._2011._07.BoardGateKeeper.Contracts.Service.SubPanelState[itacSubPanelState.Length];
|
|
for (int i = 0; i < itacSubPanelState.Length; i++)
|
|
{
|
|
// to itac array
|
|
asmSubPanelState[i] = SubPanelStateMapper.get(itacSubPanelState[i]);
|
|
}
|
|
return asmSubPanelState;
|
|
}
|
|
|
|
// maps iTAC namespace conform array to ASM namespace list
|
|
public static List<www.siplace.com.OIB._2011._07.BoardGateKeeper.Contracts.Service.SubPanelState> getList(SubPanelState[] asmSubPanelState)
|
|
{
|
|
if (asmSubPanelState == null) { return null; }
|
|
List<www.siplace.com.OIB._2011._07.BoardGateKeeper.Contracts.Service.SubPanelState> itacSubPanelState = new List<www.siplace.com.OIB._2011._07.BoardGateKeeper.Contracts.Service.SubPanelState>();
|
|
for (int i = 0; i < asmSubPanelState.Length; i++)
|
|
{
|
|
itacSubPanelState.Add(SubPanelStateMapper.get(asmSubPanelState[i]));
|
|
}
|
|
return itacSubPanelState;
|
|
}
|
|
|
|
// map type from ASM namespace to iTAC namespace
|
|
public static SubPanelState get(www.siplace.com.OIB._2011._07.BoardGateKeeper.Contracts.Service.SubPanelState asmSubPanelState)
|
|
{
|
|
if (asmSubPanelState == null) { return null; }
|
|
SubPanelState itacSubPanelState = new SubPanelState();
|
|
mapAsm2Itac(asmSubPanelState, itacSubPanelState);
|
|
return itacSubPanelState;
|
|
}
|
|
|
|
public static void mapAsm2Itac(www.siplace.com.OIB._2011._07.BoardGateKeeper.Contracts.Service.SubPanelState asmSubPanelState, SubPanelState itacSubPanelState)
|
|
{
|
|
// skip property ExtensionDataObject, declared in SubPanelState
|
|
itacSubPanelState.PanelName = asmSubPanelState.PanelName;
|
|
itacSubPanelState.Place = asmSubPanelState.Place;
|
|
itacSubPanelState.Reason = asmSubPanelState.Reason;
|
|
}
|
|
|
|
// maps ASM namespace conform list to iTAC namespace array
|
|
public static SubPanelState[] getArray(IList<www.siplace.com.OIB._2011._07.BoardGateKeeper.Contracts.Service.SubPanelState> asmSubPanelState)
|
|
{
|
|
if (asmSubPanelState == null) { return null; }
|
|
SubPanelState[] itacSubPanelState = new SubPanelState[asmSubPanelState.Count];
|
|
for (int i = 0; i < asmSubPanelState.Count; i++)
|
|
{
|
|
itacSubPanelState[i] = SubPanelStateMapper.get(asmSubPanelState[i]);
|
|
}
|
|
return itacSubPanelState;
|
|
}
|
|
|
|
// maps ASM namespace conform array to iTAC namespace array
|
|
public static SubPanelState[] getArray(www.siplace.com.OIB._2011._07.BoardGateKeeper.Contracts.Service.SubPanelState[] asmSubPanelState)
|
|
{
|
|
if (asmSubPanelState == null) { return null; }
|
|
SubPanelState[] itacSubPanelState = new SubPanelState[asmSubPanelState.Length];
|
|
for (int i = 0; i < asmSubPanelState.Length; i++)
|
|
{
|
|
itacSubPanelState[i] = SubPanelStateMapper.get(asmSubPanelState[i]);
|
|
}
|
|
return itacSubPanelState;
|
|
}
|
|
}
|
|
}
|