Attribute VB_Name = "ModuloGestPropertyGrid"
'Option Explicit
'
'
''NOTA impostando il pCapitonOrId As Variant NON FUNZIONA!!!!
'   'Public Function GetValItemPropertyGrid(pPrtGrid As PropertyGrid, pCapitonOrId As Variant) As String
'   '   'Finds the PropertyGridItem with a Caption or ID
'   '   Dim Item As PropertyGridItem
'   '      Set Item = pPrtGrid.FindItem(pCapitonOrId)
'   '      GetValItemPropertyGrid = Item.Value
'   'End Function
'   'Public Sub SetValItemPropertyGrid(pPrtGrid As PropertyGrid, pCapitonOrId As Variant, pNewValue As String)
'   '   'Finds the PropertyGridItem with a Caption or ID and sets the new Value
'   '   Dim Item As PropertyGridItem
'   '      Set Item = pPrtGrid.FindItem(pCapitonOrId)
'   '      Item.Value = pNewValue
'   'End Sub
'
'
'
'Public Sub SetValInPropertyGridPlanning(pPropertyGrid As PropertyGrid, RS As ADODB.Recordset)
'   'Dim ChildItem As PropertyGridItem
'   Dim i As Integer
'   Dim yCat As Byte
'
'   With pPropertyGrid
'
'      For yCat = 1 To .Categories.Count 'Ciclo sulle Categorie (macro raggruppamenti)
'
'         For i = 1 To .Categories(yCat).Childs.Count  'Ciclo sui Parametri della cateria in questione
'
'            If .Categories(yCat).Tag = "OPZIONI_PLANNING" Then 'Impostando il TAG sulle catergorie evito di cilcare parametri non di pertinenza e guadagno tempo
'
'                  'TIPO DI INCOLONNAMENTO (0=SOLO GIORNI; 1=OPERATORI; 2=RISORSE)
'                     If InStr(1, .Categories(yCat).Childs.Item(i).Tag, "PLCOLONN") > 0 Then
'                         .Categories(yCat).Childs.Item(i).Value = RS!PLCOLONN: GoTo GOTONEXT
'                     End If
'
'                  'TIPO DI COLORAZIONE ATTIVITA' (1=OPERATORI; 2=RISORSE)
'                     If InStr(1, .Categories(yCat).Childs.Item(i).Tag, "PLCOLORE") > 0 Then
'                         .Categories(yCat).Childs.Item(i).Value = RS!PLCOLORE: GoTo GOTONEXT
'                     End If
'
'                  'TIPO DI VISUALIZZAZIONE (0=GIORNO; 1=SETT. LAVORATIVA; 2=SETT. COMPLETA; 3=MESE)
'                     If InStr(1, .Categories(yCat).Childs.Item(i).Tag, "PL__VIEW") > 0 Then
'                         .Categories(yCat).Childs.Item(i).Value = RS!PL__VIEW: GoTo GOTONEXT
'                     End If
'
'                  'INIZIO ORA DI LAVORO
'                     If InStr(1, .Categories(yCat).Childs.Item(i).Tag, "PLSTATIM") > 0 Then
'                         .Categories(yCat).Childs.Item(i).Value = Format(RS!PLSTATIM, "hh:nn"): GoTo GOTONEXT
'                         .Categories(yCat).Childs.Item(i).Value = Replace(.Categories(yCat).Childs.Item(i).Value, ".", ":")
'                     End If
'
'                  'FINE ORA DI LAVORO
'                     If InStr(1, .Categories(yCat).Childs.Item(i).Tag, "PLENDTIM") > 0 Then
'                         .Categories(yCat).Childs.Item(i).Value = Format(RS!PLENDTIM, "hh:nn"): GoTo GOTONEXT
'                         .Categories(yCat).Childs.Item(i).Value = Replace(.Categories(yCat).Childs.Item(i).Value, ".", ":")
'                     End If
'
'                  'TIME SCALE DEL PLANNING (10 MINUTI; 15 MINUTI; 30 MINUTI; 60 MINUTI)
'                     If InStr(1, .Categories(yCat).Childs.Item(i).Tag, "PLTIMSCA") > 0 Then
'                         .Categories(yCat).Childs.Item(i).Value = RS!PLTIMSCA: GoTo GOTONEXT
'                     End If
'
'                  'LARGHEZZA MINIMA COLONNE (0=STANDARD; OPPURE DA 10 A 100)
'                     If InStr(1, .Categories(yCat).Childs.Item(i).Tag, "PLCOLWID") > 0 Then
'                        .Categories(yCat).Childs.Item(i).Value = RS!PLCOLWID: GoTo GOTONEXT
'                     End If
'
'                  'GIORNI DI LAVORO DELLA SETTIMANA
'                     If InStr(1, .Categories(yCat).Childs.Item(i).Tag, "PLWORKWE;LU") > 0 Then
'                        .Categories(yCat).Childs.Item(i).Value = IIf(InStr(1, RS!PLWORKWE, "Monday") > 0, True, False): GoTo GOTONEXT
'                     End If
'                     If InStr(1, .Categories(yCat).Childs.Item(i).Tag, "PLWORKWE;MA") > 0 Then
'                        .Categories(yCat).Childs.Item(i).Value = IIf(InStr(1, RS!PLWORKWE, "Tuesday") > 0, True, False): GoTo GOTONEXT
'                     End If
'                     If InStr(1, .Categories(yCat).Childs.Item(i).Tag, "PLWORKWE;ME") > 0 Then
'                        .Categories(yCat).Childs.Item(i).Value = IIf(InStr(1, RS!PLWORKWE, "Wednesday") > 0, True, False): GoTo GOTONEXT
'                     End If
'                     If InStr(1, .Categories(yCat).Childs.Item(i).Tag, "PLWORKWE;GI") > 0 Then
'                        .Categories(yCat).Childs.Item(i).Value = IIf(InStr(1, RS!PLWORKWE, "Thursday") > 0, True, False): GoTo GOTONEXT
'                     End If
'                     If InStr(1, .Categories(yCat).Childs.Item(i).Tag, "PLWORKWE;VE") > 0 Then
'                        .Categories(yCat).Childs.Item(i).Value = IIf(InStr(1, RS!PLWORKWE, "Friday") > 0, True, False): GoTo GOTONEXT
'                     End If
'                     If InStr(1, .Categories(yCat).Childs.Item(i).Tag, "PLWORKWE;SA") > 0 Then
'                        .Categories(yCat).Childs.Item(i).Value = IIf(InStr(1, RS!PLWORKWE, "Saturday") > 0, True, False): GoTo GOTONEXT
'                     End If
'                     If InStr(1, .Categories(yCat).Childs.Item(i).Tag, "PLWORKWE;DO") > 0 Then
'                        .Categories(yCat).Childs.Item(i).Value = IIf(InStr(1, RS!PLWORKWE, "Sunday") > 0, True, False): GoTo GOTONEXT
'                     End If
'
'
'            ElseIf .Categories(yCat).Tag = "PARAMETRI_FOOD" Then
'
'               'PARAMETRI x 'FOOD'  - - - - - - - - - - - - - - - - - -
'                  'COPERTO Obbligatorio
'                     If InStr(1, .Categories(yCat).Childs.Item(i).Tag, "PLFLCOPERTO") > 0 Then
'                        .Categories(yCat).Childs.Item(i).Value = RS!PLFLCOPERTO: GoTo GOTONEXT
'                     End If
'
'                  'Stampa Progressivo di giornata (Fiche) su Comanda
'                     If InStr(1, .Categories(yCat).Childs.Item(i).Tag, "PLSTMPRGCMD") > 0 Then
'                        .Categories(yCat).Childs.Item(i).Value = RS!PLSTMPRGCMD: GoTo GOTONEXT
'                     End If
'
'                  'Stampa Progressivo di giornata (Fiche) su Preconto
'                     If InStr(1, .Categories(yCat).Childs.Item(i).Tag, "PLSTMPRGPRE") > 0 Then
'                        .Categories(yCat).Childs.Item(i).Value = RS!PLSTMPRGPRE: GoTo GOTONEXT
'                     End If
'
'                  'Stampa Preconto dopo aver salvato il TAVOLO
'                     If InStr(1, .Categories(yCat).Childs.Item(i).Tag, "PLSTMPREDOP") > 0 Then
'                        .Categories(yCat).Childs.Item(i).Value = RS!PLSTMPREDOP: GoTo GOTONEXT
'                     End If
'
'                  'Stampa dati Anagrafici del Cliente sul Preconto
'                     If InStr(1, .Categories(yCat).Childs.Item(i).Tag, "PLSTMANACLI") > 0 Then
'                        .Categories(yCat).Childs.Item(i).Value = RS!PLSTMANACLI: GoTo GOTONEXT
'                     End If
'
'                  'Stampa Note tavolo sulla Comanda
'                     If InStr(1, .Categories(yCat).Childs.Item(i).Tag, "PLSTMNOTCOM") > 0 Then
'                        .Categories(yCat).Childs.Item(i).Value = RS!PLSTMNOTCOM: GoTo GOTONEXT
'                     End If
'
'                  'Stampa Note tavolo sul Preconto
'                     If InStr(1, .Categories(yCat).Childs.Item(i).Tag, "PLSTMNOTPRE") > 0 Then
'                        .Categories(yCat).Childs.Item(i).Value = RS!PLSTMNOTPRE: GoTo GOTONEXT
'                     End If
'
'                  'Listino Predefinito
'                     If InStr(1, .Categories(yCat).Childs.Item(i).Tag, "PLLISTIN") > 0 Then
'                        .Categories(yCat).Childs.Item(i).Value = NonNullo(RS!PLLISTIN)
'                        If Len(Trim(.Categories(yCat).Childs.Item(i).Value)) > 0 Then
'                           .Categories(yCat).Childs.Item(i).InplaceButtons(1).IconIndex = ID_TB__DEL + 1000
'                        End If
'                        GoTo GOTONEXT
'                     End If
'
'                  'Tempo MAX di occupazione Tavolo in Minuti
'                     If InStr(1, .Categories(yCat).Childs.Item(i).Tag, "PLMAXMIN") > 0 Then
'                        .Categories(yCat).Childs.Item(i).Value = RS!PLMAXMIN: GoTo GOTONEXT
'                     End If
'               '- - - - - - - - - - - - - - - - - - - - - - - - - - - -
'
'            End If
'
'GOTONEXT:
'         Next
'      Next
'
'   End With
'End Sub
'
'Public Function SalvaValInTabPlanning(pPropertyGrid As PropertyGrid, pCodPlanning As String) As Boolean
'   Dim strSQL As String
'   Dim i As Integer
'   Dim yCat As Byte
'   Dim vWorkWeekMask As String
'
'   With pPropertyGrid
'
'      For yCat = 1 To .Categories.Count 'Ciclo sulle Categorie (macro raggruppamenti)
'
'         For i = 1 To .Categories(yCat).Childs.Count  'Ciclo sui Parametri della cateria in questione
'         'For Each ChildItem In .Parent.Childs
'
'            If .Categories(yCat).Tag = "OPZIONI_PLANNING" Then 'Impostando il TAG sulle catergorie evito di cilcare parametri non di pertinenza e guadagno tempo
'
'               'TIPO DI INCOLONNAMENTO (0=SOLO GIORNI; 1=OPERATORI; 2=RISORSE)
'                  If InStr(1, .Categories(yCat).Childs.Item(i).Tag, "PLCOLONN") > 0 Then
'                      strSQL = strSQL & ", PLCOLONN = " & .Categories(yCat).Childs.Item(i).Value & " ": GoTo GOTONEXT
'                  End If
'
'               'TIPO DI COLORAZIONE ATTIVITA' (1=OPERATORI; 2=RISORSE)
'                  If InStr(1, .Categories(yCat).Childs.Item(i).Tag, "PLCOLORE") > 0 Then
'                      strSQL = strSQL & ", PLCOLORE = " & .Categories(yCat).Childs.Item(i).Value & " ": GoTo GOTONEXT
'                  End If
'
'
'               'TIPO DI VISUALIZZAZIONE (0=GIORNO; 1=SETT. LAVORATIVA; 2=SETT. COMPLETA; 3=MESE)
'                  If InStr(1, .Categories(yCat).Childs.Item(i).Tag, "PL__VIEW") > 0 Then
'                      strSQL = strSQL & ", PL__VIEW = " & .Categories(yCat).Childs.Item(i).Value & " ": GoTo GOTONEXT
'                  End If
'
'               'INIZIO ORA DI LAVORO
'                  If InStr(1, .Categories(yCat).Childs.Item(i).Tag, "PLSTATIM") > 0 Then
'                     strSQL = strSQL & ", PLSTATIM = '" & .Categories(yCat).Childs.Item(i).Value & "' ": GoTo GOTONEXT
'                  End If
'
'               'FINE ORA DI LAVORO
'                  If InStr(1, .Categories(yCat).Childs.Item(i).Tag, "PLENDTIM") > 0 Then
'                     strSQL = strSQL & ", PLENDTIM = '" & .Categories(yCat).Childs.Item(i).Value & "' ": GoTo GOTONEXT
'                  End If
'
'               'TIME SCALE DEL PLANNING (10 MINUTI; 15 MINUTI; 30 MINUTI; 60 MINUTI)
'                  If InStr(1, .Categories(yCat).Childs.Item(i).Tag, "PLTIMSCA") > 0 Then
'                      strSQL = strSQL & ", PLTIMSCA = " & .Categories(yCat).Childs.Item(i).Value & " ": GoTo GOTONEXT
'                  End If
'
'               'LARGHEZZA MINIMA COLONNE (0=STANDARD; OPPURE DA 10 A 100)
'                  If InStr(1, .Categories(yCat).Childs.Item(i).Tag, "PLCOLWID") > 0 Then
'                     strSQL = strSQL & ", PLCOLWID = " & .Categories(yCat).Childs.Item(i).Value & " ": GoTo GOTONEXT
'                  End If
'
'               'GIORNI DI LAVORO DELLA SETTIMANA
'                  If InStr(1, .Categories(yCat).Childs.Item(i).Tag, "PLWORKWE;LU") > 0 Then
'                     If .Categories(yCat).Childs.Item(i).Value = True Then
'                        vWorkWeekMask = "xtpCalendarDayMonday"
'                     End If
'                  End If
'                  If InStr(1, .Categories(yCat).Childs.Item(i).Tag, "PLWORKWE;MA") > 0 Then
'                     If .Categories(yCat).Childs.Item(i).Value = True Then
'                        If Len(Trim(vWorkWeekMask)) > 0 Then vWorkWeekMask = vWorkWeekMask & " + "
'                        vWorkWeekMask = vWorkWeekMask & "xtpCalendarDayTuesday"
'                     End If
'                  End If
'                  If InStr(1, .Categories(yCat).Childs.Item(i).Tag, "PLWORKWE;ME") > 0 Then
'                     If .Categories(yCat).Childs.Item(i).Value = True Then
'                        If Len(Trim(vWorkWeekMask)) > 0 Then vWorkWeekMask = vWorkWeekMask & " + "
'                        vWorkWeekMask = vWorkWeekMask & "xtpCalendarDayWednesday"
'                     End If
'                  End If
'                  If InStr(1, .Categories(yCat).Childs.Item(i).Tag, "PLWORKWE;GI") > 0 Then
'                     If .Categories(yCat).Childs.Item(i).Value = True Then
'                        If Len(Trim(vWorkWeekMask)) > 0 Then vWorkWeekMask = vWorkWeekMask & " + "
'                        vWorkWeekMask = vWorkWeekMask & "xtpCalendarDayThursday"
'                     End If
'                  End If
'                  If InStr(1, .Categories(yCat).Childs.Item(i).Tag, "PLWORKWE;VE") > 0 Then
'                     If .Categories(yCat).Childs.Item(i).Value = True Then
'                        If Len(Trim(vWorkWeekMask)) > 0 Then vWorkWeekMask = vWorkWeekMask & " + "
'                        vWorkWeekMask = vWorkWeekMask & "xtpCalendarDayFriday"
'                     End If
'                  End If
'                  If InStr(1, .Categories(yCat).Childs.Item(i).Tag, "PLWORKWE;SA") > 0 Then
'                     If .Categories(yCat).Childs.Item(i).Value = True Then
'                        If Len(Trim(vWorkWeekMask)) > 0 Then vWorkWeekMask = vWorkWeekMask & " + "
'                        vWorkWeekMask = vWorkWeekMask & "xtpCalendarDaySaturday"
'                     End If
'                  End If
'                  If InStr(1, .Categories(yCat).Childs.Item(i).Tag, "PLWORKWE;DO") > 0 Then
'                     If .Categories(yCat).Childs.Item(i).Value = True Then
'                        If Len(Trim(vWorkWeekMask)) > 0 Then vWorkWeekMask = vWorkWeekMask & " + "
'                        vWorkWeekMask = vWorkWeekMask & "xtpCalendarDaySunday"
'                     End If
'                  End If
'
'
'
'            ElseIf .Categories(yCat).Tag = "PARAMETRI_FOOD" Then
'
'               'PARAMETRI x 'FOOD'  - - - - - - - - - - - - - - - - - -
'                  'COPERTO Obbligatorio
'                     If InStr(1, .Categories(yCat).Childs.Item(i).Tag, "PLFLCOPERTO") > 0 Then
'                        strSQL = strSQL & ", PLFLCOPERTO = " & IIf(.Categories(yCat).Childs.Item(i).Value = True, 1, 0) & " ": GoTo GOTONEXT
'                     End If
'
'                  'Stampa Progressivo di giornata (Fiche) su Comanda
'                     If InStr(1, .Categories(yCat).Childs.Item(i).Tag, "PLSTMPRGCMD") > 0 Then
'                        strSQL = strSQL & ", PLSTMPRGCMD = " & IIf(.Categories(yCat).Childs.Item(i).Value = True, 1, 0) & " ": GoTo GOTONEXT
'                     End If
'
'                  'Stampa Progressivo di giornata (Fiche) su Preconto
'                     If InStr(1, .Categories(yCat).Childs.Item(i).Tag, "PLSTMPRGPRE") > 0 Then
'                        strSQL = strSQL & ", PLSTMPRGPRE = " & IIf(.Categories(yCat).Childs.Item(i).Value = True, 1, 0) & " ": GoTo GOTONEXT
'                     End If
'
'                  'Stampa il Preconto dopo aver salvato il TAVOLO
'                     If InStr(1, .Categories(yCat).Childs.Item(i).Tag, "PLSTMPREDOP") > 0 Then
'                        strSQL = strSQL & ", PLSTMPREDOP = " & IIf(.Categories(yCat).Childs.Item(i).Value = True, 1, 0) & " ": GoTo GOTONEXT
'                     End If
'
'                  'Stampa dati Anagrafici del Cliente sul Preconto
'                     If InStr(1, .Categories(yCat).Childs.Item(i).Tag, "PLSTMANACLI") > 0 Then
'                        strSQL = strSQL & ", PLSTMANACLI = " & IIf(.Categories(yCat).Childs.Item(i).Value = True, 1, 0) & " ": GoTo GOTONEXT
'                     End If
'
'                  'Stampa note tavolo sulla Comanda
'                     If InStr(1, .Categories(yCat).Childs.Item(i).Tag, "PLSTMNOTCOM") > 0 Then
'                        strSQL = strSQL & ", PLSTMNOTCOM = " & IIf(.Categories(yCat).Childs.Item(i).Value = True, 1, 0) & " ": GoTo GOTONEXT
'                     End If
'
'                  'Stampa note tavolo sul Preconto
'                     If InStr(1, .Categories(yCat).Childs.Item(i).Tag, "PLSTMNOTPRE") > 0 Then
'                        strSQL = strSQL & ", PLSTMNOTPRE = " & IIf(.Categories(yCat).Childs.Item(i).Value = True, 1, 0) & " ": GoTo GOTONEXT
'                     End If
'
'                  'Listino Predefinito
'                     If InStr(1, .Categories(yCat).Childs.Item(i).Tag, "PLLISTIN") > 0 Then
'                        strSQL = strSQL & ", PLLISTIN = '" & VerificaApici(.Categories(yCat).Childs.Item(i).Value) & "' ": GoTo GOTONEXT
'                     End If
'
'                  'Tempo MAX di occupazione Tavolo in Minuti
'                     If InStr(1, .Categories(yCat).Childs.Item(i).Tag, "PLMAXMIN") > 0 Then
'                        strSQL = strSQL & ", PLMAXMIN = " & .Categories(yCat).Childs.Item(i).Value & " ": GoTo GOTONEXT
'                     End If
'               '- - - - - - - - - - - - - - - - - - - - - - - - - - - -
'
'            End If
'
'GOTONEXT:
'         Next
'      Next
'
'
'      If Len(Trim(vWorkWeekMask)) > 0 Then
'         strSQL = strSQL & ", PLWORKWE = '" & vWorkWeekMask & "' "
'      End If
'
'      strSQL = strSQL & ", UTCV = " & pub_CodUtente
'      strSQL = strSQL & ", UTDV = " & DataOraSQL(Format(Date, "dd/mm/yyyy") & " " & Format(Time, "hh:nn:ss"), False, "", True)
'
'      strSQL = Trim(Mid(strSQL, 2)) 'tolgo la prima virgola ", "
'      strSQL = "UPDATE [" & Azienda & "TAB_PLANNING] SET " & strSQL & " WHERE PLCODICE = '" & VerificaApici(pCodPlanning) & "' "
'
'      Call EseguiSQLMDB(strSQL)
'      SalvaValInTabPlanning = True
'
'   End With
'
'End Function
'
'
