105 lines
4.7 KiB
C#
105 lines
4.7 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 ErrorCodes
|
|
using System;
|
|
using System.Collections.Generic;
|
|
|
|
namespace com.itac.oib.traceability.contracts.data
|
|
{
|
|
// source: assembly 2.3.0.2
|
|
// source: assembly ASM.AS.OIB.Client
|
|
public class ErrorCodesMapper
|
|
{
|
|
// 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._2009._03.Traceability.Contracts.Data.ErrorCodes get(ErrorCodes itacErrorCodes)
|
|
{
|
|
if (itacErrorCodes == null) { return null; }
|
|
www.siplace.com.OIB._2009._03.Traceability.Contracts.Data.ErrorCodes asmErrorCodes = new www.siplace.com.OIB._2009._03.Traceability.Contracts.Data.ErrorCodes();
|
|
mapItac2Asm(asmErrorCodes, itacErrorCodes);
|
|
return asmErrorCodes;
|
|
}
|
|
|
|
public static void mapItac2Asm(www.siplace.com.OIB._2009._03.Traceability.Contracts.Data.ErrorCodes asmErrorCodes, ErrorCodes itacErrorCodes)
|
|
{
|
|
// skip property ExtensionDataObject, declared in ErrorCodes
|
|
// complex property ErrorCodesList, isArray:True, isGeneric:False
|
|
asmErrorCodes.ErrorCodesList = com.itac.oib.traceability.contracts.data.ErrorStructMapper.get( itacErrorCodes.ErrorCodesList);
|
|
}
|
|
|
|
// maps iTAC namespace conform array to ASM namespace array
|
|
public static www.siplace.com.OIB._2009._03.Traceability.Contracts.Data.ErrorCodes[] get(ErrorCodes[] itacErrorCodes)
|
|
{
|
|
if (itacErrorCodes == null) { return null; }
|
|
www.siplace.com.OIB._2009._03.Traceability.Contracts.Data.ErrorCodes[] asmErrorCodes = new www.siplace.com.OIB._2009._03.Traceability.Contracts.Data.ErrorCodes[itacErrorCodes.Length];
|
|
for (int i = 0; i < itacErrorCodes.Length; i++)
|
|
{
|
|
// to itac array
|
|
asmErrorCodes[i] = ErrorCodesMapper.get(itacErrorCodes[i]);
|
|
}
|
|
return asmErrorCodes;
|
|
}
|
|
|
|
// maps iTAC namespace conform array to ASM namespace list
|
|
public static List<www.siplace.com.OIB._2009._03.Traceability.Contracts.Data.ErrorCodes> getList(ErrorCodes[] asmErrorCodes)
|
|
{
|
|
if (asmErrorCodes == null) { return null; }
|
|
List<www.siplace.com.OIB._2009._03.Traceability.Contracts.Data.ErrorCodes> itacErrorCodes = new List<www.siplace.com.OIB._2009._03.Traceability.Contracts.Data.ErrorCodes>();
|
|
for (int i = 0; i < asmErrorCodes.Length; i++)
|
|
{
|
|
itacErrorCodes.Add(ErrorCodesMapper.get(asmErrorCodes[i]));
|
|
}
|
|
return itacErrorCodes;
|
|
}
|
|
|
|
// map type from ASM namespace to iTAC namespace
|
|
public static ErrorCodes get(www.siplace.com.OIB._2009._03.Traceability.Contracts.Data.ErrorCodes asmErrorCodes)
|
|
{
|
|
if (asmErrorCodes == null) { return null; }
|
|
ErrorCodes itacErrorCodes = new ErrorCodes();
|
|
mapAsm2Itac(asmErrorCodes, itacErrorCodes);
|
|
return itacErrorCodes;
|
|
}
|
|
|
|
public static void mapAsm2Itac(www.siplace.com.OIB._2009._03.Traceability.Contracts.Data.ErrorCodes asmErrorCodes, ErrorCodes itacErrorCodes)
|
|
{
|
|
// skip property ExtensionDataObject, declared in ErrorCodes
|
|
// array mapping
|
|
itacErrorCodes.ErrorCodesList = ErrorStructMapper.getArray(asmErrorCodes.ErrorCodesList);
|
|
// complex asm property ErrorCodesList
|
|
}
|
|
|
|
// maps ASM namespace conform list to iTAC namespace array
|
|
public static ErrorCodes[] getArray(IList<www.siplace.com.OIB._2009._03.Traceability.Contracts.Data.ErrorCodes> asmErrorCodes)
|
|
{
|
|
if (asmErrorCodes == null) { return null; }
|
|
ErrorCodes[] itacErrorCodes = new ErrorCodes[asmErrorCodes.Count];
|
|
for (int i = 0; i < asmErrorCodes.Count; i++)
|
|
{
|
|
itacErrorCodes[i] = ErrorCodesMapper.get(asmErrorCodes[i]);
|
|
}
|
|
return itacErrorCodes;
|
|
}
|
|
|
|
// maps ASM namespace conform array to iTAC namespace array
|
|
public static ErrorCodes[] getArray(www.siplace.com.OIB._2009._03.Traceability.Contracts.Data.ErrorCodes[] asmErrorCodes)
|
|
{
|
|
if (asmErrorCodes == null) { return null; }
|
|
ErrorCodes[] itacErrorCodes = new ErrorCodes[asmErrorCodes.Length];
|
|
for (int i = 0; i < asmErrorCodes.Length; i++)
|
|
{
|
|
itacErrorCodes[i] = ErrorCodesMapper.get(asmErrorCodes[i]);
|
|
}
|
|
return itacErrorCodes;
|
|
}
|
|
}
|
|
}
|