/* * 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 31.10.2018 08:16:46 using System; using System.Collections.Generic; namespace com.itac.oib.monitoring.contracts.data { // source: assembly 5.1.0.84 // source: assembly ASM.AS.OIB.Monitoring.Proxy public class RejectInfoMapper { // used for itac->asm: True // used for asm->itac: True // maps iTAC namespace conform type to ASM namespace type public static Asm.As.Oib.Monitoring.Proxy.Business.Objects.RejectInfo get(RejectInfo asmRejectInfo) { if (asmRejectInfo == null) { return null; } Asm.As.Oib.Monitoring.Proxy.Business.Objects.RejectInfo itacRejectInfo = new Asm.As.Oib.Monitoring.Proxy.Business.Objects.RejectInfo(); mapItac2Asm(itacRejectInfo, asmRejectInfo); return itacRejectInfo; } public static void mapItac2Asm(Asm.As.Oib.Monitoring.Proxy.Business.Objects.RejectInfo itacRejectInfo, RejectInfo asmRejectInfo) { itacRejectInfo.ComponentAbsenceAfterPick = asmRejectInfo.ComponentAbsenceAfterPick; itacRejectInfo.ComponentAbsenceBeforePlace = asmRejectInfo.ComponentAbsenceBeforePlace; itacRejectInfo.ComponentMaterialDefect = asmRejectInfo.ComponentMaterialDefect; itacRejectInfo.TreatmentError = asmRejectInfo.TreatmentError; itacRejectInfo.DroppedError = asmRejectInfo.DroppedError; itacRejectInfo.ComponentPresenceAfterPlace = asmRejectInfo.ComponentPresenceAfterPlace; itacRejectInfo.IdentError = asmRejectInfo.IdentError; itacRejectInfo.PickupRetries = asmRejectInfo.PickupRetries; } // maps iTAC namespace conform array to ASM namespace array public static Asm.As.Oib.Monitoring.Proxy.Business.Objects.RejectInfo[] get(RejectInfo[] asmRejectInfo) { if (asmRejectInfo == null) { return null; } Asm.As.Oib.Monitoring.Proxy.Business.Objects.RejectInfo[] itacRejectInfo = new Asm.As.Oib.Monitoring.Proxy.Business.Objects.RejectInfo[asmRejectInfo.Length]; for (int i = 0; i < asmRejectInfo.Length; i++) { // to itac array itacRejectInfo[i] = RejectInfoMapper.get(asmRejectInfo[i]); } return itacRejectInfo; } // maps iTAC namespace conform array to ASM namespace list public static List getList(RejectInfo[] asmRejectInfo) { if (asmRejectInfo == null) { return null; } List itacRejectInfo = new List(); for (int i = 0; i < asmRejectInfo.Length; i++) { itacRejectInfo.Add(RejectInfoMapper.get(asmRejectInfo[i])); } return itacRejectInfo; } // map type from ASM namespace to iTAC namespace public static RejectInfo get(Asm.As.Oib.Monitoring.Proxy.Business.Objects.RejectInfo asmRejectInfo) { if (asmRejectInfo == null) { return null; } RejectInfo itacRejectInfo = new RejectInfo(); mapAsm2Itac(asmRejectInfo, itacRejectInfo); return itacRejectInfo; } public static void mapAsm2Itac(Asm.As.Oib.Monitoring.Proxy.Business.Objects.RejectInfo asmRejectInfo, RejectInfo itacRejectInfo) { itacRejectInfo.ComponentAbsenceAfterPick = asmRejectInfo.ComponentAbsenceAfterPick; itacRejectInfo.ComponentAbsenceBeforePlace = asmRejectInfo.ComponentAbsenceBeforePlace; itacRejectInfo.ComponentMaterialDefect = asmRejectInfo.ComponentMaterialDefect; itacRejectInfo.TreatmentError = asmRejectInfo.TreatmentError; itacRejectInfo.DroppedError = asmRejectInfo.DroppedError; itacRejectInfo.ComponentPresenceAfterPlace = asmRejectInfo.ComponentPresenceAfterPlace; itacRejectInfo.IdentError = asmRejectInfo.IdentError; itacRejectInfo.PickupRetries = asmRejectInfo.PickupRetries; } // maps ASM namespace conform list to iTAC namespace array public static RejectInfo[] getArray(IList asmRejectInfo) { if (asmRejectInfo == null) { return null; } RejectInfo[] itacRejectInfo = new RejectInfo[asmRejectInfo.Count]; for (int i = 0; i < asmRejectInfo.Count; i++) { itacRejectInfo[i] = RejectInfoMapper.get(asmRejectInfo[i]); } return itacRejectInfo; } // maps ASM namespace conform array to iTAC namespace array public static RejectInfo[] getArray(Asm.As.Oib.Monitoring.Proxy.Business.Objects.RejectInfo[] asmRejectInfo) { if (asmRejectInfo == null) { return null; } RejectInfo[] itacRejectInfo = new RejectInfo[asmRejectInfo.Length]; for (int i = 0; i < asmRejectInfo.Length; i++) { itacRejectInfo[i] = RejectInfoMapper.get(asmRejectInfo[i]); } return itacRejectInfo; } } }