Bez popisu
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.

系統編碼規則_1.vb 28KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404
  1. Option Strict Off
  2. Public Class 系統編碼規則_1
  3. ReadOnly ds As New DataSet : ReadOnly ds1 As New DataSet : ReadOnly ds2 As New DataSet : ReadOnly ds3 As New DataSet : ReadOnly ds6 As New DataSet : ReadOnly ds9 As New DataSet
  4. ReadOnly ds10 As New DataSet : ReadOnly ds11 As New DataSet
  5. Dim EDR As Integer = 0 : Dim ESTR As String
  6. Private Sub Set_FTP位置()
  7. DataGridView10.DataSource = Nothing : ds9.Clear() : DataGridView10.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
  8. DataGridView10.ColumnHeadersHeight = 25 : DataGridView10.AllowUserToAddRows = False
  9. SQL_FTP伺服器清單()
  10. da.Fill(ds9) : DataGridView10.DataSource = ds9.Tables(0) : conn.Close()
  11. DataGridView10.Columns(0).FillWeight = 234 : DataGridView10.Columns(1).FillWeight = 100 : DataGridView10.Columns(2).FillWeight = 100 : DataGridView10.Columns(3).FillWeight = 40
  12. End Sub
  13. Private Sub Set_付款方式()
  14. DataGridView1.DataSource = Nothing : ds.Clear() : DataGridView1.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
  15. DataGridView1.ColumnHeadersHeight = 25 : DataGridView1.AllowUserToAddRows = False
  16. SQL_付款方式清單()
  17. da.Fill(ds) : DataGridView1.DataSource = ds.Tables(0) : conn.Close()
  18. DataGridView1.Columns(0).FillWeight = 10 : DataGridView1.Columns(1).FillWeight = 30
  19. End Sub
  20. Private Sub Set_職別()
  21. DataGridView2.DataSource = Nothing : ds1.Clear() : DataGridView2.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
  22. DataGridView2.ColumnHeadersHeight = 25 : DataGridView2.AllowUserToAddRows = False
  23. SQL_職別清單()
  24. da.Fill(ds1) : DataGridView2.DataSource = ds1.Tables(0) : conn.Close()
  25. DataGridView2.Columns(0).FillWeight = 10 : DataGridView2.Columns(1).FillWeight = 30
  26. End Sub
  27. Private Sub Set_負責區域()
  28. DataGridView3.DataSource = Nothing : ds2.Clear() : DataGridView3.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
  29. DataGridView3.ColumnHeadersHeight = 25 : DataGridView3.AllowUserToAddRows = False
  30. SQL_負責區域清單()
  31. da.Fill(ds2) : DataGridView3.DataSource = ds2.Tables(0) : conn.Close()
  32. DataGridView3.Columns(0).FillWeight = 10 : DataGridView3.Columns(1).FillWeight = 30
  33. End Sub
  34. Private Sub Set_會計科目()
  35. DataGridView7.DataSource = Nothing : ds3.Clear() : DataGridView7.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
  36. DataGridView7.ColumnHeadersHeight = 25 : DataGridView7.AllowUserToAddRows = False
  37. SQL_會計科目清單()
  38. da.Fill(ds3) : DataGridView7.DataSource = ds3.Tables(0) : conn.Close()
  39. DataGridView7.Columns(0).FillWeight = 8 : DataGridView7.Columns(1).FillWeight = 8 : DataGridView7.Columns(2).FillWeight = 12 : DataGridView7.Columns(3).FillWeight = 6
  40. DataGridView7.Columns(4).FillWeight = 3 : DataGridView7.Columns(5).FillWeight = 15 : DataGridView7.Columns(6).FillWeight = 3 : DataGridView7.Columns(7).FillWeight = 3
  41. DataGridView7.Columns(8).FillWeight = 3 : DataGridView7.Columns(9).FillWeight = 28 : DataGridView7.Columns(10).FillWeight = 3
  42. End Sub
  43. Private Sub Set_年度清單()
  44. DataGridView4.DataSource = Nothing : ds6.Clear() : DataGridView4.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
  45. DataGridView4.ColumnHeadersHeight = 25 : DataGridView4.AllowUserToAddRows = False
  46. SQL_年份清單()
  47. da.Fill(ds6) : DataGridView4.DataSource = ds6.Tables(0) : conn.Close()
  48. DataGridView4.Columns(0).FillWeight = 100
  49. End Sub
  50. Private Sub Set_公司資料()
  51. DataGridView5.DataSource = Nothing : ds10.Clear() : DataGridView5.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
  52. DataGridView5.ColumnHeadersHeight = 25 : DataGridView5.AllowUserToAddRows = False
  53. SQL_公司資料清單()
  54. da.Fill(ds10) : DataGridView5.DataSource = ds10.Tables(0) : conn.Close()
  55. DataGridView5.Columns(0).FillWeight = 50 : DataGridView5.Columns(1).FillWeight = 100 : DataGridView5.Columns(2).FillWeight = 50 : DataGridView5.Columns(3).FillWeight = 50
  56. DataGridView5.Columns(4).FillWeight = 200
  57. End Sub
  58. Private Sub Set_傭金比例()
  59. DataGridView6.DataSource = Nothing : ds11.Clear() : DataGridView6.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
  60. DataGridView6.ColumnHeadersHeight = 25 : DataGridView6.AllowUserToAddRows = False
  61. SQL_佣金比例()
  62. da.Fill(ds11) : DataGridView6.DataSource = ds11.Tables(0) : conn.Close()
  63. DataGridView6.Columns(0).FillWeight = 100
  64. DataGridView6.Columns(0).DefaultCellStyle.Format = "#,##0.0"
  65. DataGridView6.Columns(0).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter : DataGridView6.Columns(0).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter
  66. End Sub
  67. Private Sub ComboBox1下拉表單資料載入()
  68. SQL_會計科目下拉清單一()
  69. ComboBox1.Items.Clear() : ComboBox2.Items.Clear() : ComboBox1.Text = "" : ComboBox2.Text = ""
  70. While (dr.Read()) : ComboBox1.Items.Add(dr("第一階")) : ComboBox2.Items.Add(dr("編號")) : End While : conn.Close()
  71. End Sub
  72. Private Sub ComboBox3下拉表單資料載入()
  73. SQL_會計科目下拉清單二()
  74. ComboBox3.Items.Clear() : ComboBox4.Items.Clear() : ComboBox3.Text = "" : ComboBox4.Text = ""
  75. While (dr.Read()) : ComboBox3.Items.Add(dr("第二階")) : ComboBox4.Items.Add(dr("編號")) : End While : conn.Close()
  76. End Sub
  77. Private Sub 系統編碼規則_1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
  78. Me.MdiParent = MAOJI_ERP_SYS : Me.WindowState = 2 : Me.AutoScroll = True
  79. TextBox15.Enabled = False : CheckBox5.Checked = True : TextBox16.Enabled = False : ComboBox1下拉表單資料載入()
  80. Set_FTP位置() : Set_付款方式() : Set_職別() : Set_負責區域() : Set_會計科目() : Set_年度清單() : Set_公司資料() : Set_傭金比例()
  81. End Sub
  82. Private Sub DataGridView10_CellClick(ByVal sender As System.Object, ByVal e As DataGridViewCellEventArgs) Handles DataGridView10.CellClick
  83. If e.RowIndex = -1 Then : Else
  84. TextBox24.Text = DataGridView10(0, e.RowIndex).Value.ToString : TextBox23.Text = DataGridView10(1, e.RowIndex).Value.ToString
  85. TextBox22.Text = DataGridView10(2, e.RowIndex).Value.ToString : TextBox21.Text = DataGridView10(3, e.RowIndex).Value.ToString
  86. End If
  87. End Sub
  88. Private Sub DataGridView1_CellClick(ByVal sender As System.Object, ByVal e As DataGridViewCellEventArgs) Handles DataGridView1.CellClick
  89. If e.RowIndex = -1 Then : Else
  90. TextBox1.Text = DataGridView1(0, e.RowIndex).Value.ToString : TextBox2.Text = DataGridView1(1, e.RowIndex).Value.ToString
  91. End If
  92. End Sub
  93. Private Sub DataGridView2_CellClick(ByVal sender As System.Object, ByVal e As DataGridViewCellEventArgs) Handles DataGridView2.CellClick
  94. If e.RowIndex = -1 Then : Else
  95. TextBox4.Text = DataGridView2(0, e.RowIndex).Value.ToString : TextBox3.Text = DataGridView2(1, e.RowIndex).Value.ToString
  96. End If
  97. End Sub
  98. Private Sub DataGridView3_CellClick(ByVal sender As System.Object, ByVal e As DataGridViewCellEventArgs) Handles DataGridView3.CellClick
  99. If e.RowIndex = -1 Then : Else
  100. TextBox6.Text = DataGridView3(0, e.RowIndex).Value.ToString : TextBox5.Text = DataGridView3(1, e.RowIndex).Value.ToString
  101. End If
  102. End Sub
  103. Private Sub DataGridView4_CellClick(ByVal sender As System.Object, ByVal e As DataGridViewCellEventArgs) Handles DataGridView4.CellClick
  104. If e.RowIndex = -1 Then : Else
  105. TextBox9.Text = DataGridView4(0, e.RowIndex).Value.ToString
  106. End If
  107. End Sub
  108. Private Sub DataGridView5_CellClick(ByVal sender As System.Object, ByVal e As DataGridViewCellEventArgs) Handles DataGridView5.CellClick
  109. If e.RowIndex = -1 Then : Else
  110. TextBox14.Text = DataGridView5(0, e.RowIndex).Value.ToString : TextBox13.Text = DataGridView5(1, e.RowIndex).Value.ToString
  111. TextBox12.Text = DataGridView5(2, e.RowIndex).Value.ToString : TextBox11.Text = DataGridView5(3, e.RowIndex).Value.ToString
  112. TextBox10.Text = DataGridView5(4, e.RowIndex).Value.ToString
  113. End If
  114. End Sub
  115. Private Sub DataGridView7_CellClick(ByVal sender As System.Object, ByVal e As DataGridViewCellEventArgs) Handles DataGridView7.CellClick
  116. Dim SSXX As String
  117. If e.RowIndex = -1 Then : Else
  118. ComboBox6.Text = DataGridView7(4, e.RowIndex).Value.ToString : SSXX = DataGridView7(1, e.RowIndex).Value.ToString : ComboBox3.Text = SSXX
  119. If CheckBox5.Checked = True Then
  120. TextBox8.Text = DataGridView7(2, e.RowIndex).Value.ToString : TextBox16.Text = DataGridView7(3, e.RowIndex).Value.ToString
  121. TextBox17.Text = DataGridView7(5, e.RowIndex).Value.ToString : TextBox18.Text = DataGridView7(9, e.RowIndex).Value.ToString
  122. CheckBox1.Checked = DataGridView7(6, e.RowIndex).Value : CheckBox2.Checked = DataGridView7(7, e.RowIndex).Value
  123. CheckBox3.Checked = DataGridView7(8, e.RowIndex).Value
  124. Else : ComboBox6變化() : End If : ComboBox1.Text = DataGridView7(0, e.RowIndex).Value.ToString
  125. End If
  126. End Sub
  127. Private Sub DataGridView7_RowPostPaint(ByVal sender As Object, ByVal e As DataGridViewRowPostPaintEventArgs) Handles DataGridView7.RowPostPaint
  128. Dim linePen As New Pen(Color.Blue, 2)
  129. If e.RowIndex = DataGridView7.Rows.Count - 1 Then : Exit Sub
  130. Else
  131. If DataGridView7(1, e.RowIndex).Value.ToString <> DataGridView7(1, e.RowIndex + 1).Value.ToString Then
  132. Dim startX As Integer = IIf(DataGridView7.RowHeadersVisible, DataGridView7.RowHeadersWidth, 0)
  133. Dim startY As Integer = e.RowBounds.Top + e.RowBounds.Height - 1
  134. Dim endX As Integer = startX + DataGridView7.Columns.GetColumnsWidth(DataGridViewElementStates.Visible) - DataGridView7.HorizontalScrollingOffset
  135. e.Graphics.DrawLine(linePen, startX, startY, endX, startY) : Exit Sub
  136. End If
  137. End If
  138. End Sub
  139. Private Sub DataGridView6_CellClick(ByVal sender As System.Object, ByVal e As DataGridViewCellEventArgs) Handles DataGridView6.CellClick
  140. If e.RowIndex = -1 Then : Else
  141. NumericUpDown1.Value = DataGridView6(0, e.RowIndex).Value.ToString
  142. End If
  143. End Sub
  144. Private Sub ComboBox1_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ComboBox1.TextChanged
  145. ComboBox2.SelectedIndex = ComboBox1.SelectedIndex : ComboBox3下拉表單資料載入()
  146. End Sub
  147. Private Sub ComboBox2_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ComboBox2.TextChanged
  148. ComboBox1.SelectedIndex = ComboBox2.SelectedIndex : Set_會計科目() : ComboBox3下拉表單資料載入()
  149. End Sub
  150. Private Sub ComboBox3_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ComboBox3.TextChanged
  151. ComboBox4.SelectedIndex = ComboBox3.SelectedIndex
  152. End Sub
  153. Private Sub ComboBox4_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ComboBox4.TextChanged
  154. ComboBox3.SelectedIndex = ComboBox4.SelectedIndex
  155. End Sub
  156. Private Sub ComboBox5_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ComboBox5.TextChanged
  157. ComboBox3下拉表單資料載入()
  158. End Sub
  159. Private Sub CheckBox4_CheckedChanged(sender As Object, e As EventArgs) Handles CheckBox4.Click
  160. CheckBox4.Checked = True : CheckBox5.Checked = False : TextBox16.Enabled = True
  161. TextBox8.Text = "" : TextBox17.Text = "" : TextBox18.Text = "" : CheckBox1.Checked = False : CheckBox2.Checked = False : CheckBox3.Checked = False
  162. End Sub
  163. Private Sub CheckBox5_CheckedChanged(sender As Object, e As EventArgs) Handles CheckBox5.Click
  164. CheckBox4.Checked = False : CheckBox5.Checked = True : TextBox16.Enabled = False
  165. End Sub
  166. Private Sub ComboBox6變化()
  167. If ComboBox6.Text = "1" Then : ComboBox5.Text = "1" : ElseIf ComboBox6.Text = "2" Then : ComboBox5.Text = "2" : ElseIf ComboBox6.Text = "3" Then : ComboBox5.Text = "2" : End If
  168. If CheckBox5.Checked = True Then : Else
  169. If ComboBox2.Text = "" Then : Else
  170. If ComboBox6.Text = "1" Then : TextBox16.Text = ""
  171. ElseIf ComboBox6.Text = "2" Then
  172. If ComboBox4.Text = "" Then : Else
  173. '----------------------自动生成流水号-------------------------------------------------------------------------
  174. SQL_會計科目流水號查詢第一段()
  175. If dr.Read() Then : EDR = Double.Parse(Strings.Right(dr("編號").ToString, 2)) : Else : EDR = 0 : End If : conn.Close() : EDR += 1
  176. If EDR < 10 Then : ESTR = ComboBox2.Text & "-" & "0" & EDR & "-00"
  177. ElseIf EDR > 9 And EDR < 100 Then : ESTR = ComboBox2.Text & "-" & "" & EDR & "-00" : End If : TextBox16.Text = ESTR
  178. End If
  179. ElseIf ComboBox6.Text = "3" Then
  180. If ComboBox4.Text = "" Then : Else
  181. '----------------------自动生成流水号-------------------------------------------------------------------------
  182. SQL_會計科目流水號查詢第二段()
  183. If dr.Read() Then : EDR = Double.Parse(Strings.Right(dr("編號").ToString, 2)) : Else : EDR = 0 : End If : conn.Close() : EDR += 1
  184. If EDR < 10 Then : ESTR = ComboBox4.Text & "-" & "0" & EDR
  185. ElseIf EDR > 9 And EDR < 100 Then : ESTR = ComboBox4.Text & "-" & "" & EDR : End If : TextBox16.Text = ESTR
  186. End If
  187. End If
  188. End If
  189. End If
  190. End Sub
  191. Private Sub ComboBox6_TextChanged(sender As Object, e As EventArgs) Handles ComboBox6.TextChanged
  192. ComboBox6變化()
  193. End Sub
  194. Private Sub SET_新增按鈕程式共用2()
  195. CmdSet_For_dr() : Dim unused = MsgBox("新增完成") : conn.Close() : dr.Close()
  196. End Sub
  197. Private Sub SET_修改按鈕程式共用1()
  198. CmdSet_For_dr() : Dim unused = MsgBox("修改完成") : conn.Close()
  199. End Sub
  200. Private Sub SET_刪除按鈕程式共用1()
  201. Dim aa As MsgBoxResult = MsgBox("確定要刪除該筆資料?", MsgBoxStyle.OkCancel)
  202. If aa = MsgBoxResult.Ok Then : ConnOpen() : CmdSet_For_dr() : MsgBox("刪除完成") : End If : conn.Close() : 式共用1()
  203. End Sub
  204. Private Sub 式共用1()
  205. Set_FTP位置() : Set_付款方式() : Set_職別() : Set_負責區域() : Set_會計科目() : Set_年度清單() : Set_公司資料() : Set_傭金比例() : PA = ""
  206. End Sub
  207. Private Sub 式共用2()
  208. dr.Close() : ConnOpen()
  209. End Sub
  210. Private Sub 式共用3()
  211. ConnOpen()
  212. End Sub
  213. '------------------------------------------------------------------------------------------------------------------------------------
  214. Private Sub Button29_Click(sender As Object, e As EventArgs) Handles Button29.Click
  215. If TextBox21.Text = "" Or TextBox24.Text = "" Then : MsgBox("資料有缺或有誤,請重新檢查")
  216. Else
  217. SQL_FTP資料庫管理查詢()
  218. If dr.Read() Then : MsgBox("資料重複,請從新輸入或檢查") : conn.Close() : dr.Close()
  219. Else : 式共用2() : SQL_FTP資料庫管理新增() : SET_新增按鈕程式共用2() : End If
  220. End If : 式共用1()
  221. End Sub
  222. Private Sub Button30_Click(sender As Object, e As EventArgs) Handles Button30.Click
  223. If TextBox21.Text = "" Or TextBox24.Text = "" Then : MsgBox("資料有缺或有誤,請重新檢查")
  224. Else
  225. PA = InputBox("請輸入要修改的FTP地址") : PA1 = InputBox("請輸入要修改的FTP帳號") : PA2 = InputBox("請輸入要修改的FTP密碼")
  226. If PA = "" Then : MsgBox("沒有輸入修改內容")
  227. Else : 式共用3() : SQL_FTP資料庫管理修改() : SET_修改按鈕程式共用1() : End If
  228. End If : 式共用1()
  229. End Sub
  230. Private Sub Button28_Click(sender As Object, e As EventArgs) Handles Button28.Click
  231. SQL_FTP資料庫管理刪除() : SET_刪除按鈕程式共用1()
  232. End Sub
  233. '------------------------------------------------------------------------------------------------------------------------------------
  234. Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
  235. PA = InputBox("請輸入要新增的付款方式") : SQL_付款方式查詢()
  236. If dr.Read() Then : MsgBox("資料重複,請從新輸入或檢查") : conn.Close() : dr.Close()
  237. Else
  238. '----------------------自动生成流水号-------------------------------------------------------------------------
  239. SQL_付款方式流水號查詢()
  240. If dr.Read() Then : EDR = Double.Parse(Strings.Right(dr("編號").ToString, 3)) : Else : EDR = 0 : End If : conn.Close() : EDR += 1
  241. If EDR < 10 Then : ESTR = "PM" & "00" & EDR
  242. ElseIf EDR > 9 And EDR < 100 Then : ESTR = "PM" & "0" & EDR
  243. ElseIf EDR > 99 Then : ESTR = "PM" & EDR : End If : PA1 = ESTR
  244. 式共用2() : SQL_付款方式新增() : SET_新增按鈕程式共用2()
  245. End If : 式共用1()
  246. End Sub
  247. Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
  248. If TextBox1.Text = "" Or TextBox2.Text = "" Then : MsgBox("資料有缺或有誤,請重新檢查")
  249. Else
  250. PA = InputBox("請輸入要修改的付款方式")
  251. If PA = "" Then : MsgBox("沒有輸入修改內容")
  252. Else : 式共用3() : SQL_付款方式修改() : SET_修改按鈕程式共用1() : End If
  253. End If : 式共用1()
  254. End Sub
  255. Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
  256. SQL_付款方式刪除() : SET_刪除按鈕程式共用1()
  257. End Sub
  258. '------------------------------------------------------------------------------------------------------------------------------------
  259. Private Sub Button5_Click(sender As Object, e As EventArgs) Handles Button5.Click
  260. PA = InputBox("請輸入要新增的職別") : SQL_職別查詢()
  261. If dr.Read() Then : MsgBox("資料重複,請從新輸入或檢查") : conn.Close() : dr.Close()
  262. Else
  263. '----------------------自动生成流水号-------------------------------------------------------------------------
  264. SQL_職別流水號最後一筆()
  265. If dr.Read() Then : EDR = Double.Parse(Strings.Right(dr("編號").ToString, 3)) : Else : EDR = 0 : End If : conn.Close() : EDR += 1
  266. If EDR < 10 Then : ESTR = "PS" & "00" & EDR
  267. ElseIf EDR > 9 And EDR < 100 Then : ESTR = "PS" & "0" & EDR
  268. ElseIf EDR > 99 Then : ESTR = "PS" & EDR : End If : PA1 = ESTR
  269. 式共用2() : SQL_職別新增() : SET_新增按鈕程式共用2()
  270. End If : 式共用1()
  271. End Sub
  272. Private Sub Button6_Click(sender As Object, e As EventArgs) Handles Button6.Click
  273. If TextBox4.Text = "" Or TextBox3.Text = "" Then : MsgBox("資料有缺或有誤,請重新檢查")
  274. Else
  275. PA = InputBox("請輸入要修改的職別")
  276. If PA = "" Then : MsgBox("沒有輸入修改內容")
  277. Else : 式共用3() : SQL_職別修改() : SET_修改按鈕程式共用1() : End If
  278. End If : 式共用1()
  279. End Sub
  280. Private Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click
  281. SQL_職別刪除() : SET_刪除按鈕程式共用1()
  282. End Sub
  283. '------------------------------------------------------------------------------------------------------------------------------------
  284. Private Sub Button8_Click(sender As Object, e As EventArgs) Handles Button8.Click
  285. PA = InputBox("請輸入要新增的負責區域") : SQL_負責區域查詢()
  286. If dr.Read() Then : MsgBox("資料重複,請從新輸入或檢查") : conn.Close() : dr.Close()
  287. Else
  288. '----------------------自动生成流水号-------------------------------------------------------------------------
  289. SQL_負責區域流水號最後一筆()
  290. If dr.Read() Then : EDR = Double.Parse(Strings.Right(dr("編號").ToString, 3)) : Else : EDR = 0 : End If : conn.Close() : EDR += 1
  291. If EDR < 10 Then : ESTR = "RA" & "00" & EDR
  292. ElseIf EDR > 9 And EDR < 100 Then : ESTR = "RA" & "0" & EDR
  293. ElseIf EDR > 99 Then : ESTR = "RA" & EDR : End If : PA1 = ESTR
  294. 式共用2() : SQL_負責區域新增() : SET_新增按鈕程式共用2()
  295. End If : 式共用1()
  296. End Sub
  297. Private Sub Button9_Click(sender As Object, e As EventArgs) Handles Button9.Click
  298. If TextBox6.Text = "" Or TextBox5.Text = "" Then : MsgBox("資料有缺或有誤,請重新檢查")
  299. Else
  300. PA = InputBox("請輸入要修改的職別")
  301. If PA = "" Then : MsgBox("沒有輸入修改內容")
  302. Else : 式共用3() : SQL_負責區域修改() : SET_修改按鈕程式共用1()
  303. End If
  304. End If : 式共用1()
  305. End Sub
  306. Private Sub Button7_Click(sender As Object, e As EventArgs) Handles Button7.Click
  307. SQL_負責區域刪除() : SET_刪除按鈕程式共用1()
  308. End Sub
  309. '------------------------------------------------------------------------------------------------------------------------------------
  310. Private Sub Button20_Click(sender As Object, e As EventArgs) Handles Button20.Click
  311. If TextBox8.Text = "" Or ComboBox6.Text = "" Then : MsgBox("資料有缺或有誤,請重新檢查")
  312. Else
  313. SQL_會計科目查詢()
  314. If dr.Read() Then : MsgBox("資料重複,請從新輸入或檢查") : conn.Close() : dr.Close()
  315. Else
  316. 式共用2()
  317. If ComboBox6.Text = "1" Then : SQL_會計科目新增一()
  318. ElseIf ComboBox6.Text = "2" Then : SQL_會計科目新增二()
  319. Else : SQL_會計科目新增三()
  320. End If : SET_新增按鈕程式共用2()
  321. End If
  322. End If : 式共用1()
  323. End Sub
  324. Private Sub Button19_Click(sender As Object, e As EventArgs) Handles Button19.Click
  325. If TextBox8.Text = "" Then : MsgBox("資料有缺或有誤,請重新檢查")
  326. Else
  327. PA1 = TextBox8.Text : PA2 = ComboBox6.Text : PA3 = TextBox17.Text : 布林1 = CheckBox1.Checked : 布林2 = CheckBox2.Checked : 布林3 = CheckBox3.Checked
  328. PA4 = TextBox18.Text : PA5 = ComboBox1.Text : PA6 = ComboBox3.Text : 布林4 = CheckBox6.Checked : PA7 = TextBox16.Text
  329. SQL_會計科目修改() : MsgBox("修改完成")
  330. End If : 式共用1()
  331. End Sub
  332. Private Sub Button16_Click(sender As Object, e As EventArgs) Handles Button16.Click
  333. For i As Integer = 0 To DataGridView7.Rows.Count - 1
  334. 資料數 = DataGridView7.Rows.Count : MyModule1.進度條()
  335. PA1 = DataGridView7.Rows(i).Cells("會計科目").Value : PA2 = DataGridView7.Rows(i).Cells("層級").Value : PA3 = DataGridView7.Rows(i).Cells("英文名稱").Value
  336. 布林1 = DataGridView7.Rows(i).Cells("統制科目").Value : 布林2 = DataGridView7.Rows(i).Cells("抵銷科目").Value : 布林3 = DataGridView7.Rows(i).Cells("停用").Value
  337. PA4 = DataGridView7.Rows(i).Cells("附註").Value : PA5 = DataGridView7.Rows(i).Cells("第一階").Value : PA6 = DataGridView7.Rows(i).Cells("第二階").Value
  338. 布林4 = DataGridView7.Rows(i).Cells("顯示").Value : PA7 = DataGridView7.Rows(i).Cells("編號").Value
  339. SQL_會計科目修改() : conn.Close()
  340. Next : MAOJI_ERP_SYS.ToolStripProgressBar1.Value = 0 : 最終數 = 0 : MsgBox("修改完成")
  341. End Sub
  342. Private Sub Button21_Click(sender As Object, e As EventArgs) Handles Button21.Click
  343. SQL_會計科目刪除() : SET_刪除按鈕程式共用1()
  344. End Sub
  345. '------------------------------------------------------------------------------------------------------------------------------------
  346. Private Sub Button11_Click(sender As Object, e As EventArgs) Handles Button11.Click
  347. If TextBox9.Text = "" Then : MsgBox("資料有缺或有誤,請重新檢查")
  348. Else
  349. PA = TextBox9.Text : SQL_年份清單查詢()
  350. If dr.Read() Then : MsgBox("資料重複,請從新輸入或檢查") : conn.Close() : dr.Close()
  351. Else : 式共用2() : SQL_年份清單新增() : SET_新增按鈕程式共用2() : End If
  352. End If : 式共用1()
  353. End Sub
  354. Private Sub Button10_Click(sender As Object, e As EventArgs) Handles Button10.Click
  355. If TextBox9.Text = "" Then : MsgBox("資料有缺或有誤,請重新檢查")
  356. Else
  357. PA = InputBox("請輸入要修改的內容")
  358. If PA = "" Then : MsgBox("沒有輸入修改內容")
  359. Else : 式共用3() : SQL_年份清單修改() : SET_修改按鈕程式共用1() : End If
  360. End If : 式共用1()
  361. End Sub
  362. Private Sub Button12_Click(sender As Object, e As EventArgs) Handles Button12.Click
  363. SQL_年份清單刪除() : SET_刪除按鈕程式共用1()
  364. End Sub
  365. '------------------------------------------------------------------------------------------------------------------------------------
  366. Private Sub Button14_Click(sender As Object, e As EventArgs) Handles Button14.Click
  367. If TextBox13.Text = "" Then : MsgBox("資料有缺或有誤,請重新檢查")
  368. Else
  369. PA = TextBox13.Text : SQL_公司基本資料宣告()
  370. If dr.Read() Then : MsgBox("資料重複,請從新輸入或檢查") : conn.Close() : dr.Close()
  371. Else
  372. '----------------------自动生成流水号-------------------------------------------------------------------------
  373. SQL_公司基本資料流水號最後一筆()
  374. If dr.Read() Then : EDR = Double.Parse(Strings.Right(dr("公司編號").ToString, 3)) : Else : EDR = 0 : End If : conn.Close() : EDR += 1
  375. If EDR < 10 Then : ESTR = "CO" & "00" & EDR
  376. ElseIf EDR > 9 And EDR < 100 Then : ESTR = "CO" & "0" & EDR
  377. ElseIf EDR > 99 Then : ESTR = "CO" & EDR : End If : TextBox14.Text = ESTR
  378. 式共用2() : SQL_公司基本資料新增() : SET_新增按鈕程式共用2()
  379. End If
  380. End If : 式共用1()
  381. End Sub
  382. Private Sub Button15_Click(sender As Object, e As EventArgs) Handles Button15.Click
  383. If TextBox9.Text = "" Then : MsgBox("資料有缺或有誤,請重新檢查")
  384. Else
  385. PA = InputBox("請輸入要修改的內容")
  386. If PA = "" Then : MsgBox("沒有輸入修改內容")
  387. Else
  388. 式共用3() : SQL_公司基本資料修改() : SET_修改按鈕程式共用1()
  389. End If
  390. End If : 式共用1()
  391. End Sub
  392. Private Sub Button13_Click(sender As Object, e As EventArgs) Handles Button13.Click
  393. SQL_公司基本資料刪除() : SET_刪除按鈕程式共用1()
  394. End Sub
  395. '------------------------------------------------------------------------------------------------------------------------------------
  396. Private Sub Button18_Click(sender As Object, e As EventArgs) Handles Button18.Click
  397. SQL_佣金比例查詢()
  398. If dr.Read() Then : MsgBox("資料重複,請從新輸入或檢查") : conn.Close() : dr.Close()
  399. Else : 式共用2() : SQL_佣金比例新增() : SET_新增按鈕程式共用2() : End If : 式共用1()
  400. End Sub
  401. Private Sub Button22_Click(sender As Object, e As EventArgs) Handles Button22.Click
  402. SQL_佣金比例刪除() : SET_刪除按鈕程式共用1()
  403. End Sub
  404. End Class