97 lines
3.9 KiB
C#
97 lines
3.9 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 08:33:53
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using com.itac.oib.siplacepro.contracts.types;
|
|
|
|
namespace com.itac.oib.siplacepro.contracts.data
|
|
{
|
|
// source: assembly 5.1.0.84
|
|
// source: assembly ASM.AS.OIB.SIPLACEPro.Proxy
|
|
public class TableLocationMapper
|
|
{
|
|
// used for itac->asm: True
|
|
// used for asm->itac: True
|
|
|
|
// maps iTAC namespace conform type to ASM namespace type
|
|
|
|
// maps iTAC namespace conform array to ASM namespace array
|
|
public static Asm.As.Oib.SiplacePro.Proxy.Business.Objects.TableLocation[] get(TableLocation[] asmTableLocation)
|
|
{
|
|
if (asmTableLocation == null) { return null; }
|
|
Asm.As.Oib.SiplacePro.Proxy.Business.Objects.TableLocation[] itacTableLocation = new Asm.As.Oib.SiplacePro.Proxy.Business.Objects.TableLocation[asmTableLocation.Length];
|
|
for (int i = 0; i < asmTableLocation.Length; i++)
|
|
{
|
|
// to itac array
|
|
itacTableLocation[i] = TableLocationMapper.get(asmTableLocation[i]);
|
|
}
|
|
return itacTableLocation;
|
|
}
|
|
|
|
// maps iTAC namespace conform array to ASM namespace list
|
|
public static List<Asm.As.Oib.SiplacePro.Proxy.Business.Objects.TableLocation> getList(TableLocation[] asmTableLocation)
|
|
{
|
|
if (asmTableLocation == null) { return null; }
|
|
List<Asm.As.Oib.SiplacePro.Proxy.Business.Objects.TableLocation> itacTableLocation = new List<Asm.As.Oib.SiplacePro.Proxy.Business.Objects.TableLocation>();
|
|
for (int i = 0; i < asmTableLocation.Length; i++)
|
|
{
|
|
itacTableLocation.Add(TableLocationMapper.get(asmTableLocation[i]));
|
|
}
|
|
return itacTableLocation;
|
|
}
|
|
|
|
// map type from ASM namespace to iTAC namespace
|
|
public static TableLocation get(Asm.As.Oib.SiplacePro.Proxy.Business.Objects.TableLocation asmTableLocation)
|
|
{
|
|
if (asmTableLocation == null) { return null; }
|
|
TableLocation itacTableLocation = new TableLocation();
|
|
mapAsm2Itac(asmTableLocation, itacTableLocation);
|
|
return itacTableLocation;
|
|
}
|
|
|
|
public static void mapAsm2Itac(Asm.As.Oib.SiplacePro.Proxy.Business.Objects.TableLocation asmTableLocation, TableLocation itacTableLocation)
|
|
{
|
|
itacTableLocation.Number = com.itac.oib.siplacepro.contracts.types.TableLocationNumberMapper.get(asmTableLocation.Number);
|
|
// complex asm property Number
|
|
itacTableLocation.MCTableType = com.itac.oib.siplacepro.contracts.types.MCTableTypeMapper.get(asmTableLocation.MCTableType);
|
|
// complex asm property MCTableType
|
|
itacTableLocation.StartTrack = asmTableLocation.StartTrack;
|
|
itacTableLocation.EndTrack = asmTableLocation.EndTrack;
|
|
itacTableLocation.SubType = com.itac.oib.siplacepro.contracts.types.TableLocationSubTypeMapper.get(asmTableLocation.SubType);
|
|
// complex asm property SubType
|
|
itacTableLocation.FixedAssembled = asmTableLocation.FixedAssembled;
|
|
itacTableLocation.StationDeviceId = asmTableLocation.StationDeviceId;
|
|
}
|
|
|
|
// maps ASM namespace conform list to iTAC namespace array
|
|
public static TableLocation[] getArray(IList<Asm.As.Oib.SiplacePro.Proxy.Business.Objects.TableLocation> asmTableLocation)
|
|
{
|
|
if (asmTableLocation == null) { return null; }
|
|
TableLocation[] itacTableLocation = new TableLocation[asmTableLocation.Count];
|
|
for (int i = 0; i < asmTableLocation.Count; i++)
|
|
{
|
|
itacTableLocation[i] = TableLocationMapper.get(asmTableLocation[i]);
|
|
}
|
|
return itacTableLocation;
|
|
}
|
|
|
|
// maps ASM namespace conform array to iTAC namespace array
|
|
public static TableLocation[] getArray(Asm.As.Oib.SiplacePro.Proxy.Business.Objects.TableLocation[] asmTableLocation)
|
|
{
|
|
if (asmTableLocation == null) { return null; }
|
|
TableLocation[] itacTableLocation = new TableLocation[asmTableLocation.Length];
|
|
for (int i = 0; i < asmTableLocation.Length; i++)
|
|
{
|
|
itacTableLocation[i] = TableLocationMapper.get(asmTableLocation[i]);
|
|
}
|
|
return itacTableLocation;
|
|
}
|
|
}
|
|
}
|