Ei kuvausta
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

系統使用說明.vb 17KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205
  1. Imports System.Net
  2. Imports System.IO
  3. Public Class 系統使用說明
  4. Dim OldX, OldY As Long
  5. Dim drag As Boolean
  6. Dim 第1段開始, 第2段開始, 第3段開始, 第4段開始, 第5段開始, 第6段開始, 判斷, 放大 As Boolean
  7. Private Sub Set_合約清單()
  8. Dim ds6 As New DataSet
  9. 子項目_dgv.DataSource = Nothing : ds6.Clear()
  10. 子項目_dgv.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
  11. 子項目_dgv.ColumnHeadersHeight = 25 : 子項目_dgv.AllowUserToAddRows = False
  12. PA47 = 主功能編號_cb.Text
  13. SQL_子功能讀取()
  14. da.Fill(ds6) : 子項目_dgv.DataSource = ds6.Tables(0) : conn.Close()
  15. 子項目_dgv.Columns(0).FillWeight = 100 : 子項目_dgv.Columns(1).Visible = False : 子項目_dgv.Columns(2).Visible = False : 子項目_dgv.Columns(3).Visible = False
  16. 子項目_dgv.Columns(4).Visible = False : 子項目_dgv.Columns(5).Visible = False : 子項目_dgv.Columns(6).Visible = False : 子項目_dgv.Columns(7).Visible = False
  17. For i As Integer = 0 To 子項目_dgv.Rows.Count - 1
  18. If 子項目_dgv("子項目", i).Value.ToString = "" Then
  19. 子項目_dgv(0, i).Value = " * " & 子項目_dgv("標題", i).Value.ToString
  20. End If
  21. Next
  22. End Sub
  23. Private Sub 主功能讀取()
  24. SQL_主功能讀取() : 主功能_cb.Items.Clear() : 主功能編號_cb.Items.Clear()
  25. While (dr.Read()) : 主功能_cb.Items.Add(dr("主項目")) : 主功能編號_cb.Items.Add(dr("主項")) : End While : conn.Close()
  26. End Sub
  27. Private Sub 播放YT()
  28. Dim html As String = "<html><head>"
  29. html &= "<meta content='IE=Edge' http-equiv='X-UA-Compatible'/>"
  30. html &= "<iframe id='video' src= 'https://www.youtube.com/embed/{0}' width='" & WB1.Width - 25 & "' height='" & WB1.Height - 25 & "' frameborder='1' allowfullscreen></iframe>"
  31. html &= "</body></html>"
  32. Me.WB1.DocumentText = String.Format(html, YT網址_tb.Text.Split("=")(1))
  33. End Sub
  34. Private Sub 系統使用說明_Load(sender As Object, e As EventArgs) Handles MyBase.Load
  35. Me.MdiParent = HX_PGS_ERP_SYS : Me.WindowState = 2 : Me.AutoScroll = True
  36. 視窗2_pl.Visible = False
  37. End Sub
  38. Private Sub 系統使用說明_Shown(sender As Object, e As EventArgs) Handles MyBase.Shown
  39. 主功能讀取() : 主功能_cb.SelectedIndex = 0
  40. End Sub
  41. Private Sub 會議記錄_Closed(sender As Object, e As EventArgs) Handles MyBase.Closed
  42. MyModule1.虛擬桌面開啟()
  43. End Sub
  44. Private Sub 登入閒置控制_MouseMove(sender As Object, e As EventArgs) Handles MyBase.MouseMove
  45. timeNow = 0 : HX_PGS_ERP_SYS.Timer1.Enabled = False : HX_PGS_ERP_SYS.Timer1.Enabled = True
  46. End Sub
  47. Private Sub 登入閒置控制_KeyPress(sender As Object, e As EventArgs) Handles MyBase.KeyPress
  48. timeNow = 0 : HX_PGS_ERP_SYS.Timer1.Enabled = False : HX_PGS_ERP_SYS.Timer1.Enabled = True
  49. End Sub
  50. Private Sub 子項目_dgv_CellClick(ByVal sender As System.Object, ByVal e As DataGridViewCellEventArgs) Handles 子項目_dgv.CellClick
  51. If e.RowIndex = -1 Then : Else
  52. 主項_tb.Text = 子項目_dgv("主項", e.RowIndex).Value.ToString : 子項_tb.Text = 子項目_dgv("子項", e.RowIndex).Value.ToString
  53. 標題_tb.Text = 子項目_dgv("標題", e.RowIndex).Value.ToString : 說明_tb.Text = 子項目_dgv("說明", e.RowIndex).Value.ToString
  54. 細項_tb.Text = 子項目_dgv("細項", e.RowIndex).Value.ToString : 網址_tb.Text = 子項目_dgv("影片", e.RowIndex).Value.ToString
  55. If 系統語言 = "繁體中文" Then
  56. 標題_中_tb.Text = 子項目_dgv("標題", e.RowIndex).Value.ToString : 說明_中_tb.Text = 子項目_dgv("說明", e.RowIndex).Value.ToString
  57. PA47 = 主項_tb.Text : PA46 = 子項_tb.Text : PA45 = 細項_tb.Text : SQL_子功能讀取1()
  58. If dr.Read Then : 標題_英_tb.Text = dr("標題").ToString : 說明_英_tb.Text = dr("說明").ToString : End If
  59. Else
  60. 標題_英_tb.Text = 子項目_dgv("標題", e.RowIndex).Value.ToString : 說明_英_tb.Text = 子項目_dgv("說明", e.RowIndex).Value.ToString
  61. PA47 = 主項_tb.Text : PA46 = 子項_tb.Text : PA45 = 細項_tb.Text : SQL_子功能讀取1()
  62. If dr.Read Then : 標題_中_tb.Text = dr("標題").ToString : 說明_中_tb.Text = dr("說明").ToString : End If
  63. End If
  64. If 子項目_dgv("影片", e.RowIndex).Value.ToString = "" Then : YT網址_tb.Text = "https://www.youtube.com/watch?v=OFz9oZptTh4"
  65. Else : YT網址_tb.Text = 子項目_dgv("影片", e.RowIndex).Value.ToString : End If : 播放YT()
  66. End If
  67. End Sub
  68. Private Sub 控制表_dgv_RowPostPaint(ByVal sender As Object, ByVal e As DataGridViewRowPostPaintEventArgs) Handles 子項目_dgv.RowPostPaint
  69. Dim linePen As New Pen(Color.Blue, 2)
  70. If e.RowIndex = 子項目_dgv.Rows.Count - 1 Then
  71. Exit Sub
  72. Else
  73. If 子項目_dgv(2, e.RowIndex).Value.ToString <> 子項目_dgv(2, e.RowIndex + 1).Value.ToString Then
  74. Dim startX As Integer = IIf(子項目_dgv.RowHeadersVisible, 子項目_dgv.RowHeadersWidth, 0)
  75. Dim startY As Integer = e.RowBounds.Top + e.RowBounds.Height - 1
  76. Dim endX As Integer = startX + 子項目_dgv.Columns.GetColumnsWidth(DataGridViewElementStates.Visible) - 子項目_dgv.HorizontalScrollingOffset
  77. e.Graphics.DrawLine(linePen, startX, startY, endX, startY)
  78. Exit Sub
  79. End If
  80. End If
  81. End Sub
  82. Private Sub 主功能_cb_SelectedIndexChanged(sender As Object, e As EventArgs) Handles 主功能_cb.SelectedIndexChanged
  83. 主功能編號_cb.SelectedIndex = 主功能_cb.SelectedIndex
  84. End Sub
  85. Private Sub 主功能編號_cb_SelectedIndexChanged(sender As Object, e As EventArgs) Handles 主功能編號_cb.SelectedIndexChanged
  86. Set_合約清單()
  87. End Sub
  88. Private Sub CanceL2_bt_Click(sender As Object, e As EventArgs) Handles CanceL2_bt.Click
  89. If 視窗2_pl.Visible = False Then : 視窗2_pl.Visible = True : 視窗2_pl.BringToFront() : Else
  90. 視窗2_pl.Visible = False : End If
  91. End Sub
  92. Private Sub 編輯_bt_Click(sender As Object, e As EventArgs) Handles 編輯_bt.Click
  93. 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
  94. End Sub
  95. Private Sub 影片測試_tb_Click(sender As Object, e As EventArgs) Handles 影片測試_tb.Click
  96. If 網址_tb.Text = "" Then : If 系統語言 = "繁體中文" Then : MsgBox("沒有指定網址!!") : Else : MsgBox("Tidak ada URL yang ditentukan!!") : End If : Else
  97. Try : YT網址_tb.Text = 網址_tb.Text : 播放YT() : Catch ex As Exception : MsgBox(ex.Message) : End Try
  98. End If
  99. End Sub
  100. Private Sub 開新的請款單_bt_Click(sender As Object, e As EventArgs) Handles 開新的請款單_bt.Click
  101. Dim 細項 As Integer
  102. If 主項_tb.Text = "" Then : If 系統語言 = "繁體中文" Then : MsgBox("請先選擇要編輯的項目!!") : Else : MsgBox("Silakan pilih item untuk diedit terlebih dahulu!!") : End If : Else
  103. If 標題_中_tb.Text = "" Then : If 系統語言 = "繁體中文" Then : MsgBox("沒有標題!!") : Else : MsgBox("Tanpa Judul!!") : End If : Else
  104. If 說明_中_tb.Text = "" Then : If 系統語言 = "繁體中文" Then : MsgBox("沒有說明!!") : Else : MsgBox("Tidak Ada Deskripsi!!") : End If : Else
  105. If 網址_tb.Text = "" Then : If 系統語言 = "繁體中文" Then : MsgBox("沒有指定網址!!") : Else : MsgBox("Tidak ada URL yang ditentukan!!") : End If : Else
  106. PA47 = 主項_tb.Text : PA46 = 子項_tb.Text : SQL_系統教學說明讀取()
  107. If dr.Read Then : 細項 = dr("細項") + 1 : Else : 細項 = 1 : End If
  108. PA = 主項_tb.Text : PA1 = 子項_tb.Text : PA2 = 細項 : PA3 = "" : PA4 = "" : PA5 = 標題_中_tb.Text
  109. PA6 = 說明_中_tb.Text : PA7 = "繁體中文" : PA8 = 網址_tb.Text : SQL_統教學說明新增()
  110. PA = 主項_tb.Text : PA1 = 子項_tb.Text : PA2 = 細項 : PA3 = "" : PA4 = "" : PA5 = 標題_英_tb.Text
  111. PA6 = 說明_英_tb.Text : PA7 = "Indonesian" : PA8 = 網址_tb.Text : SQL_統教學說明新增()
  112. MsgBox("新增完成!! / Tambahkan selesai!!")
  113. End If
  114. End If
  115. End If
  116. End If : Set_合約清單()
  117. End Sub
  118. Private Sub 存檔_bt_Click(sender As Object, e As EventArgs) Handles 存檔_bt.Click
  119. If 細項_tb.Text = "0" Then : If 系統語言 = "繁體中文" Then : MsgBox("系統結構資料不可編輯!!") : Else : MsgBox("Data struktur sistem tidak dapat diedit!!") : End If : Else
  120. If 主項_tb.Text = "" Then : If 系統語言 = "繁體中文" Then : MsgBox("請先選擇要編輯的項目!!") : Else : MsgBox("Silakan pilih item untuk diedit terlebih dahulu!!") : End If : Else
  121. If 標題_中_tb.Text = "" Then : If 系統語言 = "繁體中文" Then : MsgBox("沒有標題!!") : Else : MsgBox("Tanpa Judul!!") : End If : Else
  122. If 說明_中_tb.Text = "" Then : If 系統語言 = "繁體中文" Then : MsgBox("沒有說明!!") : Else : MsgBox("Tidak Ada Deskripsi!!") : End If : Else
  123. If 網址_tb.Text = "" Then : If 系統語言 = "繁體中文" Then : MsgBox("沒有指定網址!!") : Else : MsgBox("Tidak ada URL yang ditentukan!!") : End If : Else
  124. PA = 主項_tb.Text : PA1 = 子項_tb.Text : PA2 = 細項_tb.Text : PA3 = "" : PA4 = "" : PA5 = 標題_中_tb.Text
  125. PA6 = 說明_中_tb.Text : PA7 = "繁體中文" : PA8 = 網址_tb.Text : SQL_統教學說明修改()
  126. PA = 主項_tb.Text : PA1 = 子項_tb.Text : PA2 = 細項_tb.Text : PA3 = "" : PA4 = "" : PA5 = 標題_英_tb.Text
  127. PA6 = 說明_英_tb.Text : PA7 = "Indonesian" : PA8 = 網址_tb.Text : SQL_統教學說明修改()
  128. MsgBox("修改完成!! / Modifikasi selesai!!")
  129. End If
  130. End If
  131. End If
  132. End If : Set_合約清單()
  133. End If
  134. End Sub
  135. Private Sub 刪除_bt_Click(sender As Object, e As EventArgs) Handles 刪除_bt.Click
  136. If 細項_tb.Text = "0" Then : If 系統語言 = "繁體中文" Then : MsgBox("系統結構資料不可編輯!!") : Else : MsgBox("Data struktur sistem tidak dapat diedit!!") : End If : Else
  137. 輸入密碼.ShowDialog()
  138. If PA = "0013975151" Then
  139. Dim SS As String : If 系統語言 = "繁體中文" Then : SS = "確定要刪除這筆資料嗎??" : Else : SS = "Apakah Anda yakin ingin menghapus data ini???" : End If
  140. Dim aa As MsgBoxResult = MsgBox(SS, MsgBoxStyle.OkCancel)
  141. If aa = MsgBoxResult.Ok Then : PA = 主項_tb.Text : PA1 = 子項_tb.Text : PA2 = 細項_tb.Text : SQL_統教學說明刪除() : Set_合約清單() : End If
  142. Else : If 系統語言 = "繁體中文" Then : MsgBox("你沒有權限刪除物料!!") : Else : MsgBox("Anda tidak memiliki izin untuk menghapus materi!!") : End If : End If
  143. End If
  144. End Sub
  145. Private Sub 翻譯_bt_Click(sender As Object, e As EventArgs) Handles 翻譯_bt.Click
  146. Me.Enabled = False
  147. If 系統語言 = "繁體中文" Then : 翻譯 = 標題_中_tb.Text : MyModule2.執行翻譯() : 第1段開始 = True : 第2段開始 = False : 等待翻譯_tim.Enabled = True
  148. Else : 翻譯 = 標題_英_tb.Text : MyModule2.執行翻譯() : 第1段開始 = True : 第2段開始 = False : 等待翻譯_tim.Enabled = True : End If
  149. End Sub
  150. Private Sub 等待翻譯_tim_Tick(sender As Object, e As EventArgs) Handles 等待翻譯_tim.Tick
  151. If 系統語言 = "繁體中文" Then : If 第1段開始 = True Then : If 標題_中_tb.Text <> "" Then
  152. Dim Str2 As String = System.Windows.Forms.Application.StartupPath : Dim stringReader As String : Dim fileReader As StreamReader
  153. If File.Exists(Str2 & "\in.txt") Then
  154. fileReader = My.Computer.FileSystem.OpenTextFileReader(Str2 & "\in.txt") : stringReader = fileReader.ReadToEnd()
  155. 標題_英_tb.Text = stringReader : fileReader.Close() : 第1段開始 = False : 第2段開始 = True : 翻譯 = 說明_中_tb.Text : MyModule2.執行翻譯()
  156. End If
  157. Else : 第1段開始 = False : 第2段開始 = True : 翻譯 = 說明_中_tb.Text : MyModule2.執行翻譯() : End If
  158. Else : 第1段開始 = False : 第2段開始 = True : 翻譯 = 說明_中_tb.Text : MyModule2.執行翻譯() : End If
  159. If 第2段開始 = True Then : If 說明_中_tb.Text <> "" Then
  160. Dim Str2 As String = System.Windows.Forms.Application.StartupPath : Dim stringReader As String : Dim fileReader As StreamReader
  161. If File.Exists(Str2 & "\in.txt") Then
  162. fileReader = My.Computer.FileSystem.OpenTextFileReader(Str2 & "\in.txt") : stringReader = fileReader.ReadToEnd()
  163. 說明_英_tb.Text = stringReader : fileReader.Close() : 第2段開始 = False
  164. 等待翻譯_tim.Enabled = False : Me.Enabled = True
  165. If 系統語言 = "繁體中文" Then : MsgBox("翻譯完成!!") : Else : MsgBox("Terjemahan Selesai!!") : End If
  166. End If
  167. Else : 第2段開始 = False : 等待翻譯_tim.Enabled = False : Me.Enabled = True
  168. If 系統語言 = "繁體中文" Then : MsgBox("翻譯完成!!") : Else : MsgBox("Terjemahan Selesai!!") : End If : End If
  169. Else : 第2段開始 = False : 等待翻譯_tim.Enabled = False : Me.Enabled = True
  170. If 系統語言 = "繁體中文" Then : MsgBox("翻譯完成!!") : Else : MsgBox("Terjemahan Selesai!!") : End If : End If
  171. Else
  172. If 第1段開始 = True Then : If 標題_英_tb.Text <> "" Then
  173. Dim Str2 As String = System.Windows.Forms.Application.StartupPath : Dim stringReader As String : Dim fileReader As StreamReader
  174. If File.Exists(Str2 & "\ch.txt") Then
  175. fileReader = My.Computer.FileSystem.OpenTextFileReader(Str2 & "\ch.txt") : stringReader = fileReader.ReadToEnd()
  176. 標題_中_tb.Text = stringReader : fileReader.Close() : 第1段開始 = False : 第2段開始 = True : 翻譯 = 說明_英_tb.Text : MyModule2.執行翻譯()
  177. End If
  178. Else : 第1段開始 = False : 第2段開始 = True : 翻譯 = 說明_英_tb.Text : MyModule2.執行翻譯() : End If
  179. Else : 第1段開始 = False : 第2段開始 = True : 翻譯 = 說明_英_tb.Text : MyModule2.執行翻譯() : End If
  180. If 第2段開始 = True Then : If 說明_英_tb.Text <> "" Then
  181. Dim Str2 As String = System.Windows.Forms.Application.StartupPath : Dim stringReader As String : Dim fileReader As StreamReader
  182. If File.Exists(Str2 & "\ch.txt") Then
  183. fileReader = My.Computer.FileSystem.OpenTextFileReader(Str2 & "\ch.txt") : stringReader = fileReader.ReadToEnd()
  184. 說明_中_tb.Text = stringReader : fileReader.Close() : 第2段開始 = False
  185. 等待翻譯_tim.Enabled = False : Me.Enabled = True : If 系統語言 = "繁體中文" Then : MsgBox("翻譯完成!!") : Else : MsgBox("Terjemahan Selesai!!") : End If
  186. End If
  187. Else : 第2段開始 = False : 等待翻譯_tim.Enabled = False : Me.Enabled = True
  188. If 系統語言 = "繁體中文" Then : MsgBox("翻譯完成!!") : Else : MsgBox("Terjemahan Selesai!!") : End If : End If
  189. Else : 第2段開始 = False : 等待翻譯_tim.Enabled = False : Me.Enabled = True
  190. If 系統語言 = "繁體中文" Then : MsgBox("翻譯完成!!") : Else : MsgBox("Terjemahan Selesai!!") : End If : End If
  191. End If
  192. End Sub
  193. Private Sub 視窗2_pl_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles 視窗2_pl.MouseDown
  194. If e.Button = MouseButtons.Left Then : OldX = e.X : OldY = e.Y : drag = True : End If
  195. End Sub
  196. Private Sub 視窗2_pl_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles 視窗2_pl.MouseMove
  197. If drag Then : 視窗2_pl.Left = 視窗2_pl.Left + e.X - OldX : 視窗2_pl.Top = 視窗2_pl.Top + e.Y - OldY : End If
  198. End Sub
  199. Private Sub 視窗2_pl_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles 視窗2_pl.MouseUp
  200. drag = False
  201. End Sub
  202. End Class