Aucune description
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

合約編號修改器.vb 4.4KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. Public Class 合約編號修改器
  2. Private Sub 合約編號修改器_Load(sender As Object, e As EventArgs) Handles MyBase.Load
  3. End Sub
  4. Private Sub 合約編號修改器_Shown(sender As Object, e As EventArgs) Handles MyBase.Shown
  5. 合約編號_tb.Text = PA18 : 合約編號1_tb.Text = PA19 : 合約編號2_tb.Text = PA20 : 合約編號3_tb.Text = PA21
  6. If Strings.Left(PA18, 2) = "HX" Then : 合約編號_cb.Text = "HX" : ElseIf Strings.Left(PA18, 3) = "PGS" Then : 合約編號_cb.Text = "PGS" : Else : 合約編號_cb.Text = "" : End If
  7. End Sub
  8. Private Sub 合約編號修正_bt_Click(sender As Object, e As EventArgs) Handles 合約編號修正_bt.Click
  9. Dim 合約編號條件 As Boolean = True
  10. If 合約編號_cb.Text = "" Then : If 系統語言 = "繁體中文" Then : MsgBox("沒有選擇我方公司!!") : Else : MsgBox("Silakan pilih perusahaan kami!!") : End If : 合約編號條件 = False : End If
  11. If 合約編號1_tb.Text = "" Then
  12. If 系統語言 = "繁體中文" Then : MsgBox("沒有甲方公司英文縮寫!!") : Else : MsgBox("Silakan masukkan singkatan dari perusahaan Pihak A!!") : End If : 合約編號條件 = False : Else
  13. Dim d As Int32
  14. For index = 0 To 合約編號1_tb.Text.Length - 1
  15. d = Asc(合約編號1_tb.Text(index))
  16. Dim 可能不行 As Boolean = False
  17. If (d < 65 Or d > 90) Then : 可能不行 = True : End If 'c變數若在65~90是大寫的英文字母
  18. If 可能不行 = True Then
  19. If (d < 97 Or d > 122) Then : 可能不行 = True : Else : 可能不行 = False : End If 'c變數若在97~122是小寫的英文字母
  20. If 可能不行 = True Then '然後查表, c變數若在48~57, 表示它是數字,
  21. If (d < 48 Or d > 57) Then
  22. If 系統語言 = "繁體中文" Then : MsgBox("甲方公司簡稱需要英文或是數字,不可以是中文或其他符號!!")
  23. Else : MsgBox("Singkatan dari perusahaan Pihak A harus dalam bahasa Inggris atau angka, bukan dalam bahasa Cina atau simbol lainnya!!") : End If
  24. 合約編號條件 = False : Exit For : End If
  25. End If
  26. End If
  27. Next
  28. End If
  29. If 合約編號2_tb.Text = "" Then
  30. If 系統語言 = "繁體中文" Then : MsgBox("沒有立約日期!!") : Else : MsgBox("Tidak ada tanggal kontrak!!") : End If : 合約編號條件 = False : End If
  31. Dim c As Int32 '然後查表, c變數若在48~57, 表示它是數字,
  32. For index = 0 To 合約編號2_tb.Text.Length - 1
  33. c = Asc(合約編號2_tb.Text(index))
  34. If c < 48 Or c > 57 Then
  35. If 系統語言 = "繁體中文" Then : MsgBox("立約日期只能是數字!!") : Else : MsgBox("Tanggal perjanjian hanya bisa berupa angka!!") : End If : 合約編號條件 = False : Exit For : Else
  36. If Len(合約編號2_tb.Text) <> 6 Then
  37. If 系統語言 = "繁體中文" Then : MsgBox("立約日期的格式為YYMMDD (年兩位,月兩位,日兩位),數字規格不符!!")
  38. Else : MsgBox("Format tanggal kontrak adalah YYMMDD (dua digit untuk tahun, dua digit untuk bulan, dan dua digit untuk hari), dan spesifikasi numerik tidak cocok!!") : End If
  39. 合約編號條件 = False : Exit For : End If
  40. End If
  41. Next
  42. If 合約編號3_tb.Text = "" Then
  43. If 系統語言 = "繁體中文" Then : MsgBox("沒有合約序號!!") : Else : MsgBox("Tidak ada nomor kontrak!!") : End If : 合約編號條件 = False
  44. ElseIf IsNumeric(合約編號3_tb.Text) = False Then
  45. If 系統語言 = "繁體中文" Then : MsgBox("序號只能是數字!!") : Else : MsgBox("Nomor seri hanya bisa berupa angka!!") : End If : 合約編號條件 = False
  46. End If
  47. If 合約編號條件 = False Then : Else
  48. PA17 = 合約編號_tb.Text : PA18 = 合約編號_cb.Text & "-" & 合約編號1_tb.Text & " " & 合約編號2_tb.Text & "-" & 合約編號3_tb.Text
  49. PA19 = 合約編號1_tb.Text : PA20 = 合約編號2_tb.Text : PA21 = 合約編號3_tb.Text : PA22 = 合約編號_cb.Text
  50. SQL_合約編號修改()
  51. Me.Close()
  52. End If
  53. End Sub
  54. End Class