Option Strict Off
Imports System.Windows.Forms

Public Class FTP資料夾管理
    ReadOnly ds As New DataSet
    Private Sub Set_使用者清單()
        資料夾清單_dgv.DataSource = Nothing : ds.Clear()
        資料夾清單_dgv.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
        資料夾清單_dgv.ColumnHeadersHeight = 25
        資料夾清單_dgv.AllowUserToAddRows = False
        SQL_FTP資料夾路徑分配()
        資料夾清單_dgv.RowTemplate.Height = 30
        da.Fill(ds) : 資料夾清單_dgv.DataSource = ds.Tables(0) : conn.Close()
        資料夾清單_dgv.Columns(0).FillWeight = 70 : 資料夾清單_dgv.Columns(1).FillWeight = 200 : 資料夾清單_dgv.Columns(2).FillWeight = 200 : 資料夾清單_dgv.Columns(3).FillWeight = 100
    End Sub
    Private Sub FTP資料夾管理_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        Me.MdiParent = YD_ERP_SYS : Me.WindowState = 2 : Me.AutoScroll = True
        Set_使用者清單()
        Target1 = Target : FTP資料夾_wb.Url = New Uri(Target1)
    End Sub
    Private Sub DataGridView1_CellClick(ByVal sender As System.Object, ByVal e As DataGridViewCellEventArgs) Handles 資料夾清單_dgv.CellClick
        If e.RowIndex = -1 Then : Else
            資料夾名稱_tb.Text = 資料夾清單_dgv("資料夾名稱", e.RowIndex).Value.ToString : 指定頁面_tb.Text = 資料夾清單_dgv("指定頁面", e.RowIndex).Value.ToString
            備註_tb.Text = 資料夾清單_dgv("備註", e.RowIndex).Value.ToString : 指定_tb.Text = 資料夾清單_dgv("指定", e.RowIndex).Value.ToString
        End If
    End Sub
    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles 新增_bt.Click
        SQL_FTP資料夾管理新增() : conn.Close() : Set_使用者清單()
    End Sub
    Private Sub Button2_Click(sender As Object, e As EventArgs) Handles 修改_bt.Click
        SQL_FTP資料夾管理修改() : conn.Close() : Set_使用者清單()
    End Sub
    Private Sub Button3_Click(sender As Object, e As EventArgs) Handles 刪除_bt.Click
        Dim aa As MsgBoxResult = MsgBox("確定要刪除該筆資料?", MsgBoxStyle.OkCancel)
        If aa = MsgBoxResult.Ok Then
            SQL_FTP資料夾管理刪除()
        End If : conn.Close() : Set_使用者清單()
    End Sub

    Private Sub 字體_NUD_ValueChanged(sender As Object, e As EventArgs) Handles 字體_NUD.ValueChanged
        資料夾清單_dgv.RowsDefaultCellStyle.Font = New System.Drawing.Font("微軟正黑體", 字體_NUD.Value)
    End Sub
End Class