103 lines
5.2 KiB
C#
103 lines
5.2 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 PrinterErrorDetailsMapper
|
|
{
|
|
// 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.PrinterErrorDetails get(PrinterErrorDetails itacPrinterErrorDetails)
|
|
{
|
|
if (itacPrinterErrorDetails == null) { return null; }
|
|
Asm.As.Oib.SiplaceSetupCenter.Contracts.Data.PrinterErrorDetails asmPrinterErrorDetails = new Asm.As.Oib.SiplaceSetupCenter.Contracts.Data.PrinterErrorDetails();
|
|
mapItac2Asm(asmPrinterErrorDetails, itacPrinterErrorDetails);
|
|
return asmPrinterErrorDetails;
|
|
}
|
|
|
|
public static void mapItac2Asm(Asm.As.Oib.SiplaceSetupCenter.Contracts.Data.PrinterErrorDetails asmPrinterErrorDetails, PrinterErrorDetails itacPrinterErrorDetails)
|
|
{
|
|
asmPrinterErrorDetails.ErrorNumber = itacPrinterErrorDetails.ErrorNumber;
|
|
asmPrinterErrorDetails.SeverityLevel = itacPrinterErrorDetails.SeverityLevel;
|
|
asmPrinterErrorDetails.ErrorDescription = itacPrinterErrorDetails.ErrorDescription;
|
|
}
|
|
|
|
// maps iTAC namespace conform array to ASM namespace array
|
|
public static Asm.As.Oib.SiplaceSetupCenter.Contracts.Data.PrinterErrorDetails[] get(PrinterErrorDetails[] itacPrinterErrorDetails)
|
|
{
|
|
if (itacPrinterErrorDetails == null) { return null; }
|
|
Asm.As.Oib.SiplaceSetupCenter.Contracts.Data.PrinterErrorDetails[] asmPrinterErrorDetails = new Asm.As.Oib.SiplaceSetupCenter.Contracts.Data.PrinterErrorDetails[itacPrinterErrorDetails.Length];
|
|
for (int i = 0; i < itacPrinterErrorDetails.Length; i++)
|
|
{
|
|
// to itac array
|
|
asmPrinterErrorDetails[i] = PrinterErrorDetailsMapper.get(itacPrinterErrorDetails[i]);
|
|
}
|
|
return asmPrinterErrorDetails;
|
|
}
|
|
|
|
// maps iTAC namespace conform array to ASM namespace list
|
|
public static List<Asm.As.Oib.SiplaceSetupCenter.Contracts.Data.PrinterErrorDetails> getList(PrinterErrorDetails[] asmPrinterErrorDetails)
|
|
{
|
|
if (asmPrinterErrorDetails == null) { return null; }
|
|
List<Asm.As.Oib.SiplaceSetupCenter.Contracts.Data.PrinterErrorDetails> itacPrinterErrorDetails = new List<Asm.As.Oib.SiplaceSetupCenter.Contracts.Data.PrinterErrorDetails>();
|
|
for (int i = 0; i < asmPrinterErrorDetails.Length; i++)
|
|
{
|
|
itacPrinterErrorDetails.Add(PrinterErrorDetailsMapper.get(asmPrinterErrorDetails[i]));
|
|
}
|
|
return itacPrinterErrorDetails;
|
|
}
|
|
|
|
// map type from ASM namespace to iTAC namespace
|
|
public static PrinterErrorDetails get(Asm.As.Oib.SiplaceSetupCenter.Contracts.Data.PrinterErrorDetails asmPrinterErrorDetails)
|
|
{
|
|
if (asmPrinterErrorDetails == null) { return null; }
|
|
PrinterErrorDetails itacPrinterErrorDetails = new PrinterErrorDetails();
|
|
mapAsm2Itac(asmPrinterErrorDetails, itacPrinterErrorDetails);
|
|
return itacPrinterErrorDetails;
|
|
}
|
|
|
|
public static void mapAsm2Itac(Asm.As.Oib.SiplaceSetupCenter.Contracts.Data.PrinterErrorDetails asmPrinterErrorDetails, PrinterErrorDetails itacPrinterErrorDetails)
|
|
{
|
|
itacPrinterErrorDetails.ErrorNumber = asmPrinterErrorDetails.ErrorNumber;
|
|
itacPrinterErrorDetails.SeverityLevel = asmPrinterErrorDetails.SeverityLevel;
|
|
itacPrinterErrorDetails.ErrorDescription = asmPrinterErrorDetails.ErrorDescription;
|
|
}
|
|
|
|
// maps ASM namespace conform list to iTAC namespace array
|
|
public static PrinterErrorDetails[] getArray(IList<Asm.As.Oib.SiplaceSetupCenter.Contracts.Data.PrinterErrorDetails> asmPrinterErrorDetails)
|
|
{
|
|
if (asmPrinterErrorDetails == null) { return null; }
|
|
PrinterErrorDetails[] itacPrinterErrorDetails = new PrinterErrorDetails[asmPrinterErrorDetails.Count];
|
|
for (int i = 0; i < asmPrinterErrorDetails.Count; i++)
|
|
{
|
|
itacPrinterErrorDetails[i] = PrinterErrorDetailsMapper.get(asmPrinterErrorDetails[i]);
|
|
}
|
|
return itacPrinterErrorDetails;
|
|
}
|
|
|
|
// maps ASM namespace conform array to iTAC namespace array
|
|
public static PrinterErrorDetails[] getArray(Asm.As.Oib.SiplaceSetupCenter.Contracts.Data.PrinterErrorDetails[] asmPrinterErrorDetails)
|
|
{
|
|
if (asmPrinterErrorDetails == null) { return null; }
|
|
PrinterErrorDetails[] itacPrinterErrorDetails = new PrinterErrorDetails[asmPrinterErrorDetails.Length];
|
|
for (int i = 0; i < asmPrinterErrorDetails.Length; i++)
|
|
{
|
|
itacPrinterErrorDetails[i] = PrinterErrorDetailsMapper.get(asmPrinterErrorDetails[i]);
|
|
}
|
|
return itacPrinterErrorDetails;
|
|
}
|
|
}
|
|
}
|