Index: TAOR-rework-bugfixing/TAOR rework/laden/special laden/Spoelbakladen/HoofdAansturingSpoelbakLade.vb =================================================================== diff -u -r1596 -r1597 --- TAOR-rework-bugfixing/TAOR rework/laden/special laden/Spoelbakladen/HoofdAansturingSpoelbakLade.vb (.../HoofdAansturingSpoelbakLade.vb) (revision 1596) +++ TAOR-rework-bugfixing/TAOR rework/laden/special laden/Spoelbakladen/HoofdAansturingSpoelbakLade.vb (.../HoofdAansturingSpoelbakLade.vb) (revision 1597) @@ -1,4 +1,6 @@ -Public Class HoofdAansturingSpoelbakLade +Imports TA_OR_rework.Rework + +Public Class HoofdAansturingSpoelbakLade Inherits HoofdAansturingSpecialLade Private _reworkTrayRepository As ReworkTrayRepository Index: TAOR-rework-bugfixing/TAOR rework/Rework/ReworkRedenen.vb =================================================================== diff -u -r1596 -r1597 --- TAOR-rework-bugfixing/TAOR rework/Rework/ReworkRedenen.vb (.../ReworkRedenen.vb) (revision 1596) +++ TAOR-rework-bugfixing/TAOR rework/Rework/ReworkRedenen.vb (.../ReworkRedenen.vb) (revision 1597) @@ -1,27 +1,28 @@ -Public Class Reden - Public Code As String - Public Label As String -End Class +Namespace Rework + Public Class Reden + Public Code As String + Public Label As String + End Class -Public Class Machine - Public Label As String - Public Code As String - Public redenen As List(Of Reden) + Public Class Machine + Public Label As String + Public Code As String + Public redenen As List(Of Reden) - Public Sub New() - redenen = New List(Of Reden) - End Sub -End Class + Public Sub New() + redenen = New List(Of Reden) + End Sub + End Class -Public Class ReworkOnderdeel - Public Label As String - Public Code As String - Public Machines As List(Of Machine) + Public Class ReworkOnderdeel + Public Label As String + Public Code As String + Public Machines As List(Of Machine) - Public Sub New() - Machines = New List(Of Machine) - End Sub -End Class + Public Sub New() + Machines = New List(Of Machine) + End Sub + End Class - +End Namespace \ No newline at end of file Index: TAOR-rework-bugfixing/TAOR rework/Configuraties/ReworkTraySlotMapperXML.vb =================================================================== diff -u -r1596 -r1597 --- TAOR-rework-bugfixing/TAOR rework/Configuraties/ReworkTraySlotMapperXML.vb (.../ReworkTraySlotMapperXML.vb) (revision 1596) +++ TAOR-rework-bugfixing/TAOR rework/Configuraties/ReworkTraySlotMapperXML.vb (.../ReworkTraySlotMapperXML.vb) (revision 1597) @@ -1,5 +1,6 @@ Imports System.IO Imports System.Xml.Serialization +Imports TA_OR_rework.Rework Module ReworkTraySlotMapperXML Public Function getDataFromFile() As List(Of Slot) Index: TAOR-rework-bugfixing/TAOR rework/Rework/Rework.vb =================================================================== diff -u -r1596 -r1597 --- TAOR-rework-bugfixing/TAOR rework/Rework/Rework.vb (.../Rework.vb) (revision 1596) +++ TAOR-rework-bugfixing/TAOR rework/Rework/Rework.vb (.../Rework.vb) (revision 1597) @@ -1,193 +1,195 @@ -Public Class Rework - Private _onderdeel As String - Private _barcode As String - Private _reden As String - Private _redenLabel As String - Private _batch As String - Private _kar As String - Private _dossierCode As String +Namespace Rework + Public Class Rework + Private _onderdeel As String + Private _barcode As String + Private _reden As String + Private _redenLabel As String + Private _batch As String + Private _kar As String + Private _dossierCode As String - Private _opslaanArdis As Boolean + Private _opslaanArdis As Boolean - Private _color As String = "-" - Private _length As String = "-" - Private _height As String = "-" + Private _color As String = "-" + Private _length As String = "-" + Private _height As String = "-" - Private _voorVoorraad As String - Private _etiketTekst As String + Private _voorVoorraad As String + Private _etiketTekst As String - Public DueOut As String - Public MachineID As String - Public PartijID As String - Public ProductID As String - Public SequentieNummer As String - Public StapNummer As String - Public TijdstipCreatie As String - Public TijdstipProductie As String - Public ToeleveringID As String - Public IsRework As String - Public OrigineelOnderdeel As String + Public DueOut As String + Public MachineID As String + Public PartijID As String + Public ProductID As String + Public SequentieNummer As String + Public StapNummer As String + Public TijdstipCreatie As String + Public TijdstipProductie As String + Public ToeleveringID As String + Public IsRework As String + Public OrigineelOnderdeel As String - Public Sub New() + Public Sub New() - End Sub + End Sub - Public Sub New(ByVal barcode As String, ByVal reden() As String, ByVal onderdeel As String, ByVal voorVoorraad As Boolean, etiketTekst As String) - _barcode = barcode - _reden = reden(0) - _redenLabel = reden(1) - _onderdeel = onderdeel - _voorVoorraad = voorVoorraad - _etiketTekst = etiketTekst - _opslaanArdis = True - End Sub + Public Sub New(ByVal barcode As String, ByVal reden() As String, ByVal onderdeel As String, ByVal voorVoorraad As Boolean, etiketTekst As String) + _barcode = barcode + _reden = reden(0) + _redenLabel = reden(1) + _onderdeel = onderdeel + _voorVoorraad = voorVoorraad + _etiketTekst = etiketTekst + _opslaanArdis = True + End Sub #Region "properties" - Public Property onderdeel() As String - Get - Return _onderdeel - End Get - Set(ByVal value As String) - _onderdeel = value - End Set - End Property + Public Property onderdeel() As String + Get + Return _onderdeel + End Get + Set(ByVal value As String) + _onderdeel = value + End Set + End Property - Public Property barcode() As String - Get - Return _barcode - End Get - Set(ByVal value As String) - _barcode = value - End Set - End Property + Public Property barcode() As String + Get + Return _barcode + End Get + Set(ByVal value As String) + _barcode = value + End Set + End Property - Public Property reden() As String - Get - Return _reden - End Get - Set(ByVal value As String) - _reden = value - End Set - End Property + Public Property reden() As String + Get + Return _reden + End Get + Set(ByVal value As String) + _reden = value + End Set + End Property - Public Property redenLabel() As String - Get - Return _redenLabel - End Get - Set(ByVal value As String) - _redenLabel = value - End Set - End Property + Public Property redenLabel() As String + Get + Return _redenLabel + End Get + Set(ByVal value As String) + _redenLabel = value + End Set + End Property - Public Property batch() As String - Get - Return _batch - End Get - Set(ByVal value As String) - _batch = value - End Set - End Property + Public Property batch() As String + Get + Return _batch + End Get + Set(ByVal value As String) + _batch = value + End Set + End Property - Public Property kar() As String - Get - Return _kar - End Get - Set(ByVal value As String) - _kar = value - End Set - End Property + Public Property kar() As String + Get + Return _kar + End Get + Set(ByVal value As String) + _kar = value + End Set + End Property - Public Property color() As String - Get - Return _color - End Get - Set(ByVal value As String) - _color = value - End Set - End Property + Public Property color() As String + Get + Return _color + End Get + Set(ByVal value As String) + _color = value + End Set + End Property - Public Property length As String - Get - Return _length - End Get - Set(ByVal value As String) - _length = value - End Set - End Property + Public Property length As String + Get + Return _length + End Get + Set(ByVal value As String) + _length = value + End Set + End Property - Public Property height() As String - Get - Return _height - End Get - Set(ByVal value As String) - _height = value - End Set - End Property + Public Property height() As String + Get + Return _height + End Get + Set(ByVal value As String) + _height = value + End Set + End Property - Public Property dossierCode() As String - Get - Return _dossierCode - End Get - Set(ByVal value As String) - _dossierCode = value - End Set - End Property + Public Property dossierCode() As String + Get + Return _dossierCode + End Get + Set(ByVal value As String) + _dossierCode = value + End Set + End Property - Public Property opslaanArdis() As Boolean - Get - Return _opslaanArdis - End Get - Set(ByVal value As Boolean) - _opslaanArdis = value - End Set - End Property + Public Property opslaanArdis() As Boolean + Get + Return _opslaanArdis + End Get + Set(ByVal value As Boolean) + _opslaanArdis = value + End Set + End Property - Public Property voorVoorraad() As Boolean - Get - Return _voorVoorraad - End Get - Set(ByVal value As Boolean) - _voorVoorraad = value - End Set - End Property + Public Property voorVoorraad() As Boolean + Get + Return _voorVoorraad + End Get + Set(ByVal value As Boolean) + _voorVoorraad = value + End Set + End Property - Public Property etiketTekst() As String - Get - Return _etiketTekst - End Get - Set(ByVal value As String) - _etiketTekst = value - End Set - End Property + Public Property etiketTekst() As String + Get + Return _etiketTekst + End Get + Set(ByVal value As String) + _etiketTekst = value + End Set + End Property #End Region - Public Sub aanpassenData() - IsRework = "1" - MachineID = "Rework" - StapNummer = "0" - End Sub + Public Sub aanpassenData() + IsRework = "1" + MachineID = "Rework" + StapNummer = "0" + End Sub - Public Function geefLinksOfRechts() As String - Dim linksofrechts As String = onderdeel.ToLower.Replace("zijkant", "").Replace("i", "").Replace("e", "").Replace("s", "").Trim.ToUpper() - If Not linksofrechts.Equals("") Then + Public Function geefLinksOfRechts() As String + Dim linksofrechts As String = onderdeel.ToLower.Replace("zijkant", "").Replace("i", "").Replace("e", "").Replace("s", "").Trim.ToUpper() + If Not linksofrechts.Equals("") Then + Return linksofrechts + End If + Dim linksOfRechtsLetter As String = barcode.Substring(5).Substring(0, 1) + Select Case linksOfRechtsLetter + Case "L", "C", "E", "A" + linksofrechts = "L" + Case "R", "D", "F", "B" + linksofrechts = "R" + Case Else + Throw New Exception($"Letter '{linksOfRechtsLetter}' onbekend om links of rechts te bepalen voor rework zijkant") + End Select Return linksofrechts - End If - Dim linksOfRechtsLetter As String = barcode.Substring(5).Substring(0, 1) - Select Case linksOfRechtsLetter - Case "L", "C", "E", "A" - linksofrechts = "L" - Case "R", "D", "F", "B" - linksofrechts = "R" - Case Else - Throw New Exception($"Letter '{linksOfRechtsLetter}' onbekend om links of rechts te bepalen voor rework zijkant") - End Select - Return linksofrechts - End Function + End Function - Public Overrides Function ToString() As String - Return "ONDERDEEL: " & _onderdeel & " --- BARCODE: " & _barcode & " --- BATCH: " & _batch & " " & " --- KAR: " & _kar & " " & " --- OPSLAAN ARDIS: " & _opslaanArdis & " " & " --- COLOR: " & _color & " " & " --- LENGTH: " & _length & " --- HEIGHT: " & _height - End Function + Public Overrides Function ToString() As String + Return "ONDERDEEL: " & _onderdeel & " --- BARCODE: " & _barcode & " --- BATCH: " & _batch & " " & " --- KAR: " & _kar & " " & " --- OPSLAAN ARDIS: " & _opslaanArdis & " " & " --- COLOR: " & _color & " " & " --- LENGTH: " & _length & " --- HEIGHT: " & _height + End Function -End Class + End Class +End Namespace \ No newline at end of file Index: TAOR-rework-bugfixing/TAOR rework/laden/special laden/Sifonladen/HoofdAansturingSifonLade.vb =================================================================== diff -u -r1596 -r1597 --- TAOR-rework-bugfixing/TAOR rework/laden/special laden/Sifonladen/HoofdAansturingSifonLade.vb (.../HoofdAansturingSifonLade.vb) (revision 1596) +++ TAOR-rework-bugfixing/TAOR rework/laden/special laden/Sifonladen/HoofdAansturingSifonLade.vb (.../HoofdAansturingSifonLade.vb) (revision 1597) @@ -1,4 +1,6 @@ -Public Class HoofdAansturingSifonLade +Imports TA_OR_rework.Rework + +Public Class HoofdAansturingSifonLade Inherits HoofdAansturingSpecialLade Private _reworkTrayRepository As ReworkTrayRepository Index: TAOR-rework-bugfixing/TAOR rework/Rework/PrinterBacklogDocMapper.vb =================================================================== diff -u -r1596 -r1597 --- TAOR-rework-bugfixing/TAOR rework/Rework/PrinterBacklogDocMapper.vb (.../PrinterBacklogDocMapper.vb) (revision 1596) +++ TAOR-rework-bugfixing/TAOR rework/Rework/PrinterBacklogDocMapper.vb (.../PrinterBacklogDocMapper.vb) (revision 1597) @@ -1,46 +1,49 @@ Imports System.IO -Imports Microsoft.Office.Interop.Word -Imports Microsoft.Office.Interop Imports System.Runtime.InteropServices +Imports Microsoft.Office.Interop +Imports Microsoft.Office.Interop.Word -Module PrinterBacklogDocMapper - Public Sub addPrinterBacklogDoc(trayNummer As Integer, text As String, isSpecial As Boolean) - Dim bestandsPath As String = Configs.printerBacklogPath - Dim trayNummerTekst As String = trayNummer.ToString - 'vullen met nullen - For index = 1 To 4 - trayNummerTekst.Length - trayNummerTekst = "0" & trayNummerTekst - Next +Namespace Rework - Dim bestandsnaam As String = "printer_backlog_" & trayNummerTekst - If isSpecial Then - bestandsnaam &= "_Special" - End If - Dim fullPath As String = Path.Combine(bestandsPath, bestandsnaam) - Dim oWord As Object - Dim oDoc As Object - Try - oWord = CreateObject("Word.Application") - oDoc = New Word.Document - Catch ex As Exception - Throw New Exception("Print backlog kon niet worden aangemaakt, omdat Word niet is geïnstalleerd") - End Try - Try + Module PrinterBacklogDocMapper + Public Sub addPrinterBacklogDoc(trayNummer As Integer, text As String, isSpecial As Boolean) + Dim bestandsPath As String = Configs.printerBacklogPath + Dim trayNummerTekst As String = trayNummer.ToString + 'vullen met nullen + For index = 1 To 4 - trayNummerTekst.Length + trayNummerTekst = "0" & trayNummerTekst + Next - Dim oPara1 As Paragraph = oDoc.Content.Paragraphs.Add - oPara1.Range.Font.Name = "Courier New" - oPara1.Range.Font.Bold = False - oPara1.Range.Font.Size = 13 - oPara1.Range.Text = text + Dim bestandsnaam As String = "printer_backlog_" & trayNummerTekst + If isSpecial Then + bestandsnaam &= "_Special" + End If + Dim fullPath As String = Path.Combine(bestandsPath, bestandsnaam) + Dim oWord As Object + Dim oDoc As Object + Try + oWord = CreateObject("Word.Application") + oDoc = New Word.Document + Catch ex As Exception + Throw New Exception("Print backlog kon niet worden aangemaakt, omdat Word niet is geïnstalleerd") + End Try + Try - oDoc.SaveAs2(fullPath) - Dim save_changes As Object = False - oDoc.Close(save_changes) - oWord.Quit(save_changes) + Dim oPara1 As Paragraph = oDoc.Content.Paragraphs.Add + oPara1.Range.Font.Name = "Courier New" + oPara1.Range.Font.Bold = False + oPara1.Range.Font.Size = 13 + oPara1.Range.Text = text - Catch ex As Exception - Throw New Exception("Print backlog kon niet worden aangemaakt" & vbNewLine & ex.Message) - End Try - End Sub + oDoc.SaveAs2(fullPath) + Dim save_changes As Object = False + oDoc.Close(save_changes) + oWord.Quit(save_changes) -End Module + Catch ex As Exception + Throw New Exception("Print backlog kon niet worden aangemaakt" & vbNewLine & ex.Message) + End Try + End Sub + + End Module +End Namespace \ No newline at end of file Index: TAOR-rework-bugfixing/TAOR rework/Rework/ReworkTrayRepository.vb =================================================================== diff -u -r1596 -r1597 --- TAOR-rework-bugfixing/TAOR rework/Rework/ReworkTrayRepository.vb (.../ReworkTrayRepository.vb) (revision 1596) +++ TAOR-rework-bugfixing/TAOR rework/Rework/ReworkTrayRepository.vb (.../ReworkTrayRepository.vb) (revision 1597) @@ -1,77 +1,79 @@ -Public Class ReworkTrayRepository - Private _reworkTrays As List(Of ReworkTray) - Private _reworkTraysSpecialLade As List(Of ReworkTray) +Namespace Rework + Public Class ReworkTrayRepository + Private _reworkTrays As List(Of ReworkTray) + Private _reworkTraysSpecialLade As List(Of ReworkTray) - Public Sub New() - _reworkTrays = New List(Of ReworkTray) - _reworkTraysSpecialLade = New List(Of ReworkTray) - End Sub + Public Sub New() + _reworkTrays = New List(Of ReworkTray) + _reworkTraysSpecialLade = New List(Of ReworkTray) + End Sub - Public ReadOnly Property reworkTrays As List(Of ReworkTray) - Get - Return New List(Of ReworkTray)(_reworkTrays) - End Get - End Property + Public ReadOnly Property reworkTrays As List(Of ReworkTray) + Get + Return New List(Of ReworkTray)(_reworkTrays) + End Get + End Property - Public ReadOnly Property reworkTraysSpecialLaden As List(Of ReworkTray) - Get - Return New List(Of ReworkTray)(_reworkTraysSpecialLade) - End Get - End Property + Public ReadOnly Property reworkTraysSpecialLaden As List(Of ReworkTray) + Get + Return New List(Of ReworkTray)(_reworkTraysSpecialLade) + End Get + End Property - Public Sub addReworkTray(ByVal reworkTray As ReworkTray) - _reworkTrays.Add(reworkTray) - End Sub + Public Sub addReworkTray(ByVal reworkTray As ReworkTray) + _reworkTrays.Add(reworkTray) + End Sub - Public Sub addReworkTraySpecialLade(ByVal reworkTray As ReworkTray) - _reworkTraysSpecialLade.Add(reworkTray) - End Sub + Public Sub addReworkTraySpecialLade(ByVal reworkTray As ReworkTray) + _reworkTraysSpecialLade.Add(reworkTray) + End Sub - Public Sub verwijderReworkTrays() - _reworkTrays = Nothing - _reworkTrays = New List(Of ReworkTray) - End Sub + Public Sub verwijderReworkTrays() + _reworkTrays = Nothing + _reworkTrays = New List(Of ReworkTray) + End Sub - Public Sub verwijderReworkTraysSpecialLade() - _reworkTraysSpecialLade = Nothing - _reworkTraysSpecialLade = New List(Of ReworkTray) - End Sub + Public Sub verwijderReworkTraysSpecialLade() + _reworkTraysSpecialLade = Nothing + _reworkTraysSpecialLade = New List(Of ReworkTray) + End Sub - Public ReadOnly Property aantalReworkTrays() - Get - Return _reworkTrays.Count - End Get - End Property + Public ReadOnly Property aantalReworkTrays() + Get + Return _reworkTrays.Count + End Get + End Property - Public ReadOnly Property aantalReworkTraysSpecial() - Get - Return _reworkTraysSpecialLade.Count - End Get - End Property + Public ReadOnly Property aantalReworkTraysSpecial() + Get + Return _reworkTraysSpecialLade.Count + End Get + End Property - Public Function geefReworkTrayNummer(index As Integer) As String - If _reworkTrays.Count > 0 Then - Return _reworkTrays(index).nummer - End If - Throw New Exception("Er zijn geen rework trays aanwezig om het nummer bij op te vragen") - End Function + Public Function geefReworkTrayNummer(index As Integer) As String + If _reworkTrays.Count > 0 Then + Return _reworkTrays(index).nummer + End If + Throw New Exception("Er zijn geen rework trays aanwezig om het nummer bij op te vragen") + End Function - Public Function geefSpecialLadeReworkTrayNummer(index As Integer) As String - If _reworkTraysSpecialLade.Count > 0 Then - Return _reworkTraysSpecialLade(index).nummer - End If - Throw New Exception("Er zijn geen rework trays special lade aanwezig om het nummer bij op te vragen") - End Function - - Public Function geefReworkTrayEnSlotNummerBijBarcode(barcode As String) As String() - Dim trayEnSlotNummer As String() = Nothing - For Each specialLadeTray As ReworkTray In reworkTraysSpecialLaden - trayEnSlotNummer = specialLadeTray.geefReworkTrayEnSlotNummerBijBarcode(barcode) - If Not trayEnSlotNummer Is Nothing Then - Return trayEnSlotNummer + Public Function geefSpecialLadeReworkTrayNummer(index As Integer) As String + If _reworkTraysSpecialLade.Count > 0 Then + Return _reworkTraysSpecialLade(index).nummer End If - Next - Return trayEnSlotNummer - End Function + Throw New Exception("Er zijn geen rework trays special lade aanwezig om het nummer bij op te vragen") + End Function -End Class + Public Function geefReworkTrayEnSlotNummerBijBarcode(barcode As String) As String() + Dim trayEnSlotNummer As String() = Nothing + For Each specialLadeTray As ReworkTray In reworkTraysSpecialLaden + trayEnSlotNummer = specialLadeTray.geefReworkTrayEnSlotNummerBijBarcode(barcode) + If Not trayEnSlotNummer Is Nothing Then + Return trayEnSlotNummer + End If + Next + Return trayEnSlotNummer + End Function + + End Class +End Namespace \ No newline at end of file Index: TAOR-rework-bugfixing/TAOR rework/Rework/ReworkTraySlotRepository.vb =================================================================== diff -u -r1596 -r1597 --- TAOR-rework-bugfixing/TAOR rework/Rework/ReworkTraySlotRepository.vb (.../ReworkTraySlotRepository.vb) (revision 1596) +++ TAOR-rework-bugfixing/TAOR rework/Rework/ReworkTraySlotRepository.vb (.../ReworkTraySlotRepository.vb) (revision 1597) @@ -1,21 +1,23 @@ -Public Class ReworkTraySlotRepository - Private _slots As List(Of Slot) +Namespace Rework + Public Class ReworkTraySlotRepository + Private _slots As List(Of Slot) - Public Sub New() - _slots = ReworkTraySlotMapperXML.getDataFromFile() - End Sub + Public Sub New() + _slots = ReworkTraySlotMapperXML.getDataFromFile() + End Sub - Public Function slots() As List(Of Slot) - Dim tempList As New List(Of Slot) - For Each huidigSlot As Slot In _slots - Dim nieuwSlot As New Slot - nieuwSlot.nummer = huidigSlot.nummer - nieuwSlot.type = huidigSlot.type - tempList.Add(nieuwSlot) - Next + Public Function slots() As List(Of Slot) + Dim tempList As New List(Of Slot) + For Each huidigSlot As Slot In _slots + Dim nieuwSlot As New Slot + nieuwSlot.nummer = huidigSlot.nummer + nieuwSlot.type = huidigSlot.type + tempList.Add(nieuwSlot) + Next - Return tempList + Return tempList - End Function + End Function -End Class + End Class +End Namespace \ No newline at end of file Index: TAOR-rework-bugfixing/TAOR rework/Rework/HoofdAansturingRework.vb =================================================================== diff -u -r1596 -r1597 --- TAOR-rework-bugfixing/TAOR rework/Rework/HoofdAansturingRework.vb (.../HoofdAansturingRework.vb) (revision 1596) +++ TAOR-rework-bugfixing/TAOR rework/Rework/HoofdAansturingRework.vb (.../HoofdAansturingRework.vb) (revision 1597) @@ -1,217 +1,200 @@ -Public Class HoofdAansturingRework - Private productieDatas As New List(Of ZijkamerFreesProductieData) - Private productieData As ZijkamerFreesProductieData +Namespace Rework + Public Class HoofdAansturingRework + Private _productieData As ZijkamerFreesProductieData + Private ReadOnly _productieDatas As New List(Of ZijkamerFreesProductieData) - Private Sub MaakFreesOpdrachtInReworkTray(ByVal barcodeID As String, ByVal linksOfRechts As String, ByVal nieuwTrayNummer As String, ByVal slotNr As String, ByVal voorVoorraad As Boolean, etiketTekst As String, Optional barcodeID2 As String = "", Optional andereZijkantLinksOfRechts As String = "") - Try - productieData = AutomillingMapper.OphalenUitProductie(barcodeID) - If productieData Is Nothing Then - productieData = AutomillingMapper.OphalenUitHistoriek(barcodeID) - If productieData Is Nothing Then - Throw New Exception("De productieData kon niet worden opgehaald uit automiling met barcode: " & barcodeID) + Public Sub verwerkRug(rug As Rework) + 'Naar Ardis sturen. + HerzagenOnderdelen(rug) + 'de opdracht resetten in de afkanter + resetOpdrachtAfkanter(rug.barcode) + End Sub + + Public Sub verwerkFront(front As Rework) + 'Naar Ardis sturen. + HerzagenOnderdelen(front) + 'de opdracht resetten in de afkanter + resetOpdrachtAfkanter(front.barcode) + End Sub + + Public Sub verwerkBodem(bodem As Rework) + 'Naar Ardis sturen. + HerzagenOnderdelen(bodem) + 'Productie tabel wordt nooit gewist op stemasC en insert moet dus niet worden uitgevoerd + End Sub + + Private Sub resetOpdrachtAfkanter(ByVal barcodeID As String) + Try + 'kijken of het wel moet worden opgeslagen + If Configs.geefVerwerkStatus Then + KantenbandMapper.resetOpdracht(barcodeID) End If - End If + Catch ex As Exception + Throw ex + End Try + End Sub - 'als het een uit een paar is updaten met de informatie uit de andere van het paar - If barcodeID2.Equals("") Then - productieData.aanpassenData(linksOfRechts, nieuwTrayNummer, slotNr, voorVoorraad, etiketTekst) - Else - Dim productieDataAndere As ZijkamerFreesProductieData - productieDataAndere = AutomillingMapper.OphalenUitProductie(barcodeID2) - If productieDataAndere Is Nothing Then - productieDataAndere = AutomillingMapper.OphalenUitHistoriek(barcodeID2) - If productieDataAndere Is Nothing Then - Throw New Exception("De productieData kon niet worden opgehaald uit automiling met barcode: " & barcodeID) + Private Sub HerzagenOnderdelen(rework As Rework, Optional trayNummer As String = "", Optional slotNummer As String = "") + Try + If rework.opslaanArdis Then + If rework.onderdeel.ToLower.Contains("zijkant") Then + Dim LinksEnOfRechts As String = rework.onderdeel.ToLower.Replace("zijkant", "").Replace("i", "").Replace("e", "").Trim.ToUpper + If LinksEnOfRechts.Equals("L") Or LinksEnOfRechts.Equals("LR") Then + HerzaagZijkant(rework, "L", trayNummer, slotNummer) + End If + If LinksEnOfRechts.Equals("R") Or LinksEnOfRechts.Equals("LR") Then + HerzaagZijkant(rework, "R", trayNummer, slotNummer) + End If + If LinksEnOfRechts.Equals("") Then + HerzaagZijkant(rework, "", trayNummer, slotNummer) + End If + Else + HerzaagOnderdeel(rework.barcode) End If End If - productieData.aanpassenData(linksOfRechts, nieuwTrayNummer, slotNr, voorVoorraad, etiketTekst, productieDataAndere, andereZijkantLinksOfRechts) - End If - productieDatas.Add(productieData.ShallowCopy) - Catch ex As Exception - Throw ex - End Try - End Sub + Catch ex As Exception + Throw ex + End Try + End Sub - Private Sub opslaanInAutomilling() - For Each data As ZijkamerFreesProductieData In productieDatas - If data Is Nothing Then - productieDatas.Clear() - Throw New Exception("Automilling data mag niet Nothing zijn om op te slaan") - End If - 'kijken of het wel moet worden opgeslagen - If Configs.geefVerwerkStatus Then - AutomillingMapper.opslaan(data) - End If - Next - productieDatas.Clear() - End Sub - - Private Sub HerzagenOnderdelen(rework As Rework, Optional trayNummer As String = "", Optional slotNummer As String = "") - Try - If rework.opslaanArdis Then - If rework.onderdeel.ToLower.Contains("zijkant") Then - Dim LinksEnOfRechts As String = rework.onderdeel.ToLower.Replace("zijkant", "").Replace("i", "").Replace("e", "").Trim.ToUpper - If LinksEnOfRechts.Equals("L") Or LinksEnOfRechts.Equals("LR") Then - HerzaagZijkant(rework, "L", trayNummer, slotNummer) + Private Sub MaakFreesOpdrachtInReworkTray(ByVal barcodeID As String, ByVal linksOfRechts As String, ByVal nieuwTrayNummer As String, ByVal slotNr As String, ByVal voorVoorraad As Boolean, etiketTekst As String, Optional barcodeID2 As String = "", Optional andereZijkantLinksOfRechts As String = "") + Try + _productieData = AutomillingMapper.OphalenUitProductie(barcodeID) + If _productieData Is Nothing Then + _productieData = AutomillingMapper.OphalenUitHistoriek(barcodeID) + If _productieData Is Nothing Then + Throw New Exception("De productieData kon niet worden opgehaald uit automiling met barcode: " & barcodeID) End If - If LinksEnOfRechts.Equals("R") Or LinksEnOfRechts.Equals("LR") Then - HerzaagZijkant(rework, "R", trayNummer, slotNummer) - End If - If LinksEnOfRechts.Equals("") Then - HerzaagZijkant(rework, "", trayNummer, slotNummer) - End If + End If + + 'als het een uit een paar is updaten met de informatie uit de andere van het paar + If barcodeID2.Equals("") Then + _productieData.aanpassenData(linksOfRechts, nieuwTrayNummer, slotNr, voorVoorraad, etiketTekst) Else - HerzaagOnderdeel(rework.barcode) + Dim productieDataAndere As ZijkamerFreesProductieData + productieDataAndere = AutomillingMapper.OphalenUitProductie(barcodeID2) + If productieDataAndere Is Nothing Then + productieDataAndere = AutomillingMapper.OphalenUitHistoriek(barcodeID2) + If productieDataAndere Is Nothing Then + Throw New Exception("De productieData kon niet worden opgehaald uit automiling met barcode: " & barcodeID) + End If + End If + _productieData.aanpassenData(linksOfRechts, nieuwTrayNummer, slotNr, voorVoorraad, etiketTekst, productieDataAndere, andereZijkantLinksOfRechts) End If - End If - Catch ex As Exception - Throw ex - End Try - End Sub + _productieDatas.Add(_productieData.ShallowCopy) + Catch ex As Exception + Throw ex + End Try + End Sub - Private Sub HerzaagZijkant(rework As Rework, linksOfRechts As String, trayNummer As String, slotNummer As String) - Try - Dim ardisData As ArdisData = ArdisMapper.OphalenData(rework.barcode) - If ardisData Is Nothing Then - Throw New Exception("Ardisdata kon niet worden opgevraagd voor rework met barcode: " & rework.barcode) - End If - 'als het een speciale zijkant is moeten we het corresponderende plankje vinden, aka A of B - Dim barcodes As List(Of String) - If Not (ardisData.isSpecialGegenereerd()) Then - barcodes = ArdisMapper.geefBarcode(ardisData.PartGroup, ardisData.PartExt02, ardisData.PartL, linksOfRechts) - Else - barcodes = ArdisMapper.geefBarcodeGegenereerdePlankjes(ardisData.PartGroup, ardisData.PartExt02, ardisData.PartL) - End If - - If barcodes Is Nothing Then - Throw New Exception("Er is iets foutgelopen bij het ophalen van de barcodes van de zijkanten uit de Ardis databank") - ElseIf barcodes.Count > 2 Then - Throw New Exception("Er zijn teveel barcodes gevonden bij het ophalen van de barcodes van de zijkanten uit de Ardis databank, Partgroup, PartExt02: " & ardisData.PartGroup & ", " & ardisData.PartExt02) - End If - For Each barcode In barcodes - HerzaagOnderdeel(barcode, trayNummer, slotNummer) + Private Sub opslaanInAutomilling() + For Each data As ZijkamerFreesProductieData In _productieDatas + If data Is Nothing Then + _productieDatas.Clear() + Throw New Exception("Automilling data mag niet Nothing zijn om op te slaan") + End If + 'kijken of het wel moet worden opgeslagen + If Configs.geefVerwerkStatus Then + AutomillingMapper.opslaan(data) + End If Next - Catch ex As Exception - Throw ex - End Try - End Sub + _productieDatas.Clear() + End Sub - Private Sub HerzaagOnderdeel(ByVal BarcodeID As String, Optional trayNummer As String = "", Optional slotNummer As String = "") - Try - Dim ardisData As ArdisData = ArdisMapper.OphalenData(BarcodeID) - ardisData.aanpassenDataRework() - 'kijken of het wel moet worden opgeslagen - If Configs.geefVerwerkStatus Then - ArdisTextMapper.opslaan(ItemType.REWORK, ardisData, trayNummer, slotNummer) - End If - Catch ex As Exception - Throw ex - End Try - End Sub + Private Sub HerzaagZijkant(rework As Rework, linksOfRechts As String, trayNummer As String, slotNummer As String) + Try + Dim ardisData As ArdisData = ArdisMapper.OphalenData(rework.barcode) + If ardisData Is Nothing Then + Throw New Exception("Ardisdata kon niet worden opgevraagd voor rework met barcode: " & rework.barcode) + End If + 'als het een speciale zijkant is moeten we het corresponderende plankje vinden, aka A of B + Dim barcodes As List(Of String) + If Not (ardisData.isSpecialGegenereerd()) Then + barcodes = ArdisMapper.geefBarcode(ardisData.PartGroup, ardisData.PartExt02, ardisData.PartL, linksOfRechts) + Else + barcodes = ArdisMapper.geefBarcodeGegenereerdePlankjes(ardisData.PartGroup, ardisData.PartExt02, ardisData.PartL) + End If - 'Private Sub ResetOpdrachtStemas(ByVal BarcodeID) - ' Dim controle As Boolean = StemasCMapper.bestaatBarcode(BarcodeID) - ' If Not controle Then - ' Dim stemasData As StemasData = StemasCMapper.OphalenData(BarcodeID) - ' StemasCMapper.Opslaan(stemasData) - ' End If - 'End Sub + If barcodes Is Nothing Then + Throw New Exception("Er is iets foutgelopen bij het ophalen van de barcodes van de zijkanten uit de Ardis databank") + ElseIf barcodes.Count > 2 Then + Throw New Exception("Er zijn teveel barcodes gevonden bij het ophalen van de barcodes van de zijkanten uit de Ardis databank, Partgroup, PartExt02: " & ardisData.PartGroup & ", " & ardisData.PartExt02) + End If + For Each barcode In barcodes + HerzaagOnderdeel(barcode, trayNummer, slotNummer) + Next + Catch ex As Exception + Throw ex + End Try + End Sub - Private Sub resetOpdrachtAfkanter(ByVal barcodeID As String) - Try - 'kijken of het wel moet worden opgeslagen - If Configs.geefVerwerkStatus Then - KantenbandMapper.resetOpdracht(barcodeID) - End If - Catch ex As Exception - Throw ex - End Try - End Sub + Private Sub HerzaagOnderdeel(ByVal BarcodeID As String, Optional trayNummer As String = "", Optional slotNummer As String = "") + Try + Dim ardisData As ArdisData = ArdisMapper.OphalenData(BarcodeID) + ardisData.aanpassenDataRework() + 'kijken of het wel moet worden opgeslagen + If Configs.geefVerwerkStatus Then + ArdisTextMapper.opslaan(ItemType.REWORK, ardisData, trayNummer, slotNummer) + End If + Catch ex As Exception + Throw ex + End Try + End Sub - Public Sub updateTray(tray As ReworkTray) - Try - For Each slot As Slot In tray.geefNietLegeSlots - If slot.zijkanten.Count > 0 Then - Dim linksOfRechts As String = slot.zijkanten(0).geefLinksOfRechts() - 'In automilling (technologica) laten verwerken - If slot.zijkanten.Count >= 2 Then - MaakFreesOpdrachtInReworkTray(slot.zijkanten(0).barcode, linksOfRechts, tray.nummer, slot.nummer, slot.zijkanten(0).voorVoorraad, slot.zijkanten(0).etiketTekst, slot.zijkanten(1).barcode, slot.zijkanten(1).geefLinksOfRechts()) - Else - MaakFreesOpdrachtInReworkTray(slot.zijkanten(0).barcode, linksOfRechts, tray.nummer, slot.nummer, slot.zijkanten(0).voorVoorraad, slot.zijkanten(0).etiketTekst) - End If - 'de naam van onderdeel naar "ONDERDEEL LR" zetten - 'als een van de twee niet in ardis wordt opgeslagen de andere automatisch ook niet! - slot.updateReworkOnderdeel() + Public Sub updateTray(tray As ReworkTray) + Try + For Each slot As Slot In tray.geefNietLegeSlots + If slot.zijkanten.Count > 0 Then + Dim linksOfRechts As String = slot.zijkanten(0).geefLinksOfRechts() - 'waarden in de rework invullen - slot.zijkanten(0).color = If(slot.type = SlotType.dubbel, productieData.colorDubbel, productieData.colorEnkel) - slot.zijkanten(0).length = productieData.length - slot.zijkanten(0).height = productieData.height + 'In automilling (technologica) laten verwerken + If slot.zijkanten.Count >= 2 Then + MaakFreesOpdrachtInReworkTray(slot.zijkanten(0).barcode, linksOfRechts, tray.nummer, slot.nummer, slot.zijkanten(0).voorVoorraad, slot.zijkanten(0).etiketTekst, slot.zijkanten(1).barcode, slot.zijkanten(1).geefLinksOfRechts()) + Else + MaakFreesOpdrachtInReworkTray(slot.zijkanten(0).barcode, linksOfRechts, tray.nummer, slot.nummer, slot.zijkanten(0).voorVoorraad, slot.zijkanten(0).etiketTekst) + End If - 'In ARDIS per zijkant twee planken zagen (er moet maar 1 zijkant worden meegegeven, onderdeel is naar LR gezet) - HerzagenOnderdelen(slot.zijkanten(0), tray.nummer, slot.nummer) - End If - Next - Catch ex As Exception - Throw ex - End Try - End Sub + 'de naam van onderdeel naar "ONDERDEEL LR" zetten + 'als een van de twee niet in ardis wordt opgeslagen de andere automatisch ook niet! + slot.updateReworkOnderdeel() - Public Sub verwerkTray(tray As ReworkTray) - Try - For Each slot As Slot In tray.geefNietLegeSlots - If slot.zijkanten.Count > 0 Then + 'waarden in de rework invullen + slot.zijkanten(0).color = If(slot.type = SlotType.dubbel, _productieData.colorDubbel, _productieData.colorEnkel) + slot.zijkanten(0).length = _productieData.length + slot.zijkanten(0).height = _productieData.height - opslaanInAutomilling() + 'In ARDIS per zijkant twee planken zagen (er moet maar 1 zijkant worden meegegeven, onderdeel is naar LR gezet) + HerzagenOnderdelen(slot.zijkanten(0), tray.nummer, slot.nummer) + End If + Next + Catch ex As Exception + Throw ex + End Try + End Sub - For Each zijkant As Rework In slot.zijkanten - 'de opdracht resetten in de afkanter - resetOpdrachtAfkanter(zijkant.barcode) - Next + Public Sub verwerkTray(tray As ReworkTray) + Try + For Each slot As Slot In tray.geefNietLegeSlots + If slot.zijkanten.Count > 0 Then - 'als het een paar is de andere van het paar verwijderen - slot.verwijderTweedeVanPaar() + opslaanInAutomilling() - End If - Next - Catch ex As Exception - Throw ex - End Try - End Sub + For Each zijkant As Rework In slot.zijkanten + 'de opdracht resetten in de afkanter + resetOpdrachtAfkanter(zijkant.barcode) + Next - Public Sub verwerkRug(rug As Rework) - Try - 'naar Ardis sturen - HerzagenOnderdelen(rug) - 'de opdracht resetten in de afkanter - resetOpdrachtAfkanter(rug.barcode) - Catch ex As Exception - Throw ex - End Try - End Sub + 'als het een paar is de andere van het paar verwijderen + slot.verwijderTweedeVanPaar() - Public Sub verwerkFront(front As Rework) - Try - 'naar Ardis sturen - HerzagenOnderdelen(front) - 'de opdracht resetten in de afkanter - resetOpdrachtAfkanter(front.barcode) - Catch ex As Exception - Throw ex - End Try - End Sub + End If + Next + Catch ex As Exception + Throw ex + End Try + End Sub - Public Sub verwerkBodem(bodem As Rework) - Try - 'naar Ardis sturen - HerzagenOnderdelen(bodem) - 'productie tabel wordt nooit gewist op stemasC en insert moet dus niet worden uitgevoerd - ' ResetOpdrachtStemas(bodem.barcode) - Catch ex As Exception - Throw ex - End Try - End Sub - -End Class + End Class +End Namespace \ No newline at end of file Index: TAOR-rework-bugfixing/TAOR rework/Rework/Slot.vb =================================================================== diff -u -r1596 -r1597 --- TAOR-rework-bugfixing/TAOR rework/Rework/Slot.vb (.../Slot.vb) (revision 1596) +++ TAOR-rework-bugfixing/TAOR rework/Rework/Slot.vb (.../Slot.vb) (revision 1597) @@ -1,126 +1,128 @@ -Public Class Slot - Private _type As SlotType - Private _zijkanten As List(Of Rework) - Private _zijkantenSpecial As List(Of ArdisData) - Private _nummer As Integer +Namespace Rework + Public Class Slot + Private _type As SlotType + Private _zijkanten As List(Of Rework) + Private _zijkantenSpecial As List(Of ArdisData) + Private _nummer As Integer - Public Sub New() - _zijkanten = New List(Of Rework) - _zijkantenSpecial = New List(Of ArdisData) - End Sub + Public Sub New() + _zijkanten = New List(Of Rework) + _zijkantenSpecial = New List(Of ArdisData) + End Sub - Public Sub New(nummer As Integer) - _zijkanten = New List(Of Rework) - _zijkantenSpecial = New List(Of ArdisData) - controleerNummer(nummer) - _nummer = nummer - End Sub + Public Sub New(nummer As Integer) + _zijkanten = New List(Of Rework) + _zijkantenSpecial = New List(Of ArdisData) + controleerNummer(nummer) + _nummer = nummer + End Sub - Public Property type As SlotType - Get - Return _type - End Get - Set(ByVal value As SlotType) - _type = value - End Set - End Property + Public Property type As SlotType + Get + Return _type + End Get + Set(ByVal value As SlotType) + _type = value + End Set + End Property - Public ReadOnly Property zijkanten As List(Of Rework) - Get - Return New List(Of Rework)(_zijkanten) - End Get - End Property + Public ReadOnly Property zijkanten As List(Of Rework) + Get + Return New List(Of Rework)(_zijkanten) + End Get + End Property - Public ReadOnly Property zijkantenSpeciaal As List(Of ArdisData) - Get - Return New List(Of ArdisData)(_zijkantenSpecial) - End Get - End Property + Public ReadOnly Property zijkantenSpeciaal As List(Of ArdisData) + Get + Return New List(Of ArdisData)(_zijkantenSpecial) + End Get + End Property - Public Property nummer As Integer - Get - Return _nummer - End Get - Set(value As Integer) - controleerNummer(value) - _nummer = value - End Set - End Property + Public Property nummer As Integer + Get + Return _nummer + End Get + Set(value As Integer) + controleerNummer(value) + _nummer = value + End Set + End Property - Public Sub voegZijkantToe(ByVal zijkant As Rework) - If (type = SlotType.enkel) And (zijkanten.Count < 1) Then - _zijkanten.Add(zijkant) - ElseIf _zijkanten.Count < 2 Then - _zijkanten.Add(zijkant) - Else - Throw New Exception("Het slot zit al vol") - End If - End Sub + Public Sub voegZijkantToe(ByVal zijkant As Rework) + If (type = SlotType.enkel) And (zijkanten.Count < 1) Then + _zijkanten.Add(zijkant) + ElseIf _zijkanten.Count < 2 Then + _zijkanten.Add(zijkant) + Else + Throw New Exception("Het slot zit al vol") + End If + End Sub - Public Sub voegZijkantToe(ByVal zijkant As List(Of Rework)) - If (type = SlotType.enkel) And (zijkanten.Count < 1) Then - _zijkanten.AddRange(zijkant) - ElseIf _zijkanten.Count < 2 Then - _zijkanten.AddRange(zijkant) - Else - Throw New Exception("Het slot zit al vol") - End If - End Sub + Public Sub voegZijkantToe(ByVal zijkant As List(Of Rework)) + If (type = SlotType.enkel) And (zijkanten.Count < 1) Then + _zijkanten.AddRange(zijkant) + ElseIf _zijkanten.Count < 2 Then + _zijkanten.AddRange(zijkant) + Else + Throw New Exception("Het slot zit al vol") + End If + End Sub - 'special zijkant - Public Sub voegZijkantToe(ByRef zijkant As List(Of ArdisData)) - If _zijkantenSpecial.Count < 2 Then - For Each data As ArdisData In zijkant - data.KamerfreesSlotNr = _nummer + 'special zijkant + Public Sub voegZijkantToe(ByRef zijkant As List(Of ArdisData)) + If _zijkantenSpecial.Count < 2 Then + For Each data As ArdisData In zijkant + data.KamerfreesSlotNr = _nummer + Next + _zijkantenSpecial.AddRange(zijkant) + Else + Throw New Exception("Het slot zit al vol") + End If + End Sub + + Public Overrides Function ToString() As String + Dim returnString As String = "TYPE SLOT: " & _type & " ---ZIJKANT: " + For Each zijkant As Rework In _zijkanten + returnString += vbNewLine & vbTab & zijkant.ToString Next - _zijkantenSpecial.AddRange(zijkant) - Else - Throw New Exception("Het slot zit al vol") - End If - End Sub + Return returnString + End Function - Public Overrides Function ToString() As String - Dim returnString As String = "TYPE SLOT: " & _type & " ---ZIJKANT: " - For Each zijkant As Rework In _zijkanten - returnString += vbNewLine & vbTab & zijkant.ToString - Next - Return returnString - End Function - - Public Sub updateReworkOnderdeel() - If _type = SlotType.dubbel Then - If _zijkanten.Count > 0 Then - 'updaten van veld opslaan ardis in beide - If Not _zijkanten(1).opslaanArdis Then - zijkanten(0).opslaanArdis = False - ElseIf Not _zijkanten(0).opslaanArdis Then - zijkanten(1).opslaanArdis = False + Public Sub updateReworkOnderdeel() + If _type = SlotType.dubbel Then + If _zijkanten.Count > 0 Then + 'updaten van veld opslaan ardis in beide + If Not _zijkanten(1).opslaanArdis Then + zijkanten(0).opslaanArdis = False + ElseIf Not _zijkanten(0).opslaanArdis Then + zijkanten(1).opslaanArdis = False + End If + 'duidelijk maken dat beide tot een paar behoren + _zijkanten(0).onderdeel = "ZIJKANT LR" + _zijkanten(1).onderdeel = "ZIJKANT LR" End If - 'duidelijk maken dat beide tot een paar behoren - _zijkanten(0).onderdeel = "ZIJKANT LR" - _zijkanten(1).onderdeel = "ZIJKANT LR" End If - End If - End Sub + End Sub - Public Sub verwijderTweedeVanPaar() - If _zijkanten.Count > 1 Then - _zijkanten.RemoveAt(1) - End If - End Sub + Public Sub verwijderTweedeVanPaar() + If _zijkanten.Count > 1 Then + _zijkanten.RemoveAt(1) + End If + End Sub - Private Sub controleerNummer(nummer As Integer) - If nummer <= 0 Then - Throw New Exception("Slotnummer moet groter zijn dan 0 (nummer, geen index)") - End If - End Sub + Private Sub controleerNummer(nummer As Integer) + If nummer <= 0 Then + Throw New Exception("Slotnummer moet groter zijn dan 0 (nummer, geen index)") + End If + End Sub - Public Function ShallowCopy() As Slot - Return DirectCast(Me.MemberwiseClone(), Slot) - End Function -End Class + Public Function ShallowCopy() As Slot + Return DirectCast(Me.MemberwiseClone(), Slot) + End Function + End Class -Public Enum SlotType - enkel = 0 - dubbel = 1 -End Enum \ No newline at end of file + Public Enum SlotType + enkel = 0 + dubbel = 1 + End Enum +End Namespace \ No newline at end of file Index: TAOR-rework-bugfixing/TAOR rework/Rework/ReworkTray.vb =================================================================== diff -u -r1596 -r1597 --- TAOR-rework-bugfixing/TAOR rework/Rework/ReworkTray.vb (.../ReworkTray.vb) (revision 1596) +++ TAOR-rework-bugfixing/TAOR rework/Rework/ReworkTray.vb (.../ReworkTray.vb) (revision 1597) @@ -1,147 +1,148 @@ 'robin de bock 04/08/2017 -Public Class ReworkTray - Private _nummer As String - Private _slots As List(Of Slot) - Private reworktrayslotRep As ReworkTraySlotRepository - Public Sub New(ByVal slots As List(Of Slot)) - _slots = slots - _nummer = AutomillingMapper.GeefNieuwTrayNummer - End Sub +Namespace Rework + Public Class ReworkTray + Private _nummer As String + Private _slots As List(Of Slot) + Private reworktrayslotRep As ReworkTraySlotRepository + Public Sub New(ByVal slots As List(Of Slot)) + _slots = slots + _nummer = AutomillingMapper.GeefNieuwTrayNummer + End Sub - Public Property nummer As String - Get - Return _nummer - End Get - Set(ByVal value As String) - If value = Nothing Or CInt(value) <= 0 Then - Throw New Exception("Ongeldig traynummer") - End If - _nummer = value - End Set - End Property + Public Property nummer As String + Get + Return _nummer + End Get + Set(ByVal value As String) + If value = Nothing Or CInt(value) <= 0 Then + Throw New Exception("Ongeldig traynummer") + End If + _nummer = value + End Set + End Property - Public ReadOnly Property slots As List(Of Slot) - Get - Return New List(Of Slot)(_slots) - End Get - End Property + Public ReadOnly Property slots As List(Of Slot) + Get + Return New List(Of Slot)(_slots) + End Get + End Property - Public Function parenVol() As Boolean - For Each slot As Slot In _slots - If slot.type = SlotType.dubbel Then - If (slot.zijkanten Is Nothing OrElse slot.zijkanten.Count <= 0) And (slot.zijkantenSpeciaal Is Nothing OrElse slot.zijkantenSpeciaal.Count <= 0) Then - Return False + Public Function parenVol() As Boolean + For Each slot As Slot In _slots + If slot.type = SlotType.dubbel Then + If (slot.zijkanten Is Nothing OrElse slot.zijkanten.Count <= 0) And (slot.zijkantenSpeciaal Is Nothing OrElse slot.zijkantenSpeciaal.Count <= 0) Then + Return False + End If End If - End If - Next - Return True - End Function + Next + Return True + End Function - Public Function enkelVol() As Boolean - For Each slot As Slot In _slots - If slot.type = SlotType.enkel Then - If slot.zijkanten Is Nothing OrElse slot.zijkanten.Count <= 0 And (slot.zijkantenSpeciaal Is Nothing OrElse slot.zijkantenSpeciaal.Count <= 0) Then - Return False + Public Function enkelVol() As Boolean + For Each slot As Slot In _slots + If slot.type = SlotType.enkel Then + If slot.zijkanten Is Nothing OrElse slot.zijkanten.Count <= 0 And (slot.zijkantenSpeciaal Is Nothing OrElse slot.zijkantenSpeciaal.Count <= 0) Then + Return False + End If End If - End If - Next - Return True - End Function + Next + Return True + End Function - Public Sub voegPaarToe(ByVal paar As Rework()) - For Each Slot In slots - If Slot.type = SlotType.dubbel Then - If Slot.zijkanten Is Nothing OrElse Slot.zijkanten.Count <= 0 Then - Dim lijstPaar As New List(Of Rework) - lijstPaar.Add(paar(0)) - lijstPaar.Add(paar(1)) + Public Sub voegPaarToe(ByVal paar As Rework()) + For Each Slot In slots + If Slot.type = SlotType.dubbel Then + If Slot.zijkanten Is Nothing OrElse Slot.zijkanten.Count <= 0 Then + Dim lijstPaar As New List(Of Rework) + lijstPaar.Add(paar(0)) + lijstPaar.Add(paar(1)) - Slot.voegZijkantToe(lijstPaar) - Exit For + Slot.voegZijkantToe(lijstPaar) + Exit For + End If End If - End If - Next - End Sub + Next + End Sub - Public Sub voegEnkelToe(ByVal enkel As Rework) - For Each Slot In slots - If Slot.type = SlotType.enkel Then - If Slot.zijkanten Is Nothing OrElse Slot.zijkanten.Count <= 0 Then - Slot.voegZijkantToe(enkel) - Exit For + Public Sub voegEnkelToe(ByVal enkel As Rework) + For Each Slot In slots + If Slot.type = SlotType.enkel Then + If Slot.zijkanten Is Nothing OrElse Slot.zijkanten.Count <= 0 Then + Slot.voegZijkantToe(enkel) + Exit For + End If End If - End If - Next - End Sub + Next + End Sub - Public Sub voegPaarToe(ByRef paar As List(Of ArdisData)) - For Each Slot In slots - If Slot.type = SlotType.dubbel Then - If Slot.zijkantenSpeciaal Is Nothing OrElse Slot.zijkantenSpeciaal.Count <= 0 Then - Slot.voegZijkantToe(paar) - For Each data As ArdisData In paar - data.KamerfreesTrayId = _nummer - Next - Exit For + Public Sub voegPaarToe(ByRef paar As List(Of ArdisData)) + For Each Slot In slots + If Slot.type = SlotType.dubbel Then + If Slot.zijkantenSpeciaal Is Nothing OrElse Slot.zijkantenSpeciaal.Count <= 0 Then + Slot.voegZijkantToe(paar) + For Each data As ArdisData In paar + data.KamerfreesTrayId = _nummer + Next + Exit For + End If End If - End If - Next - End Sub + Next + End Sub - Public Sub voegEnkelToe(ByRef enkel As List(Of ArdisData)) - For Each Slot In slots - If Slot.type = SlotType.enkel Then - If Slot.zijkantenSpeciaal Is Nothing OrElse Slot.zijkantenSpeciaal.Count <= 0 Then - Slot.voegZijkantToe(enkel) - For Each data As ArdisData In enkel - data.KamerfreesTrayId = _nummer - Next - Exit For + Public Sub voegEnkelToe(ByRef enkel As List(Of ArdisData)) + For Each Slot In slots + If Slot.type = SlotType.enkel Then + If Slot.zijkantenSpeciaal Is Nothing OrElse Slot.zijkantenSpeciaal.Count <= 0 Then + Slot.voegZijkantToe(enkel) + For Each data As ArdisData In enkel + data.KamerfreesTrayId = _nummer + Next + Exit For + End If End If - End If - Next - End Sub + Next + End Sub - Public Function geefNietLegeSlots() As List(Of Slot) - Dim nietLeeg As New List(Of Slot) - For Each slot As Slot In _slots - If Not ((slot.zijkanten Is Nothing OrElse slot.zijkanten.Count <= 0) And (slot.zijkantenSpeciaal Is Nothing OrElse slot.zijkantenSpeciaal.Count <= 0)) Then - nietLeeg.Add(slot) - End If - Next - Return nietLeeg - End Function + Public Function geefNietLegeSlots() As List(Of Slot) + Dim nietLeeg As New List(Of Slot) + For Each slot As Slot In _slots + If Not ((slot.zijkanten Is Nothing OrElse slot.zijkanten.Count <= 0) And (slot.zijkantenSpeciaal Is Nothing OrElse slot.zijkantenSpeciaal.Count <= 0)) Then + nietLeeg.Add(slot) + End If + Next + Return nietLeeg + End Function - Public Function geefNietLegeParenSlots() As List(Of Slot) - Dim nietLeegEnPaar As New List(Of Slot) - For Each slot As Slot In _slots - If Not ((slot.zijkanten Is Nothing OrElse slot.zijkanten.Count <= 0) And (slot.zijkantenSpeciaal Is Nothing OrElse slot.zijkantenSpeciaal.Count <= 0)) And slot.type = SlotType.dubbel Then - nietLeegEnPaar.Add(slot) - End If - Next - Return nietLeegEnPaar - End Function - - Public Overrides Function ToString() As String - Dim returnString As String = "TRAYNUMMER: " & _nummer & vbNewLine - Dim teller As Integer = 1 - For Each Slot As Slot In slots - returnString += "SLOT NUMMER: " & teller & " === " & Slot.ToString + vbNewLine - teller += 1 - Next - Return returnString - End Function - - Public Function geefReworkTrayEnSlotNummerBijBarcode(barcode As String) As String() - For Each slot As Slot In geefNietLegeSlots() - For Each zijkant As ArdisData In slot.zijkantenSpeciaal - If zijkant.PartCalc.Equals(barcode) Then - Return {nummer, CStr(slot.nummer)} + Public Function geefNietLegeParenSlots() As List(Of Slot) + Dim nietLeegEnPaar As New List(Of Slot) + For Each slot As Slot In _slots + If Not ((slot.zijkanten Is Nothing OrElse slot.zijkanten.Count <= 0) And (slot.zijkantenSpeciaal Is Nothing OrElse slot.zijkantenSpeciaal.Count <= 0)) And slot.type = SlotType.dubbel Then + nietLeegEnPaar.Add(slot) End If Next - Next - Return Nothing - End Function + Return nietLeegEnPaar + End Function -End Class + Public Overrides Function ToString() As String + Dim returnString As String = "TRAYNUMMER: " & _nummer & vbNewLine + Dim teller As Integer = 1 + For Each Slot As Slot In slots + returnString += "SLOT NUMMER: " & teller & " === " & Slot.ToString + vbNewLine + teller += 1 + Next + Return returnString + End Function + Public Function geefReworkTrayEnSlotNummerBijBarcode(barcode As String) As String() + For Each slot As Slot In geefNietLegeSlots() + For Each zijkant As ArdisData In slot.zijkantenSpeciaal + If zijkant.PartCalc.Equals(barcode) Then + Return {nummer, CStr(slot.nummer)} + End If + Next + Next + Return Nothing + End Function + + End Class +End Namespace \ No newline at end of file Index: TAOR-rework-bugfixing/TAOR rework/Configuraties/ReworkRedenenRepository.vb =================================================================== diff -u -r1596 -r1597 --- TAOR-rework-bugfixing/TAOR rework/Configuraties/ReworkRedenenRepository.vb (.../ReworkRedenenRepository.vb) (revision 1596) +++ TAOR-rework-bugfixing/TAOR rework/Configuraties/ReworkRedenenRepository.vb (.../ReworkRedenenRepository.vb) (revision 1597) @@ -1,4 +1,6 @@ -Public Class ReworkRedenenRepository +Imports TA_OR_rework.Rework + +Public Class ReworkRedenenRepository Private _reworkOnderdelen As List(Of ReworkOnderdeel) Public Sub New() Index: TAOR-rework-bugfixing/TAOR rework/Rework/ReworkRepository.vb =================================================================== diff -u -r1596 -r1597 --- TAOR-rework-bugfixing/TAOR rework/Rework/ReworkRepository.vb (.../ReworkRepository.vb) (revision 1596) +++ TAOR-rework-bugfixing/TAOR rework/Rework/ReworkRepository.vb (.../ReworkRepository.vb) (revision 1597) @@ -1,112 +1,114 @@ -Public Class ReworkRepository - Private _reworks As List(Of Rework) +Namespace Rework + Public Class ReworkRepository + Private _reworks As List(Of Rework) - Public Sub New() - _reworks = New List(Of Rework) - End Sub + Public Sub New() + _reworks = New List(Of Rework) + End Sub #Region "properties" - Public ReadOnly Property getReworks() As List(Of Rework) - Get - Return New List(Of Rework)(_reworks) - End Get - End Property + Public ReadOnly Property getReworks() As List(Of Rework) + Get + Return New List(Of Rework)(_reworks) + End Get + End Property - Public ReadOnly Property aantalReworks As Integer - Get - Return _reworks.Count - End Get - End Property + Public ReadOnly Property aantalReworks As Integer + Get + Return _reworks.Count + End Get + End Property #End Region - Public Sub addRework(ByVal rework As Rework) - _reworks.Add(rework) - End Sub + Public Sub addRework(ByVal rework As Rework) + _reworks.Add(rework) + End Sub - Public Sub verwijderRework(rework As Rework) - _reworks.Remove(rework) - End Sub + Public Sub verwijderRework(rework As Rework) + _reworks.Remove(rework) + End Sub - Public Sub verwijderAlleReworks() - _reworks = Nothing - _reworks = New List(Of Rework) - End Sub + Public Sub verwijderAlleReworks() + _reworks = Nothing + _reworks = New List(Of Rework) + End Sub - Public Function bestaatRework(ByVal barcode As String) - For Each rework As Rework In _reworks - If rework.barcode.Equals(barcode) Then - Return True - End If - Next - Return False - End Function + Public Function bestaatRework(ByVal barcode As String) + For Each rework As Rework In _reworks + If rework.barcode.Equals(barcode) Then + Return True + End If + Next + Return False + End Function - Public Function geefRework(ByVal barcode As String) - For Each rework As Rework In _reworks - If rework.barcode.Equals(barcode) Then - Return rework - End If - Next - Throw New Exception("De rework bestaat niet") - Return False - End Function - - Public Sub wijzigOpslaanArdis(rework As Rework) - Dim bestaat As Boolean = False - For Each reworkVanList As Rework In _reworks - If rework.Equals(reworkVanList) Then - reworkVanList.opslaanArdis = Not reworkVanList.opslaanArdis - bestaat = True - End If - Next - If Not bestaat Then + Public Function geefRework(ByVal barcode As String) + For Each rework As Rework In _reworks + If rework.barcode.Equals(barcode) Then + Return rework + End If + Next Throw New Exception("De rework bestaat niet") - End If - End Sub + Return False + End Function - Public Sub updateAllReworks() - For Each rework As Rework In _reworks - Dim ardisData As ArdisData = ArdisMapper.OphalenData(rework.barcode) - If ardisData Is Nothing Then - Throw New Exception("De barcode '" & rework.barcode & "' werd niet gevonden in Ardis") + Public Sub wijzigOpslaanArdis(rework As Rework) + Dim bestaat As Boolean = False + For Each reworkVanList As Rework In _reworks + If rework.Equals(reworkVanList) Then + reworkVanList.opslaanArdis = Not reworkVanList.opslaanArdis + bestaat = True + End If + Next + If Not bestaat Then + Throw New Exception("De rework bestaat niet") End If - If Not (ardisData.isSpecialGegenereerd()) Then - CacheMapper.updateRework(rework) - Else - 'de rework bestaat uit een gegenereerde plank, dus we moeten de barcode van de buitenste (originele) gebruiken om deze te updaten - Dim barcodes As List(Of String) = ArdisMapper.geefBarcodeOrigineleBijGegenereerdePlankjes(ardisData.PartGroup, ardisData.PartExt02, ardisData.PartL) + End Sub - If barcodes Is Nothing OrElse barcodes.Count <= 0 Then - Throw New Exception("Er is iets foutgelopen bij het ophalen van de barcodes van de zijkanten uit de Ardis databank") - ElseIf barcodes.Count > 4 Then - Throw New Exception("Er zijn teveel barcodes gevonden bij het ophalen van de barcodes van de zijkanten uit de Ardis databank, Partgroup, PartExt02: " & ardisData.PartGroup & ", " & ardisData.PartExt02) + Public Sub updateAllReworks() + For Each rework As Rework In _reworks + Dim ardisData As ArdisData = ArdisMapper.OphalenData(rework.barcode) + If ardisData Is Nothing Then + Throw New Exception("De barcode '" & rework.barcode & "' werd niet gevonden in Ardis") End If + If Not (ardisData.isSpecialGegenereerd()) Then + CacheMapper.updateRework(rework) + Else + 'de rework bestaat uit een gegenereerde plank, dus we moeten de barcode van de buitenste (originele) gebruiken om deze te updaten + Dim barcodes As List(Of String) = ArdisMapper.geefBarcodeOrigineleBijGegenereerdePlankjes(ardisData.PartGroup, ardisData.PartExt02, ardisData.PartL) - For index = 0 To barcodes.Count - 1 - Dim ardisdataLinksOfRechts As ArdisData = ArdisMapper.OphalenData(barcodes(index)) - If ardisdataLinksOfRechts.geefLinksOfRechts().Equals(rework.geefLinksOfRechts()) Then - If CacheMapper.geefdatareader(Kolommen.barcode, barcodes(index)).HasRows() Then - CacheMapper.updateRework(rework, barcodes(index)) - Exit For - End If + If barcodes Is Nothing OrElse barcodes.Count <= 0 Then + Throw New Exception("Er is iets foutgelopen bij het ophalen van de barcodes van de zijkanten uit de Ardis databank") + ElseIf barcodes.Count > 4 Then + Throw New Exception("Er zijn teveel barcodes gevonden bij het ophalen van de barcodes van de zijkanten uit de Ardis databank, Partgroup, PartExt02: " & ardisData.PartGroup & ", " & ardisData.PartExt02) End If - Next - End If - Next - CacheMapper.sluitDataReader() - End Sub + For index = 0 To barcodes.Count - 1 + Dim ardisdataLinksOfRechts As ArdisData = ArdisMapper.OphalenData(barcodes(index)) + If ardisdataLinksOfRechts.geefLinksOfRechts().Equals(rework.geefLinksOfRechts()) Then + If CacheMapper.geefdatareader(Kolommen.barcode, barcodes(index)).HasRows() Then + CacheMapper.updateRework(rework, barcodes(index)) + Exit For + End If + End If + Next - Public Sub slaAlleReworkRedenenOp() - For Each rework As Rework In _reworks - Dim ardisData As ArdisData = ArdisMapper.OphalenData(rework.barcode) - If Not (ardisData.isSpecialGegenereerd()) Then - CacheMapper.opslaanReworkReden(rework) - End If - Next - CacheMapper.sluitDataReader() - End Sub + End If + Next + CacheMapper.sluitDataReader() + End Sub -End Class + Public Sub slaAlleReworkRedenenOp() + For Each rework As Rework In _reworks + Dim ardisData As ArdisData = ArdisMapper.OphalenData(rework.barcode) + If Not (ardisData.isSpecialGegenereerd()) Then + CacheMapper.opslaanReworkReden(rework) + End If + Next + CacheMapper.sluitDataReader() + End Sub + + End Class +End Namespace \ No newline at end of file Index: TAOR-rework-bugfixing/TAOR rework/formulieren/FormReworkTrayPrinter.vb =================================================================== diff -u -r1596 -r1597 --- TAOR-rework-bugfixing/TAOR rework/formulieren/FormReworkTrayPrinter.vb (.../FormReworkTrayPrinter.vb) (revision 1596) +++ TAOR-rework-bugfixing/TAOR rework/formulieren/FormReworkTrayPrinter.vb (.../FormReworkTrayPrinter.vb) (revision 1597) @@ -1,4 +1,5 @@ Imports System.Text +Imports TA_OR_rework.Rework Public Class FormReworkTrayPrinter Private _aantalTrays As Integer Index: TAOR-rework-bugfixing/TAOR rework/Configuraties/ReworkRedenenMapperXML.vb =================================================================== diff -u -r1596 -r1597 --- TAOR-rework-bugfixing/TAOR rework/Configuraties/ReworkRedenenMapperXML.vb (.../ReworkRedenenMapperXML.vb) (revision 1596) +++ TAOR-rework-bugfixing/TAOR rework/Configuraties/ReworkRedenenMapperXML.vb (.../ReworkRedenenMapperXML.vb) (revision 1597) @@ -1,5 +1,6 @@ Imports System.IO Imports System.Xml.Serialization +Imports TA_OR_rework.Rework Public Module ReworkRedenenMapperXML Public Sub writeToFile(reworkonderdelen As List(Of ReworkOnderdeel))