Option Strict Off Public Class 系統編碼規則_1 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 ReadOnly ds10 As New DataSet : ReadOnly ds11 As New DataSet Dim EDR As Integer = 0 : Dim ESTR As String Private Sub Set_FTP位置() DataGridView10.DataSource = Nothing : ds9.Clear() : DataGridView10.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing DataGridView10.ColumnHeadersHeight = 25 : DataGridView10.AllowUserToAddRows = False SQL_FTP伺服器清單() da.Fill(ds9) : DataGridView10.DataSource = ds9.Tables(0) : conn.Close() DataGridView10.Columns(0).FillWeight = 234 : DataGridView10.Columns(1).FillWeight = 100 : DataGridView10.Columns(2).FillWeight = 100 : DataGridView10.Columns(3).FillWeight = 40 End Sub Private Sub Set_付款方式() DataGridView1.DataSource = Nothing : ds.Clear() : DataGridView1.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing DataGridView1.ColumnHeadersHeight = 25 : DataGridView1.AllowUserToAddRows = False SQL_付款方式清單() da.Fill(ds) : DataGridView1.DataSource = ds.Tables(0) : conn.Close() DataGridView1.Columns(0).FillWeight = 10 : DataGridView1.Columns(1).FillWeight = 30 End Sub Private Sub Set_職別() DataGridView2.DataSource = Nothing : ds1.Clear() : DataGridView2.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing DataGridView2.ColumnHeadersHeight = 25 : DataGridView2.AllowUserToAddRows = False SQL_職別清單() da.Fill(ds1) : DataGridView2.DataSource = ds1.Tables(0) : conn.Close() DataGridView2.Columns(0).FillWeight = 10 : DataGridView2.Columns(1).FillWeight = 30 End Sub Private Sub Set_負責區域() DataGridView3.DataSource = Nothing : ds2.Clear() : DataGridView3.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing DataGridView3.ColumnHeadersHeight = 25 : DataGridView3.AllowUserToAddRows = False SQL_負責區域清單() da.Fill(ds2) : DataGridView3.DataSource = ds2.Tables(0) : conn.Close() DataGridView3.Columns(0).FillWeight = 10 : DataGridView3.Columns(1).FillWeight = 30 End Sub Private Sub Set_會計科目() DataGridView7.DataSource = Nothing : ds3.Clear() : DataGridView7.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing DataGridView7.ColumnHeadersHeight = 25 : DataGridView7.AllowUserToAddRows = False SQL_會計科目清單() da.Fill(ds3) : DataGridView7.DataSource = ds3.Tables(0) : conn.Close() DataGridView7.Columns(0).FillWeight = 8 : DataGridView7.Columns(1).FillWeight = 8 : DataGridView7.Columns(2).FillWeight = 12 : DataGridView7.Columns(3).FillWeight = 6 DataGridView7.Columns(4).FillWeight = 3 : DataGridView7.Columns(5).FillWeight = 15 : DataGridView7.Columns(6).FillWeight = 3 : DataGridView7.Columns(7).FillWeight = 3 DataGridView7.Columns(8).FillWeight = 3 : DataGridView7.Columns(9).FillWeight = 28 : DataGridView7.Columns(10).FillWeight = 3 End Sub Private Sub Set_年度清單() DataGridView4.DataSource = Nothing : ds6.Clear() : DataGridView4.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing DataGridView4.ColumnHeadersHeight = 25 : DataGridView4.AllowUserToAddRows = False SQL_年份清單() da.Fill(ds6) : DataGridView4.DataSource = ds6.Tables(0) : conn.Close() DataGridView4.Columns(0).FillWeight = 100 End Sub Private Sub Set_公司資料() DataGridView5.DataSource = Nothing : ds10.Clear() : DataGridView5.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing DataGridView5.ColumnHeadersHeight = 25 : DataGridView5.AllowUserToAddRows = False SQL_公司資料清單() da.Fill(ds10) : DataGridView5.DataSource = ds10.Tables(0) : conn.Close() DataGridView5.Columns(0).FillWeight = 50 : DataGridView5.Columns(1).FillWeight = 100 : DataGridView5.Columns(2).FillWeight = 50 : DataGridView5.Columns(3).FillWeight = 50 DataGridView5.Columns(4).FillWeight = 200 End Sub Private Sub Set_傭金比例() DataGridView6.DataSource = Nothing : ds11.Clear() : DataGridView6.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing DataGridView6.ColumnHeadersHeight = 25 : DataGridView6.AllowUserToAddRows = False SQL_佣金比例() da.Fill(ds11) : DataGridView6.DataSource = ds11.Tables(0) : conn.Close() DataGridView6.Columns(0).FillWeight = 100 DataGridView6.Columns(0).DefaultCellStyle.Format = "#,##0.0" DataGridView6.Columns(0).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter : DataGridView6.Columns(0).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter End Sub Private Sub ComboBox1下拉表單資料載入() SQL_會計科目下拉清單一() ComboBox1.Items.Clear() : ComboBox2.Items.Clear() : ComboBox1.Text = "" : ComboBox2.Text = "" While (dr.Read()) : ComboBox1.Items.Add(dr("第一階")) : ComboBox2.Items.Add(dr("編號")) : End While : conn.Close() End Sub Private Sub ComboBox3下拉表單資料載入() SQL_會計科目下拉清單二() ComboBox3.Items.Clear() : ComboBox4.Items.Clear() : ComboBox3.Text = "" : ComboBox4.Text = "" While (dr.Read()) : ComboBox3.Items.Add(dr("第二階")) : ComboBox4.Items.Add(dr("編號")) : End While : conn.Close() End Sub Private Sub 系統編碼規則_1_Load(sender As Object, e As EventArgs) Handles MyBase.Load Me.MdiParent = MAOJI_ERP_SYS : Me.WindowState = 2 : Me.AutoScroll = True TextBox15.Enabled = False : CheckBox5.Checked = True : TextBox16.Enabled = False : ComboBox1下拉表單資料載入() Set_FTP位置() : Set_付款方式() : Set_職別() : Set_負責區域() : Set_會計科目() : Set_年度清單() : Set_公司資料() : Set_傭金比例() End Sub Private Sub DataGridView10_CellClick(ByVal sender As System.Object, ByVal e As DataGridViewCellEventArgs) Handles DataGridView10.CellClick If e.RowIndex = -1 Then : Else TextBox24.Text = DataGridView10(0, e.RowIndex).Value.ToString : TextBox23.Text = DataGridView10(1, e.RowIndex).Value.ToString TextBox22.Text = DataGridView10(2, e.RowIndex).Value.ToString : TextBox21.Text = DataGridView10(3, e.RowIndex).Value.ToString End If End Sub Private Sub DataGridView1_CellClick(ByVal sender As System.Object, ByVal e As DataGridViewCellEventArgs) Handles DataGridView1.CellClick If e.RowIndex = -1 Then : Else TextBox1.Text = DataGridView1(0, e.RowIndex).Value.ToString : TextBox2.Text = DataGridView1(1, e.RowIndex).Value.ToString End If End Sub Private Sub DataGridView2_CellClick(ByVal sender As System.Object, ByVal e As DataGridViewCellEventArgs) Handles DataGridView2.CellClick If e.RowIndex = -1 Then : Else TextBox4.Text = DataGridView2(0, e.RowIndex).Value.ToString : TextBox3.Text = DataGridView2(1, e.RowIndex).Value.ToString End If End Sub Private Sub DataGridView3_CellClick(ByVal sender As System.Object, ByVal e As DataGridViewCellEventArgs) Handles DataGridView3.CellClick If e.RowIndex = -1 Then : Else TextBox6.Text = DataGridView3(0, e.RowIndex).Value.ToString : TextBox5.Text = DataGridView3(1, e.RowIndex).Value.ToString End If End Sub Private Sub DataGridView4_CellClick(ByVal sender As System.Object, ByVal e As DataGridViewCellEventArgs) Handles DataGridView4.CellClick If e.RowIndex = -1 Then : Else TextBox9.Text = DataGridView4(0, e.RowIndex).Value.ToString End If End Sub Private Sub DataGridView5_CellClick(ByVal sender As System.Object, ByVal e As DataGridViewCellEventArgs) Handles DataGridView5.CellClick If e.RowIndex = -1 Then : Else TextBox14.Text = DataGridView5(0, e.RowIndex).Value.ToString : TextBox13.Text = DataGridView5(1, e.RowIndex).Value.ToString TextBox12.Text = DataGridView5(2, e.RowIndex).Value.ToString : TextBox11.Text = DataGridView5(3, e.RowIndex).Value.ToString TextBox10.Text = DataGridView5(4, e.RowIndex).Value.ToString End If End Sub Private Sub DataGridView7_CellClick(ByVal sender As System.Object, ByVal e As DataGridViewCellEventArgs) Handles DataGridView7.CellClick Dim SSXX As String If e.RowIndex = -1 Then : Else ComboBox6.Text = DataGridView7(4, e.RowIndex).Value.ToString : SSXX = DataGridView7(1, e.RowIndex).Value.ToString : ComboBox3.Text = SSXX If CheckBox5.Checked = True Then TextBox8.Text = DataGridView7(2, e.RowIndex).Value.ToString : TextBox16.Text = DataGridView7(3, e.RowIndex).Value.ToString TextBox17.Text = DataGridView7(5, e.RowIndex).Value.ToString : TextBox18.Text = DataGridView7(9, e.RowIndex).Value.ToString CheckBox1.Checked = DataGridView7(6, e.RowIndex).Value : CheckBox2.Checked = DataGridView7(7, e.RowIndex).Value CheckBox3.Checked = DataGridView7(8, e.RowIndex).Value Else : ComboBox6變化() : End If : ComboBox1.Text = DataGridView7(0, e.RowIndex).Value.ToString End If End Sub Private Sub DataGridView7_RowPostPaint(ByVal sender As Object, ByVal e As DataGridViewRowPostPaintEventArgs) Handles DataGridView7.RowPostPaint Dim linePen As New Pen(Color.Blue, 2) If e.RowIndex = DataGridView7.Rows.Count - 1 Then : Exit Sub Else If DataGridView7(1, e.RowIndex).Value.ToString <> DataGridView7(1, e.RowIndex + 1).Value.ToString Then Dim startX As Integer = IIf(DataGridView7.RowHeadersVisible, DataGridView7.RowHeadersWidth, 0) Dim startY As Integer = e.RowBounds.Top + e.RowBounds.Height - 1 Dim endX As Integer = startX + DataGridView7.Columns.GetColumnsWidth(DataGridViewElementStates.Visible) - DataGridView7.HorizontalScrollingOffset e.Graphics.DrawLine(linePen, startX, startY, endX, startY) : Exit Sub End If End If End Sub Private Sub DataGridView6_CellClick(ByVal sender As System.Object, ByVal e As DataGridViewCellEventArgs) Handles DataGridView6.CellClick If e.RowIndex = -1 Then : Else NumericUpDown1.Value = DataGridView6(0, e.RowIndex).Value.ToString End If End Sub Private Sub ComboBox1_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ComboBox1.TextChanged ComboBox2.SelectedIndex = ComboBox1.SelectedIndex : ComboBox3下拉表單資料載入() End Sub Private Sub ComboBox2_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ComboBox2.TextChanged ComboBox1.SelectedIndex = ComboBox2.SelectedIndex : Set_會計科目() : ComboBox3下拉表單資料載入() End Sub Private Sub ComboBox3_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ComboBox3.TextChanged ComboBox4.SelectedIndex = ComboBox3.SelectedIndex End Sub Private Sub ComboBox4_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ComboBox4.TextChanged ComboBox3.SelectedIndex = ComboBox4.SelectedIndex End Sub Private Sub ComboBox5_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ComboBox5.TextChanged ComboBox3下拉表單資料載入() End Sub Private Sub CheckBox4_CheckedChanged(sender As Object, e As EventArgs) Handles CheckBox4.Click CheckBox4.Checked = True : CheckBox5.Checked = False : TextBox16.Enabled = True TextBox8.Text = "" : TextBox17.Text = "" : TextBox18.Text = "" : CheckBox1.Checked = False : CheckBox2.Checked = False : CheckBox3.Checked = False End Sub Private Sub CheckBox5_CheckedChanged(sender As Object, e As EventArgs) Handles CheckBox5.Click CheckBox4.Checked = False : CheckBox5.Checked = True : TextBox16.Enabled = False End Sub Private Sub ComboBox6變化() 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 If CheckBox5.Checked = True Then : Else If ComboBox2.Text = "" Then : Else If ComboBox6.Text = "1" Then : TextBox16.Text = "" ElseIf ComboBox6.Text = "2" Then If ComboBox4.Text = "" Then : Else '----------------------自动生成流水号------------------------------------------------------------------------- SQL_會計科目流水號查詢第一段() If dr.Read() Then : EDR = Double.Parse(Strings.Right(dr("編號").ToString, 2)) : Else : EDR = 0 : End If : conn.Close() : EDR += 1 If EDR < 10 Then : ESTR = ComboBox2.Text & "-" & "0" & EDR & "-00" ElseIf EDR > 9 And EDR < 100 Then : ESTR = ComboBox2.Text & "-" & "" & EDR & "-00" : End If : TextBox16.Text = ESTR End If ElseIf ComboBox6.Text = "3" Then If ComboBox4.Text = "" Then : Else '----------------------自动生成流水号------------------------------------------------------------------------- SQL_會計科目流水號查詢第二段() If dr.Read() Then : EDR = Double.Parse(Strings.Right(dr("編號").ToString, 2)) : Else : EDR = 0 : End If : conn.Close() : EDR += 1 If EDR < 10 Then : ESTR = ComboBox4.Text & "-" & "0" & EDR ElseIf EDR > 9 And EDR < 100 Then : ESTR = ComboBox4.Text & "-" & "" & EDR : End If : TextBox16.Text = ESTR End If End If End If End If End Sub Private Sub ComboBox6_TextChanged(sender As Object, e As EventArgs) Handles ComboBox6.TextChanged ComboBox6變化() End Sub Private Sub SET_新增按鈕程式共用2() CmdSet_For_dr() : Dim unused = MsgBox("新增完成") : conn.Close() : dr.Close() End Sub Private Sub SET_修改按鈕程式共用1() CmdSet_For_dr() : Dim unused = MsgBox("修改完成") : conn.Close() End Sub Private Sub SET_刪除按鈕程式共用1() Dim aa As MsgBoxResult = MsgBox("確定要刪除該筆資料?", MsgBoxStyle.OkCancel) If aa = MsgBoxResult.Ok Then : ConnOpen() : CmdSet_For_dr() : MsgBox("刪除完成") : End If : conn.Close() : 式共用1() End Sub Private Sub 式共用1() Set_FTP位置() : Set_付款方式() : Set_職別() : Set_負責區域() : Set_會計科目() : Set_年度清單() : Set_公司資料() : Set_傭金比例() : PA = "" End Sub Private Sub 式共用2() dr.Close() : ConnOpen() End Sub Private Sub 式共用3() ConnOpen() End Sub '------------------------------------------------------------------------------------------------------------------------------------ Private Sub Button29_Click(sender As Object, e As EventArgs) Handles Button29.Click If TextBox21.Text = "" Or TextBox24.Text = "" Then : MsgBox("資料有缺或有誤,請重新檢查") Else SQL_FTP資料庫管理查詢() If dr.Read() Then : MsgBox("資料重複,請從新輸入或檢查") : conn.Close() : dr.Close() Else : 式共用2() : SQL_FTP資料庫管理新增() : SET_新增按鈕程式共用2() : End If End If : 式共用1() End Sub Private Sub Button30_Click(sender As Object, e As EventArgs) Handles Button30.Click If TextBox21.Text = "" Or TextBox24.Text = "" Then : MsgBox("資料有缺或有誤,請重新檢查") Else PA = InputBox("請輸入要修改的FTP地址") : PA1 = InputBox("請輸入要修改的FTP帳號") : PA2 = InputBox("請輸入要修改的FTP密碼") If PA = "" Then : MsgBox("沒有輸入修改內容") Else : 式共用3() : SQL_FTP資料庫管理修改() : SET_修改按鈕程式共用1() : End If End If : 式共用1() End Sub Private Sub Button28_Click(sender As Object, e As EventArgs) Handles Button28.Click SQL_FTP資料庫管理刪除() : SET_刪除按鈕程式共用1() End Sub '------------------------------------------------------------------------------------------------------------------------------------ Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click PA = InputBox("請輸入要新增的付款方式") : SQL_付款方式查詢() If dr.Read() Then : MsgBox("資料重複,請從新輸入或檢查") : conn.Close() : dr.Close() Else '----------------------自动生成流水号------------------------------------------------------------------------- SQL_付款方式流水號查詢() If dr.Read() Then : EDR = Double.Parse(Strings.Right(dr("編號").ToString, 3)) : Else : EDR = 0 : End If : conn.Close() : EDR += 1 If EDR < 10 Then : ESTR = "PM" & "00" & EDR ElseIf EDR > 9 And EDR < 100 Then : ESTR = "PM" & "0" & EDR ElseIf EDR > 99 Then : ESTR = "PM" & EDR : End If : PA1 = ESTR 式共用2() : SQL_付款方式新增() : SET_新增按鈕程式共用2() End If : 式共用1() End Sub Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click If TextBox1.Text = "" Or TextBox2.Text = "" Then : MsgBox("資料有缺或有誤,請重新檢查") Else PA = InputBox("請輸入要修改的付款方式") If PA = "" Then : MsgBox("沒有輸入修改內容") Else : 式共用3() : SQL_付款方式修改() : SET_修改按鈕程式共用1() : End If End If : 式共用1() End Sub Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click SQL_付款方式刪除() : SET_刪除按鈕程式共用1() End Sub '------------------------------------------------------------------------------------------------------------------------------------ Private Sub Button5_Click(sender As Object, e As EventArgs) Handles Button5.Click PA = InputBox("請輸入要新增的職別") : SQL_職別查詢() If dr.Read() Then : MsgBox("資料重複,請從新輸入或檢查") : conn.Close() : dr.Close() Else '----------------------自动生成流水号------------------------------------------------------------------------- SQL_職別流水號最後一筆() If dr.Read() Then : EDR = Double.Parse(Strings.Right(dr("編號").ToString, 3)) : Else : EDR = 0 : End If : conn.Close() : EDR += 1 If EDR < 10 Then : ESTR = "PS" & "00" & EDR ElseIf EDR > 9 And EDR < 100 Then : ESTR = "PS" & "0" & EDR ElseIf EDR > 99 Then : ESTR = "PS" & EDR : End If : PA1 = ESTR 式共用2() : SQL_職別新增() : SET_新增按鈕程式共用2() End If : 式共用1() End Sub Private Sub Button6_Click(sender As Object, e As EventArgs) Handles Button6.Click If TextBox4.Text = "" Or TextBox3.Text = "" Then : MsgBox("資料有缺或有誤,請重新檢查") Else PA = InputBox("請輸入要修改的職別") If PA = "" Then : MsgBox("沒有輸入修改內容") Else : 式共用3() : SQL_職別修改() : SET_修改按鈕程式共用1() : End If End If : 式共用1() End Sub Private Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click SQL_職別刪除() : SET_刪除按鈕程式共用1() End Sub '------------------------------------------------------------------------------------------------------------------------------------ Private Sub Button8_Click(sender As Object, e As EventArgs) Handles Button8.Click PA = InputBox("請輸入要新增的負責區域") : SQL_負責區域查詢() If dr.Read() Then : MsgBox("資料重複,請從新輸入或檢查") : conn.Close() : dr.Close() Else '----------------------自动生成流水号------------------------------------------------------------------------- SQL_負責區域流水號最後一筆() If dr.Read() Then : EDR = Double.Parse(Strings.Right(dr("編號").ToString, 3)) : Else : EDR = 0 : End If : conn.Close() : EDR += 1 If EDR < 10 Then : ESTR = "RA" & "00" & EDR ElseIf EDR > 9 And EDR < 100 Then : ESTR = "RA" & "0" & EDR ElseIf EDR > 99 Then : ESTR = "RA" & EDR : End If : PA1 = ESTR 式共用2() : SQL_負責區域新增() : SET_新增按鈕程式共用2() End If : 式共用1() End Sub Private Sub Button9_Click(sender As Object, e As EventArgs) Handles Button9.Click If TextBox6.Text = "" Or TextBox5.Text = "" Then : MsgBox("資料有缺或有誤,請重新檢查") Else PA = InputBox("請輸入要修改的職別") If PA = "" Then : MsgBox("沒有輸入修改內容") Else : 式共用3() : SQL_負責區域修改() : SET_修改按鈕程式共用1() End If End If : 式共用1() End Sub Private Sub Button7_Click(sender As Object, e As EventArgs) Handles Button7.Click SQL_負責區域刪除() : SET_刪除按鈕程式共用1() End Sub '------------------------------------------------------------------------------------------------------------------------------------ Private Sub Button20_Click(sender As Object, e As EventArgs) Handles Button20.Click If TextBox8.Text = "" Or ComboBox6.Text = "" Then : MsgBox("資料有缺或有誤,請重新檢查") Else SQL_會計科目查詢() If dr.Read() Then : MsgBox("資料重複,請從新輸入或檢查") : conn.Close() : dr.Close() Else 式共用2() If ComboBox6.Text = "1" Then : SQL_會計科目新增一() ElseIf ComboBox6.Text = "2" Then : SQL_會計科目新增二() Else : SQL_會計科目新增三() End If : SET_新增按鈕程式共用2() End If End If : 式共用1() End Sub Private Sub Button19_Click(sender As Object, e As EventArgs) Handles Button19.Click If TextBox8.Text = "" Then : MsgBox("資料有缺或有誤,請重新檢查") Else PA1 = TextBox8.Text : PA2 = ComboBox6.Text : PA3 = TextBox17.Text : 布林1 = CheckBox1.Checked : 布林2 = CheckBox2.Checked : 布林3 = CheckBox3.Checked PA4 = TextBox18.Text : PA5 = ComboBox1.Text : PA6 = ComboBox3.Text : 布林4 = CheckBox6.Checked : PA7 = TextBox16.Text SQL_會計科目修改() : MsgBox("修改完成") End If : 式共用1() End Sub Private Sub Button16_Click(sender As Object, e As EventArgs) Handles Button16.Click For i As Integer = 0 To DataGridView7.Rows.Count - 1 資料數 = DataGridView7.Rows.Count : MyModule1.進度條() PA1 = DataGridView7.Rows(i).Cells("會計科目").Value : PA2 = DataGridView7.Rows(i).Cells("層級").Value : PA3 = DataGridView7.Rows(i).Cells("英文名稱").Value 布林1 = DataGridView7.Rows(i).Cells("統制科目").Value : 布林2 = DataGridView7.Rows(i).Cells("抵銷科目").Value : 布林3 = DataGridView7.Rows(i).Cells("停用").Value PA4 = DataGridView7.Rows(i).Cells("附註").Value : PA5 = DataGridView7.Rows(i).Cells("第一階").Value : PA6 = DataGridView7.Rows(i).Cells("第二階").Value 布林4 = DataGridView7.Rows(i).Cells("顯示").Value : PA7 = DataGridView7.Rows(i).Cells("編號").Value SQL_會計科目修改() : conn.Close() Next : MAOJI_ERP_SYS.ToolStripProgressBar1.Value = 0 : 最終數 = 0 : MsgBox("修改完成") End Sub Private Sub Button21_Click(sender As Object, e As EventArgs) Handles Button21.Click SQL_會計科目刪除() : SET_刪除按鈕程式共用1() End Sub '------------------------------------------------------------------------------------------------------------------------------------ Private Sub Button11_Click(sender As Object, e As EventArgs) Handles Button11.Click If TextBox9.Text = "" Then : MsgBox("資料有缺或有誤,請重新檢查") Else PA = TextBox9.Text : SQL_年份清單查詢() If dr.Read() Then : MsgBox("資料重複,請從新輸入或檢查") : conn.Close() : dr.Close() Else : 式共用2() : SQL_年份清單新增() : SET_新增按鈕程式共用2() : End If End If : 式共用1() End Sub Private Sub Button10_Click(sender As Object, e As EventArgs) Handles Button10.Click If TextBox9.Text = "" Then : MsgBox("資料有缺或有誤,請重新檢查") Else PA = InputBox("請輸入要修改的內容") If PA = "" Then : MsgBox("沒有輸入修改內容") Else : 式共用3() : SQL_年份清單修改() : SET_修改按鈕程式共用1() : End If End If : 式共用1() End Sub Private Sub Button12_Click(sender As Object, e As EventArgs) Handles Button12.Click SQL_年份清單刪除() : SET_刪除按鈕程式共用1() End Sub '------------------------------------------------------------------------------------------------------------------------------------ Private Sub Button14_Click(sender As Object, e As EventArgs) Handles Button14.Click If TextBox13.Text = "" Then : MsgBox("資料有缺或有誤,請重新檢查") Else PA = TextBox13.Text : SQL_公司基本資料宣告() If dr.Read() Then : MsgBox("資料重複,請從新輸入或檢查") : conn.Close() : dr.Close() Else '----------------------自动生成流水号------------------------------------------------------------------------- SQL_公司基本資料流水號最後一筆() If dr.Read() Then : EDR = Double.Parse(Strings.Right(dr("公司編號").ToString, 3)) : Else : EDR = 0 : End If : conn.Close() : EDR += 1 If EDR < 10 Then : ESTR = "CO" & "00" & EDR ElseIf EDR > 9 And EDR < 100 Then : ESTR = "CO" & "0" & EDR ElseIf EDR > 99 Then : ESTR = "CO" & EDR : End If : TextBox14.Text = ESTR 式共用2() : SQL_公司基本資料新增() : SET_新增按鈕程式共用2() End If End If : 式共用1() End Sub Private Sub Button15_Click(sender As Object, e As EventArgs) Handles Button15.Click If TextBox9.Text = "" Then : MsgBox("資料有缺或有誤,請重新檢查") Else PA = InputBox("請輸入要修改的內容") If PA = "" Then : MsgBox("沒有輸入修改內容") Else 式共用3() : SQL_公司基本資料修改() : SET_修改按鈕程式共用1() End If End If : 式共用1() End Sub Private Sub Button13_Click(sender As Object, e As EventArgs) Handles Button13.Click SQL_公司基本資料刪除() : SET_刪除按鈕程式共用1() End Sub '------------------------------------------------------------------------------------------------------------------------------------ Private Sub Button18_Click(sender As Object, e As EventArgs) Handles Button18.Click SQL_佣金比例查詢() If dr.Read() Then : MsgBox("資料重複,請從新輸入或檢查") : conn.Close() : dr.Close() Else : 式共用2() : SQL_佣金比例新增() : SET_新增按鈕程式共用2() : End If : 式共用1() End Sub Private Sub Button22_Click(sender As Object, e As EventArgs) Handles Button22.Click SQL_佣金比例刪除() : SET_刪除按鈕程式共用1() End Sub End Class