暂无描述
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

簽名檔管理.vb 6.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. Imports System.IO
  2. Public Class 簽名檔管理
  3. Dim EDR As Integer = 0 : Dim ESTR As String
  4. Private Sub Set_清單()
  5. Dim ds As New DataSet
  6. DataGridView1.DataSource = Nothing : ds.Clear()
  7. DataGridView1.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
  8. DataGridView1.ColumnHeadersHeight = 25
  9. DataGridView1.AllowUserToAddRows = False
  10. SQL_簽名檔管理_簽名檔清單()
  11. da.Fill(ds) : DataGridView1.DataSource = ds.Tables(0) : conn.Close()
  12. DataGridView1.Columns(0).FillWeight = 221 : DataGridView1.Columns(1).FillWeight = 220
  13. End Sub
  14. Private Sub ComboBox1下拉表單資料載入()
  15. SQL_簽名檔管理_取得職稱() : 簽名檔持有人_cb.Items.Clear() : While (dr.Read()) : 簽名檔持有人_cb.Items.Add(dr("姓名")) : End While
  16. End Sub
  17. Private Sub 載入系統語言()
  18. If 系統語言 = "繁體中文" Then
  19. 表頭(87) = "圖檔編碼" : 表頭(162) = "簽名檔人名" : 檔案名稱_lb.Text = "檔案名稱" : 簽名檔持有人_lb.Text = "簽名檔持有人" : 圖檔編號_lb.Text = "圖檔編號"
  20. Me.Text = "簽名檔管理"
  21. Else
  22. 表頭(87) = "Pengkodean gambar" : 表頭(162) = "Nama file tanda tangan"
  23. 檔案名稱_lb.Text = "Nama file" : 簽名檔持有人_lb.Text = "Pemegang file tanda tangan" : 圖檔編號_lb.Text = "Pengkodean gambar"
  24. Me.Text = "Manajemen file tanda tangan"
  25. End If
  26. End Sub
  27. Private Sub 簽名檔管理_Load(sender As Object, e As EventArgs) Handles MyBase.Load
  28. 介面 = "H711" : 載入系統語言() : Set_清單()
  29. End Sub
  30. Private Sub DataGridView1_CellClick(ByVal sender As System.Object, ByVal e As DataGridViewCellEventArgs) Handles DataGridView1.CellClick
  31. If e.RowIndex = -1 Then : Else
  32. 圖檔編號_tb.Text = DataGridView1(0, e.RowIndex).Value.ToString : 簽名檔持有人_cb.Text = DataGridView1(1, e.RowIndex).Value.ToString
  33. SQL_簽名檔管理_取得簽名檔圖檔()
  34. While dr.Read() = True
  35. Dim unused As Byte() = New Byte(-1) {}
  36. Dim bytes As Byte() = DirectCast(dr.Item("簽名檔圖片"), Byte())
  37. Dim oStream As New MemoryStream(bytes)
  38. PictureBox1.Image = Bitmap.FromStream(oStream)
  39. End While
  40. PictureBox1.SizeMode = 4
  41. End If
  42. End Sub
  43. Private Sub Button2_Click(sender As Object, e As EventArgs) Handles 簽名檔入系統_bt.Click
  44. SQL_簽名檔管理_取得圖表編號()
  45. If dr.Read() Then : EDR = Double.Parse(Strings.Right(dr("圖片流水號").ToString, 8)) : Else : EDR = 0 : End If
  46. conn.Close() : EDR += 1 : ESTR = "PG" & CStr(EDR).PadLeft(8, "0")
  47. 'If EDR < 10 Then : ESTR = "PG" & "0000000" & EDR
  48. 'ElseIf EDR > 9 And EDR < 100 Then : ESTR = "PG" & "000000" & EDR
  49. 'ElseIf EDR > 99 And EDR < 1000 Then : ESTR = "PG" & "00000" & EDR
  50. 'ElseIf EDR > 999 And EDR < 10000 Then : ESTR = "PG" & "0000" & EDR
  51. 'ElseIf EDR > 9999 And EDR < 100000 Then : ESTR = "PG" & "000" & EDR
  52. 'ElseIf EDR > 99999 And EDR < 100000 Then : ESTR = "PG" & "00" & EDR
  53. 'ElseIf EDR > 999999 And EDR < 1000000 Then : ESTR = "PG" & "0" & EDR
  54. 'ElseIf EDR > 9999999 Then : ESTR = "PG" & EDR
  55. 'End If
  56. 圖檔編號_tb.Text = ESTR
  57. If TextBox4.Text = "" Or 簽名檔持有人_cb.Text = "" Then
  58. If 系統語言 = "繁體中文" Then : MsgBox("請先確定圖片資料已準備完畢!!") : Else : MsgBox("Pastikan data gambar sudah siap!!") : End If
  59. Else
  60. PA49 = TextBox4.Text : SQL_簽名檔管理_簽名檔入系統()
  61. SQL_簽名檔管理_取得簽名檔圖檔()
  62. While dr.Read() = True
  63. Dim unused As Byte() = New Byte(-1) {}
  64. Dim bytes As Byte() = DirectCast(dr.Item("簽名檔圖片"), Byte())
  65. Dim oStream As New MemoryStream(bytes)
  66. PictureBox1.Image = Bitmap.FromStream(oStream)
  67. End While
  68. PictureBox1.SizeMode = 4 : Set_清單() : 圖檔編號_tb.Text = "" : TextBox4.Text = ""
  69. End If
  70. End Sub
  71. Private Sub Button3_Click(sender As Object, e As EventArgs) Handles 刪除簽名檔_bt.Click
  72. If 圖檔編號_tb.Text = "" Then : Else
  73. Dim SS As String
  74. If 系統語言 = "繁體中文" Then : SS = "確定要刪除該筆資料?" : Else : SS = "Anda yakin ingin menghapus data ini?" : End If
  75. Dim aa As MsgBoxResult = MsgBox(SS, MsgBoxStyle.OkCancel)
  76. If aa = MsgBoxResult.Ok Then : SQL_簽名檔管理_刪除簽名檔() : Set_清單() : 圖檔編號_tb.Text = "" : End If
  77. End If
  78. End Sub
  79. Private Sub 語轉扭_bt_Click(sender As Object, e As EventArgs) Handles 語轉扭_bt.Click
  80. If 系統語言 = "繁體中文" Then : 系統語言 = "Ind" : Else : 系統語言 = "繁體中文" : End If : 介面 = "H711" : 載入系統語言() : Set_清單()
  81. End Sub
  82. Private Sub 選擇檔案_bt_Click(sender As Object, e As EventArgs) Handles 選擇檔案_bt.Click
  83. Dim fileDialog As New OpenFileDialog With {
  84. .Filter = "Image Files|*.jpg;*.png|All Files|*.*",
  85. .FilterIndex = 0,
  86. .RestoreDirectory = True
  87. }
  88. If 系統語言 = "繁體中文" Then : fileDialog.Title = "選擇檔案" : Else : fileDialog.Title = "Pilih file" : End If
  89. If fileDialog.ShowDialog = DialogResult.OK Then : TextBox4.Text = fileDialog.FileName : End If
  90. End Sub
  91. Private Sub 選擇檔案_bt_MouseEnter(sender As Object, e As EventArgs) Handles 選擇檔案_bt.MouseEnter
  92. ToolTip1.SetToolTip(Me.選擇檔案_bt, "選擇檔案")
  93. End Sub
  94. Private Sub 簽名檔入系統_bt_MouseEnter(sender As Object, e As EventArgs) Handles 簽名檔入系統_bt.MouseEnter
  95. ToolTip1.SetToolTip(Me.簽名檔入系統_bt, "簽名檔入系統")
  96. End Sub
  97. Private Sub 刪除簽名檔_bt_MouseEnter(sender As Object, e As EventArgs) Handles 刪除簽名檔_bt.MouseEnter
  98. ToolTip1.SetToolTip(Me.刪除簽名檔_bt, "刪除簽名檔")
  99. End Sub
  100. End Class