123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205 |
- Imports System.Net
- Imports System.IO
- Public Class 系統使用說明
- Dim OldX, OldY As Long
- Dim drag As Boolean
- Dim 第1段開始, 第2段開始, 第3段開始, 第4段開始, 第5段開始, 第6段開始, 判斷, 放大 As Boolean
- Private Sub Set_合約清單()
- Dim ds6 As New DataSet
- 子項目_dgv.DataSource = Nothing : ds6.Clear()
- 子項目_dgv.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
- 子項目_dgv.ColumnHeadersHeight = 25 : 子項目_dgv.AllowUserToAddRows = False
- PA47 = 主功能編號_cb.Text
- SQL_子功能讀取()
- da.Fill(ds6) : 子項目_dgv.DataSource = ds6.Tables(0) : conn.Close()
- 子項目_dgv.Columns(0).FillWeight = 100 : 子項目_dgv.Columns(1).Visible = False : 子項目_dgv.Columns(2).Visible = False : 子項目_dgv.Columns(3).Visible = False
- 子項目_dgv.Columns(4).Visible = False : 子項目_dgv.Columns(5).Visible = False : 子項目_dgv.Columns(6).Visible = False : 子項目_dgv.Columns(7).Visible = False
-
- For i As Integer = 0 To 子項目_dgv.Rows.Count - 1
- If 子項目_dgv("子項目", i).Value.ToString = "" Then
- 子項目_dgv(0, i).Value = " * " & 子項目_dgv("標題", i).Value.ToString
- End If
- Next
- End Sub
- Private Sub 主功能讀取()
- SQL_主功能讀取() : 主功能_cb.Items.Clear() : 主功能編號_cb.Items.Clear()
- While (dr.Read()) : 主功能_cb.Items.Add(dr("主項目")) : 主功能編號_cb.Items.Add(dr("主項")) : End While : conn.Close()
- End Sub
- Private Sub 播放YT()
- Dim html As String = "<html><head>"
- html &= "<meta content='IE=Edge' http-equiv='X-UA-Compatible'/>"
- html &= "<iframe id='video' src= 'https://www.youtube.com/embed/{0}' width='" & WB1.Width - 25 & "' height='" & WB1.Height - 25 & "' frameborder='1' allowfullscreen></iframe>"
- html &= "</body></html>"
- Me.WB1.DocumentText = String.Format(html, YT網址_tb.Text.Split("=")(1))
- End Sub
- Private Sub 系統使用說明_Load(sender As Object, e As EventArgs) Handles MyBase.Load
- Me.MdiParent = HX_PGS_ERP_SYS : Me.WindowState = 2 : Me.AutoScroll = True
- 視窗2_pl.Visible = False
- End Sub
- Private Sub 系統使用說明_Shown(sender As Object, e As EventArgs) Handles MyBase.Shown
- 主功能讀取() : 主功能_cb.SelectedIndex = 0
- End Sub
- Private Sub 會議記錄_Closed(sender As Object, e As EventArgs) Handles MyBase.Closed
- MyModule1.虛擬桌面開啟()
- End Sub
- Private Sub 登入閒置控制_MouseMove(sender As Object, e As EventArgs) Handles MyBase.MouseMove
- timeNow = 0 : HX_PGS_ERP_SYS.Timer1.Enabled = False : HX_PGS_ERP_SYS.Timer1.Enabled = True
- End Sub
- Private Sub 登入閒置控制_KeyPress(sender As Object, e As EventArgs) Handles MyBase.KeyPress
- timeNow = 0 : HX_PGS_ERP_SYS.Timer1.Enabled = False : HX_PGS_ERP_SYS.Timer1.Enabled = True
- End Sub
- Private Sub 子項目_dgv_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
- 細項_tb.Text = 子項目_dgv("細項", e.RowIndex).Value.ToString : 網址_tb.Text = 子項目_dgv("影片", e.RowIndex).Value.ToString
- If 系統語言 = "繁體中文" Then
- 標題_中_tb.Text = 子項目_dgv("標題", e.RowIndex).Value.ToString : 說明_中_tb.Text = 子項目_dgv("說明", e.RowIndex).Value.ToString
- PA47 = 主項_tb.Text : PA46 = 子項_tb.Text : PA45 = 細項_tb.Text : SQL_子功能讀取1()
- If dr.Read Then : 標題_英_tb.Text = dr("標題").ToString : 說明_英_tb.Text = dr("說明").ToString : End If
- Else
- 標題_英_tb.Text = 子項目_dgv("標題", e.RowIndex).Value.ToString : 說明_英_tb.Text = 子項目_dgv("說明", e.RowIndex).Value.ToString
- PA47 = 主項_tb.Text : PA46 = 子項_tb.Text : PA45 = 細項_tb.Text : SQL_子功能讀取1()
- If dr.Read Then : 標題_中_tb.Text = dr("標題").ToString : 說明_中_tb.Text = dr("說明").ToString : End If
- End If
- If 子項目_dgv("影片", e.RowIndex).Value.ToString = "" Then : YT網址_tb.Text = "https://www.youtube.com/watch?v=OFz9oZptTh4"
- Else : YT網址_tb.Text = 子項目_dgv("影片", e.RowIndex).Value.ToString : End If : 播放YT()
- End If
- End Sub
- Private Sub 控制表_dgv_RowPostPaint(ByVal sender As Object, ByVal e As DataGridViewRowPostPaintEventArgs) Handles 子項目_dgv.RowPostPaint
- Dim linePen As New Pen(Color.Blue, 2)
- If e.RowIndex = 子項目_dgv.Rows.Count - 1 Then
- Exit Sub
- Else
- If 子項目_dgv(2, e.RowIndex).Value.ToString <> 子項目_dgv(2, e.RowIndex + 1).Value.ToString Then
- Dim startX As Integer = IIf(子項目_dgv.RowHeadersVisible, 子項目_dgv.RowHeadersWidth, 0)
- Dim startY As Integer = e.RowBounds.Top + e.RowBounds.Height - 1
- Dim endX As Integer = startX + 子項目_dgv.Columns.GetColumnsWidth(DataGridViewElementStates.Visible) - 子項目_dgv.HorizontalScrollingOffset
- e.Graphics.DrawLine(linePen, startX, startY, endX, startY)
- Exit Sub
- End If
- End If
- End Sub
- Private Sub 主功能_cb_SelectedIndexChanged(sender As Object, e As EventArgs) Handles 主功能_cb.SelectedIndexChanged
- 主功能編號_cb.SelectedIndex = 主功能_cb.SelectedIndex
- End Sub
- Private Sub 主功能編號_cb_SelectedIndexChanged(sender As Object, e As EventArgs) Handles 主功能編號_cb.SelectedIndexChanged
- Set_合約清單()
- End Sub
- Private Sub CanceL2_bt_Click(sender As Object, e As EventArgs) Handles CanceL2_bt.Click
- If 視窗2_pl.Visible = False Then : 視窗2_pl.Visible = True : 視窗2_pl.BringToFront() : Else
- 視窗2_pl.Visible = False : End If
- End Sub
- Private Sub 編輯_bt_Click(sender As Object, e As EventArgs) Handles 編輯_bt.Click
- If 視窗2_pl.Visible = False Then : 視窗2_pl.BringToFront() : 視窗2_pl.Location = New System.Drawing.Point(555, 100) : 視窗2_pl.Visible = True : Else : 視窗2_pl.Visible = False : End If
- End Sub
- Private Sub 影片測試_tb_Click(sender As Object, e As EventArgs) Handles 影片測試_tb.Click
- If 網址_tb.Text = "" Then : If 系統語言 = "繁體中文" Then : MsgBox("沒有指定網址!!") : Else : MsgBox("Tidak ada URL yang ditentukan!!") : End If : Else
- Try : YT網址_tb.Text = 網址_tb.Text : 播放YT() : Catch ex As Exception : MsgBox(ex.Message) : End Try
- End If
- End Sub
- Private Sub 開新的請款單_bt_Click(sender As Object, e As EventArgs) Handles 開新的請款單_bt.Click
- Dim 細項 As Integer
- If 主項_tb.Text = "" Then : If 系統語言 = "繁體中文" Then : MsgBox("請先選擇要編輯的項目!!") : Else : MsgBox("Silakan pilih item untuk diedit terlebih dahulu!!") : End If : Else
- If 標題_中_tb.Text = "" Then : If 系統語言 = "繁體中文" Then : MsgBox("沒有標題!!") : Else : MsgBox("Tanpa Judul!!") : End If : Else
- If 說明_中_tb.Text = "" Then : If 系統語言 = "繁體中文" Then : MsgBox("沒有說明!!") : Else : MsgBox("Tidak Ada Deskripsi!!") : End If : Else
- If 網址_tb.Text = "" Then : If 系統語言 = "繁體中文" Then : MsgBox("沒有指定網址!!") : Else : MsgBox("Tidak ada URL yang ditentukan!!") : End If : Else
- PA47 = 主項_tb.Text : PA46 = 子項_tb.Text : SQL_系統教學說明讀取()
- If dr.Read Then : 細項 = dr("細項") + 1 : Else : 細項 = 1 : End If
- PA = 主項_tb.Text : PA1 = 子項_tb.Text : PA2 = 細項 : PA3 = "" : PA4 = "" : PA5 = 標題_中_tb.Text
- PA6 = 說明_中_tb.Text : PA7 = "繁體中文" : PA8 = 網址_tb.Text : SQL_統教學說明新增()
- PA = 主項_tb.Text : PA1 = 子項_tb.Text : PA2 = 細項 : PA3 = "" : PA4 = "" : PA5 = 標題_英_tb.Text
- PA6 = 說明_英_tb.Text : PA7 = "Indonesian" : PA8 = 網址_tb.Text : SQL_統教學說明新增()
- MsgBox("新增完成!! / Tambahkan selesai!!")
- End If
- End If
- End If
- End If : Set_合約清單()
- End Sub
- Private Sub 存檔_bt_Click(sender As Object, e As EventArgs) Handles 存檔_bt.Click
- If 細項_tb.Text = "0" Then : If 系統語言 = "繁體中文" Then : MsgBox("系統結構資料不可編輯!!") : Else : MsgBox("Data struktur sistem tidak dapat diedit!!") : End If : Else
- If 主項_tb.Text = "" Then : If 系統語言 = "繁體中文" Then : MsgBox("請先選擇要編輯的項目!!") : Else : MsgBox("Silakan pilih item untuk diedit terlebih dahulu!!") : End If : Else
- If 標題_中_tb.Text = "" Then : If 系統語言 = "繁體中文" Then : MsgBox("沒有標題!!") : Else : MsgBox("Tanpa Judul!!") : End If : Else
- If 說明_中_tb.Text = "" Then : If 系統語言 = "繁體中文" Then : MsgBox("沒有說明!!") : Else : MsgBox("Tidak Ada Deskripsi!!") : End If : Else
- If 網址_tb.Text = "" Then : If 系統語言 = "繁體中文" Then : MsgBox("沒有指定網址!!") : Else : MsgBox("Tidak ada URL yang ditentukan!!") : End If : Else
- PA = 主項_tb.Text : PA1 = 子項_tb.Text : PA2 = 細項_tb.Text : PA3 = "" : PA4 = "" : PA5 = 標題_中_tb.Text
- PA6 = 說明_中_tb.Text : PA7 = "繁體中文" : PA8 = 網址_tb.Text : SQL_統教學說明修改()
- PA = 主項_tb.Text : PA1 = 子項_tb.Text : PA2 = 細項_tb.Text : PA3 = "" : PA4 = "" : PA5 = 標題_英_tb.Text
- PA6 = 說明_英_tb.Text : PA7 = "Indonesian" : PA8 = 網址_tb.Text : SQL_統教學說明修改()
- MsgBox("修改完成!! / Modifikasi selesai!!")
- End If
- End If
- End If
- End If : Set_合約清單()
- End If
- End Sub
- Private Sub 刪除_bt_Click(sender As Object, e As EventArgs) Handles 刪除_bt.Click
- If 細項_tb.Text = "0" Then : If 系統語言 = "繁體中文" Then : MsgBox("系統結構資料不可編輯!!") : Else : MsgBox("Data struktur sistem tidak dapat diedit!!") : End If : Else
- 輸入密碼.ShowDialog()
- If PA = "0013975151" Then
- Dim SS As String : If 系統語言 = "繁體中文" Then : SS = "確定要刪除這筆資料嗎??" : Else : SS = "Apakah Anda yakin ingin menghapus data ini???" : End If
- Dim aa As MsgBoxResult = MsgBox(SS, MsgBoxStyle.OkCancel)
- If aa = MsgBoxResult.Ok Then : PA = 主項_tb.Text : PA1 = 子項_tb.Text : PA2 = 細項_tb.Text : SQL_統教學說明刪除() : Set_合約清單() : End If
- Else : If 系統語言 = "繁體中文" Then : MsgBox("你沒有權限刪除物料!!") : Else : MsgBox("Anda tidak memiliki izin untuk menghapus materi!!") : End If : End If
- End If
- End Sub
- Private Sub 翻譯_bt_Click(sender As Object, e As EventArgs) Handles 翻譯_bt.Click
- Me.Enabled = False
- If 系統語言 = "繁體中文" Then : 翻譯 = 標題_中_tb.Text : MyModule2.執行翻譯() : 第1段開始 = True : 第2段開始 = False : 等待翻譯_tim.Enabled = True
- Else : 翻譯 = 標題_英_tb.Text : MyModule2.執行翻譯() : 第1段開始 = True : 第2段開始 = False : 等待翻譯_tim.Enabled = True : End If
- End Sub
- Private Sub 等待翻譯_tim_Tick(sender As Object, e As EventArgs) Handles 等待翻譯_tim.Tick
- If 系統語言 = "繁體中文" Then : If 第1段開始 = True Then : If 標題_中_tb.Text <> "" Then
- Dim Str2 As String = System.Windows.Forms.Application.StartupPath : Dim stringReader As String : Dim fileReader As StreamReader
- If File.Exists(Str2 & "\in.txt") Then
- fileReader = My.Computer.FileSystem.OpenTextFileReader(Str2 & "\in.txt") : stringReader = fileReader.ReadToEnd()
- 標題_英_tb.Text = stringReader : fileReader.Close() : 第1段開始 = False : 第2段開始 = True : 翻譯 = 說明_中_tb.Text : MyModule2.執行翻譯()
- End If
- Else : 第1段開始 = False : 第2段開始 = True : 翻譯 = 說明_中_tb.Text : MyModule2.執行翻譯() : End If
- Else : 第1段開始 = False : 第2段開始 = True : 翻譯 = 說明_中_tb.Text : MyModule2.執行翻譯() : End If
- If 第2段開始 = True Then : If 說明_中_tb.Text <> "" Then
- Dim Str2 As String = System.Windows.Forms.Application.StartupPath : Dim stringReader As String : Dim fileReader As StreamReader
- If File.Exists(Str2 & "\in.txt") Then
- fileReader = My.Computer.FileSystem.OpenTextFileReader(Str2 & "\in.txt") : stringReader = fileReader.ReadToEnd()
- 說明_英_tb.Text = stringReader : fileReader.Close() : 第2段開始 = False
- 等待翻譯_tim.Enabled = False : Me.Enabled = True
- If 系統語言 = "繁體中文" Then : MsgBox("翻譯完成!!") : Else : MsgBox("Terjemahan Selesai!!") : End If
- End If
- Else : 第2段開始 = False : 等待翻譯_tim.Enabled = False : Me.Enabled = True
- If 系統語言 = "繁體中文" Then : MsgBox("翻譯完成!!") : Else : MsgBox("Terjemahan Selesai!!") : End If : End If
- Else : 第2段開始 = False : 等待翻譯_tim.Enabled = False : Me.Enabled = True
- If 系統語言 = "繁體中文" Then : MsgBox("翻譯完成!!") : Else : MsgBox("Terjemahan Selesai!!") : End If : End If
- Else
- If 第1段開始 = True Then : If 標題_英_tb.Text <> "" Then
- Dim Str2 As String = System.Windows.Forms.Application.StartupPath : Dim stringReader As String : Dim fileReader As StreamReader
- If File.Exists(Str2 & "\ch.txt") Then
- fileReader = My.Computer.FileSystem.OpenTextFileReader(Str2 & "\ch.txt") : stringReader = fileReader.ReadToEnd()
- 標題_中_tb.Text = stringReader : fileReader.Close() : 第1段開始 = False : 第2段開始 = True : 翻譯 = 說明_英_tb.Text : MyModule2.執行翻譯()
- End If
- Else : 第1段開始 = False : 第2段開始 = True : 翻譯 = 說明_英_tb.Text : MyModule2.執行翻譯() : End If
- Else : 第1段開始 = False : 第2段開始 = True : 翻譯 = 說明_英_tb.Text : MyModule2.執行翻譯() : End If
- If 第2段開始 = True Then : If 說明_英_tb.Text <> "" Then
- Dim Str2 As String = System.Windows.Forms.Application.StartupPath : Dim stringReader As String : Dim fileReader As StreamReader
- If File.Exists(Str2 & "\ch.txt") Then
- fileReader = My.Computer.FileSystem.OpenTextFileReader(Str2 & "\ch.txt") : stringReader = fileReader.ReadToEnd()
- 說明_中_tb.Text = stringReader : fileReader.Close() : 第2段開始 = False
- 等待翻譯_tim.Enabled = False : Me.Enabled = True : If 系統語言 = "繁體中文" Then : MsgBox("翻譯完成!!") : Else : MsgBox("Terjemahan Selesai!!") : End If
- End If
- Else : 第2段開始 = False : 等待翻譯_tim.Enabled = False : Me.Enabled = True
- If 系統語言 = "繁體中文" Then : MsgBox("翻譯完成!!") : Else : MsgBox("Terjemahan Selesai!!") : End If : End If
- Else : 第2段開始 = False : 等待翻譯_tim.Enabled = False : Me.Enabled = True
- If 系統語言 = "繁體中文" Then : MsgBox("翻譯完成!!") : Else : MsgBox("Terjemahan Selesai!!") : End If : End If
- End If
- End Sub
-
-
- Private Sub 視窗2_pl_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles 視窗2_pl.MouseDown
- If e.Button = MouseButtons.Left Then : OldX = e.X : OldY = e.Y : drag = True : End If
- End Sub
- Private Sub 視窗2_pl_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles 視窗2_pl.MouseMove
- If drag Then : 視窗2_pl.Left = 視窗2_pl.Left + e.X - OldX : 視窗2_pl.Top = 視窗2_pl.Top + e.Y - OldY : End If
- End Sub
- Private Sub 視窗2_pl_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles 視窗2_pl.MouseUp
- drag = False
- End Sub
- End Class
|