Imports System.Windows.Forms

Public Class frmVorlagen




    Private Sub btnUpload_Click(sender As Object, e As EventArgs) Handles btnUpload.Click
        Dim vu As New VERAG_PROG_ALLGEMEIN.frmVorlagenUpload
        vu.ShowDialog()



    End Sub

    Private Sub frmVorlagenUpload_Load(sender As Object, e As EventArgs) Handles Me.Load
        initDGV()
    End Sub
    Sub initDGV()
        With dgvVolagen
            .Columns.Clear()
            .SET_SQL("SELECT [da_id],[da_kategorie],[da_ordner] ,[da_name],da_uOrdner1,da_uOrdner2,da_uOrdner3   FROM [tblDatenarchiv]  where da_vorlage=1", "FMZOLL")
            .LOAD()
            If .ColumnCount > 0 Then
                '.Columns("da_uOrdner1").Visible = False
                .Columns("da_name").AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill
            End If
        End With
    End Sub



    Private Sub gridAviso_DoubleClick(sender As Object, e As System.EventArgs) Handles dgvVolagen.DoubleClick
        If dgvVolagen.SelectedRows.Count = 0 Then Exit Sub
        Dim r As DataGridViewRow = dgvVolagen.SelectedRows(0)
        Dim cDATENSERVER As New VERAG_PROG_ALLGEMEIN.cDATENSERVER(r.Cells("da_kategorie").Value, r.Cells("da_ordner").Value, r.Cells("da_uOrdner1").Value, r.Cells("da_uOrdner2").Value, r.Cells("da_uOrdner3").Value, r.Cells("da_name").Value)
        MsgBox(cDATENSERVER.DATA_LIST.LIST.Count)
        cDATENSERVER.OPEN_SINGLE()

    End Sub

    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click

        If dgvVolagen.SelectedRows.Count = 0 Then Exit Sub

        Try
            Dim r As DataGridViewRow = dgvVolagen.SelectedRows(0)
            Dim cDATENSERVER As New VERAG_PROG_ALLGEMEIN.cDATENSERVER(r.Cells("da_kategorie").Value, r.Cells("da_ordner").Value, r.Cells("da_uOrdner1").Value, r.Cells("da_uOrdner2").Value, r.Cells("da_uOrdner3").Value, r.Cells("da_name").Value)
            If cDATENSERVER.uploadDataToDATENSERVERFileDialog() <> "" Then
                dgvVolagen.RELOAD()
            End If
        Catch ex As Exception
            MsgBox(ex.Message)
        End Try
    End Sub
End Class