Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Imports System.Data.OleDb
- Public Class Bags
- Private Sub wait(ByVal seconds As Integer)
- For i As Integer = 0 To seconds * 100
- System.Threading.Thread.Sleep(10)
- 'Application.DoEvents()
- Application.DoEvents()
- Next
- End Sub
- ' Dim dt As DateTime = Date.Today.ToString("dd.MM.yyyy")
- Dim dt As DateTime = Date.Today
- Dim dtime As DateTime = TimeOfDay
- Public con As New OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & CStr(Application.StartupPath) & "\Data\Lenzo.accdb")
- Public Sub Bag1Page_GridView()
- Dim daz As New OleDbDataAdapter
- Dim dtz As New DataTable
- Dim dsz As New DataSet
- dsz.Tables.Add(dtz)
- daz = New OleDbDataAdapter("SELECT Bag1.IDP AS ID, Bag1.ProductID, Bag1.ProductName, Bag1.CilentName, Bag1.Status FROM Bag1", con)
- daz.Fill(dtz)
- DataGridView1.DataSource = dtz.DefaultView
- End Sub
- Public Sub Bag2Page_GridView()
- Dim daz As New OleDbDataAdapter
- Dim dtz As New DataTable
- Dim dsz As New DataSet
- dsz.Tables.Add(dtz)
- daz = New OleDbDataAdapter("SELECT Bag2.IDP AS ID, Bag2.ProductID, Bag2.ProductName, Bag2.CilentName, Bag2.Status FROM Bag2", con)
- daz.Fill(dtz)
- DataGridView1.DataSource = dtz.DefaultView
- End Sub
- Public Sub Bag3Page_GridView()
- Dim daz As New OleDbDataAdapter
- Dim dtz As New DataTable
- Dim dsz As New DataSet
- dsz.Tables.Add(dtz)
- daz = New OleDbDataAdapter("SELECT Bag3.IDP AS ID, Bag3.ProductID, Bag3.ProductName, Bag3.CilentName, Bag3.Status FROM Bag3", con)
- daz.Fill(dtz)
- DataGridView1.DataSource = dtz.DefaultView
- End Sub
- Public Sub Bag4Page_GridView()
- Dim daz As New OleDbDataAdapter
- Dim dtz As New DataTable
- Dim dsz As New DataSet
- dsz.Tables.Add(dtz)
- daz = New OleDbDataAdapter("SELECT Bag4.IDP AS ID, Bag4.ProductID, Bag4.ProductName, Bag4.CilentName, Bag4.Status FROM Bag4", con)
- daz.Fill(dtz)
- DataGridView1.DataSource = dtz.DefaultView
- End Sub
- Public Sub Bag5Page_GridView()
- Dim daz As New OleDbDataAdapter
- Dim dtz As New DataTable
- Dim dsz As New DataSet
- dsz.Tables.Add(dtz)
- daz = New OleDbDataAdapter("SELECT Bag5.IDP AS ID, Bag5.ProductID, Bag5.ProductName, Bag5.CilentName, Bag5.Status FROM Bag5", con)
- daz.Fill(dtz)
- DataGridView1.DataSource = dtz.DefaultView
- End Sub
- Public Sub Bag6Page_GridView()
- Dim daz As New OleDbDataAdapter
- Dim dtz As New DataTable
- Dim dsz As New DataSet
- dsz.Tables.Add(dtz)
- daz = New OleDbDataAdapter("SELECT Bag6.IDP AS ID, Bag6.ProductID, Bag6.ProductName, Bag6.CilentName, Bag6.Status FROM Bag6", con)
- daz.Fill(dtz)
- DataGridView1.DataSource = dtz.DefaultView
- End Sub
- Public Sub Bag7Page_GridView()
- Dim daz As New OleDbDataAdapter
- Dim dtz As New DataTable
- Dim dsz As New DataSet
- dsz.Tables.Add(dtz)
- daz = New OleDbDataAdapter("SELECT Bag7.IDP AS ID, Bag7.ProductID, Bag7.ProductName, Bag7.CilentName, Bag7.Status FROM Bag7", con)
- daz.Fill(dtz)
- DataGridView1.DataSource = dtz.DefaultView
- End Sub
- Public Sub Bag8Page_GridView()
- Dim daz As New OleDbDataAdapter
- Dim dtz As New DataTable
- Dim dsz As New DataSet
- dsz.Tables.Add(dtz)
- daz = New OleDbDataAdapter("SELECT Bag8.IDP AS ID, Bag8.ProductID, Bag8.ProductName, Bag8.CilentName, Bag8.Status FROM Bag8", con)
- daz.Fill(dtz)
- DataGridView1.DataSource = dtz.DefaultView
- End Sub
- Public Sub Bag9Page_GridView()
- Dim daz As New OleDbDataAdapter
- Dim dtz As New DataTable
- Dim dsz As New DataSet
- dsz.Tables.Add(dtz)
- daz = New OleDbDataAdapter("SELECT Bag9.IDP AS ID, Bag9.ProductID, Bag9.ProductName, Bag9.CilentName, Bag9.Status FROM Bag9", con)
- daz.Fill(dtz)
- DataGridView1.DataSource = dtz.DefaultView
- End Sub
- Public Sub Bag10Page_GridView()
- Dim daz As New OleDbDataAdapter
- Dim dtz As New DataTable
- Dim dsz As New DataSet
- dsz.Tables.Add(dtz)
- daz = New OleDbDataAdapter("SELECT Bag10.IDP AS ID, Bag10.ProductID, Bag10.ProductName, Bag10.CilentName, Bag10.Status FROM Bag10", con)
- daz.Fill(dtz)
- DataGridView1.DataSource = dtz.DefaultView
- End Sub
- Public Sub Bag11Page_GridView()
- Dim daz As New OleDbDataAdapter
- Dim dtz As New DataTable
- Dim dsz As New DataSet
- dsz.Tables.Add(dtz)
- daz = New OleDbDataAdapter("SELECT Bag11.IDP AS ID, Bag11.ProductID, Bag11.ProductName, Bag11.CilentName, Bag11.Status FROM Bag11", con)
- daz.Fill(dtz)
- DataGridView1.DataSource = dtz.DefaultView
- End Sub
- Public Sub Bag12Page_GridView()
- Dim daz As New OleDbDataAdapter
- Dim dtz As New DataTable
- Dim dsz As New DataSet
- dsz.Tables.Add(dtz)
- daz = New OleDbDataAdapter("SELECT Bag12.IDP AS ID, Bag12.ProductID, Bag12.ProductName, Bag12.CilentName, Bag12.Status FROM Bag12", con)
- daz.Fill(dtz)
- DataGridView1.DataSource = dtz.DefaultView
- End Sub
- Public Sub Bag13Page_GridView()
- Dim daz As New OleDbDataAdapter
- Dim dtz As New DataTable
- Dim dsz As New DataSet
- dsz.Tables.Add(dtz)
- daz = New OleDbDataAdapter("SELECT Bag13.IDP AS ID, Bag13.ProductID, Bag13.ProductName, Bag13.CilentName, Bag13.Status FROM Bag13", con)
- daz.Fill(dtz)
- DataGridView1.DataSource = dtz.DefaultView
- End Sub
- Public Sub Bag14Page_GridView()
- Dim daz As New OleDbDataAdapter
- Dim dtz As New DataTable
- Dim dsz As New DataSet
- dsz.Tables.Add(dtz)
- daz = New OleDbDataAdapter("SELECT Bag14.IDP AS ID, Bag14.ProductID, Bag14.ProductName, Bag14.CilentName, Bag14.Status FROM Bag14", con)
- daz.Fill(dtz)
- DataGridView1.DataSource = dtz.DefaultView
- End Sub
- Public Sub Bags_Combobox()
- con.Open()
- Dim da As New OleDbDataAdapter
- Dim dt As New DataTable
- da = New OleDbDataAdapter("Select * from Bags ", con)
- da.Fill(dt)
- BagsComboBox.DataSource = dt
- BagsComboBox.DisplayMember = "Bags"
- BagsComboBox.ValueMember = "BagName"
- con.Close()
- End Sub
- Private Sub Bags_Enter(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Enter
- Bags_Combobox()
- End Sub
- Private Sub Bags_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
- Bags_Combobox()
- End Sub
- Public Sub Bag1_ID()
- Dim autoID As Single
- Dim mycmd As New OleDbCommand
- con.Open()
- mycmd = New OleDbCommand("select count (*) as Valuez from Bag1", con)
- Dim objdatareader As OleDbDataReader
- objdatareader = mycmd.ExecuteReader
- While objdatareader.Read
- autoID = Val(objdatareader.Item("Valuez").ToString) + 1
- End While
- Bag1IDTextBox.Text = autoID
- con.Close()
- End Sub
- Public Sub Bag2_ID()
- Dim autoID As Single
- Dim mycmd As New OleDbCommand
- con.Open()
- mycmd = New OleDbCommand("select count (*) as Valuez from Bag2", con)
- Dim objdatareader As OleDbDataReader
- objdatareader = mycmd.ExecuteReader
- While objdatareader.Read
- autoID = Val(objdatareader.Item("Valuez").ToString) + 1
- End While
- Bag2IDTextBox.Text = autoID
- con.Close()
- End Sub
- Public Sub Bag3_ID()
- Dim autoID As Single
- Dim mycmd As New OleDbCommand
- con.Open()
- mycmd = New OleDbCommand("select count (*) as Valuez from Bag3", con)
- Dim objdatareader As OleDbDataReader
- objdatareader = mycmd.ExecuteReader
- While objdatareader.Read
- autoID = Val(objdatareader.Item("Valuez").ToString) + 1
- End While
- Bag3IDTextBox.Text = autoID
- con.Close()
- End Sub
- Public Sub Bag4_ID()
- Dim autoID As Single
- Dim mycmd As New OleDbCommand
- con.Open()
- mycmd = New OleDbCommand("select count (*) as Valuez from Bag4", con)
- Dim objdatareader As OleDbDataReader
- objdatareader = mycmd.ExecuteReader
- While objdatareader.Read
- autoID = Val(objdatareader.Item("Valuez").ToString) + 1
- End While
- Bag4IDTextBox.Text = autoID
- con.Close()
- End Sub
- Public Sub Bag5_ID()
- Dim autoID As Single
- Dim mycmd As New OleDbCommand
- con.Open()
- mycmd = New OleDbCommand("select count (*) as Valuez from Bag5", con)
- Dim objdatareader As OleDbDataReader
- objdatareader = mycmd.ExecuteReader
- While objdatareader.Read
- autoID = Val(objdatareader.Item("Valuez").ToString) + 1
- End While
- Bag5IDTextBox.Text = autoID
- con.Close()
- End Sub
- Public Sub Bag6_ID()
- Dim autoID As Single
- Dim mycmd As New OleDbCommand
- con.Open()
- mycmd = New OleDbCommand("select count (*) as Valuez from Bag6", con)
- Dim objdatareader As OleDbDataReader
- objdatareader = mycmd.ExecuteReader
- While objdatareader.Read
- autoID = Val(objdatareader.Item("Valuez").ToString) + 1
- End While
- Bag6IDTextBox.Text = autoID
- con.Close()
- End Sub
- Public Sub Bag7_ID()
- Dim autoID As Single
- Dim mycmd As New OleDbCommand
- con.Open()
- mycmd = New OleDbCommand("select count (*) as Valuez from Bag7", con)
- Dim objdatareader As OleDbDataReader
- objdatareader = mycmd.ExecuteReader
- While objdatareader.Read
- autoID = Val(objdatareader.Item("Valuez").ToString) + 1
- End While
- Bag7IDTextBox.Text = autoID
- con.Close()
- End Sub
- Public Sub Bag8_ID()
- Dim autoID As Single
- Dim mycmd As New OleDbCommand
- con.Open()
- mycmd = New OleDbCommand("select count (*) as Valuez from Bag8", con)
- Dim objdatareader As OleDbDataReader
- objdatareader = mycmd.ExecuteReader
- While objdatareader.Read
- autoID = Val(objdatareader.Item("Valuez").ToString) + 1
- End While
- Bag8IDTextBox.Text = autoID
- con.Close()
- End Sub
- Public Sub Bag9_ID()
- Dim autoID As Single
- Dim mycmd As New OleDbCommand
- con.Open()
- mycmd = New OleDbCommand("select count (*) as Valuez from Bag9", con)
- Dim objdatareader As OleDbDataReader
- objdatareader = mycmd.ExecuteReader
- While objdatareader.Read
- autoID = Val(objdatareader.Item("Valuez").ToString) + 1
- End While
- Bag9IDTextBox.Text = autoID
- con.Close()
- End Sub
- Public Sub Bag10_ID()
- Dim autoID As Single
- Dim mycmd As New OleDbCommand
- con.Open()
- mycmd = New OleDbCommand("select count (*) as Valuez from Bag10", con)
- Dim objdatareader As OleDbDataReader
- objdatareader = mycmd.ExecuteReader
- While objdatareader.Read
- autoID = Val(objdatareader.Item("Valuez").ToString) + 1
- End While
- Bag10IDTextBox.Text = autoID
- con.Close()
- End Sub
- Public Sub Bag11_ID()
- Dim autoID As Single
- Dim mycmd As New OleDbCommand
- con.Open()
- mycmd = New OleDbCommand("select count (*) as Valuez from Bag11", con)
- Dim objdatareader As OleDbDataReader
- objdatareader = mycmd.ExecuteReader
- While objdatareader.Read
- autoID = Val(objdatareader.Item("Valuez").ToString) + 1
- End While
- Bag11IDTextBox.Text = autoID
- con.Close()
- End Sub
- Public Sub Bag12_ID()
- Dim autoID As Single
- Dim mycmd As New OleDbCommand
- con.Open()
- mycmd = New OleDbCommand("select count (*) as Valuez from Bag12", con)
- Dim objdatareader As OleDbDataReader
- objdatareader = mycmd.ExecuteReader
- While objdatareader.Read
- autoID = Val(objdatareader.Item("Valuez").ToString) + 1
- End While
- Bag12IDTextBox.Text = autoID
- con.Close()
- End Sub
- Public Sub Bag13_ID()
- Dim autoID As Single
- Dim mycmd As New OleDbCommand
- con.Open()
- mycmd = New OleDbCommand("select count (*) as Valuez from Bag13", con)
- Dim objdatareader As OleDbDataReader
- objdatareader = mycmd.ExecuteReader
- While objdatareader.Read
- autoID = Val(objdatareader.Item("Valuez").ToString) + 1
- End While
- Bag13IDTextBox.Text = autoID
- con.Close()
- End Sub
- Public Sub Bag14_ID()
- Dim autoID As Single
- Dim mycmd As New OleDbCommand
- con.Open()
- mycmd = New OleDbCommand("select count (*) as Valuez from Bag14", con)
- Dim objdatareader As OleDbDataReader
- objdatareader = mycmd.ExecuteReader
- While objdatareader.Read
- autoID = Val(objdatareader.Item("Valuez").ToString) + 1
- End While
- Bag14IDTextBox.Text = autoID
- con.Close()
- End Sub
- Public Sub Bag1_Insert()
- Dim dt As New DataTable
- Dim cmd As New OleDbCommand
- dt.Clear()
- cmd = New OleDbCommand("INSERT INTO Bag1 (IDP,ProductID,ProductName,CilentName) values ('" & Bag1IDTextBox.Text & "','" & ProductIDTextBox.Text & "','" & ProductNameTextBox.Text & "','" & CilentNameTextBox.Text & "') ", con)
- con.Open()
- cmd.ExecuteNonQuery()
- con.Close()
- End Sub
- Public Sub Bag2_Insert()
- Dim dt As New DataTable
- Dim cmd As New OleDbCommand
- dt.Clear()
- cmd = New OleDbCommand("INSERT INTO Bag2 (IDP,ProductID,ProductName,CilentName) values ('" & Bag2IDTextBox.Text & "','" & ProductIDTextBox.Text & "','" & ProductNameTextBox.Text & "','" & CilentNameTextBox.Text & "') ", con)
- con.Open()
- cmd.ExecuteNonQuery()
- con.Close()
- End Sub
- Public Sub Bag3_Insert()
- Dim dt As New DataTable
- Dim cmd As New OleDbCommand
- dt.Clear()
- cmd = New OleDbCommand("INSERT INTO Bag3 (IDP,ProductID,ProductName,CilentName) values ('" & Bag3IDTextBox.Text & "','" & ProductIDTextBox.Text & "','" & ProductNameTextBox.Text & "','" & CilentNameTextBox.Text & "') ", con)
- con.Open()
- cmd.ExecuteNonQuery()
- con.Close()
- End Sub
- Public Sub Bag4_Insert()
- Dim dt As New DataTable
- Dim cmd As New OleDbCommand
- dt.Clear()
- cmd = New OleDbCommand("INSERT INTO Bag4 (IDP,ProductID,ProductName,CilentName) values ('" & Bag4IDTextBox.Text & "','" & ProductIDTextBox.Text & "','" & ProductNameTextBox.Text & "','" & CilentNameTextBox.Text & "') ", con)
- con.Open()
- cmd.ExecuteNonQuery()
- con.Close()
- End Sub
- Public Sub Bag5_Insert()
- Dim dt As New DataTable
- Dim cmd As New OleDbCommand
- dt.Clear()
- cmd = New OleDbCommand("INSERT INTO Bag5 (IDP,ProductID,ProductName,CilentName) values ('" & Bag5IDTextBox.Text & "','" & ProductIDTextBox.Text & "','" & ProductNameTextBox.Text & "','" & CilentNameTextBox.Text & "') ", con)
- con.Open()
- cmd.ExecuteNonQuery()
- con.Close()
- End Sub
- Public Sub Bag6_Insert()
- Dim dt As New DataTable
- Dim cmd As New OleDbCommand
- dt.Clear()
- cmd = New OleDbCommand("INSERT INTO Bag6 (IDP,ProductID,ProductName,CilentName) values ('" & Bag6IDTextBox.Text & "','" & ProductIDTextBox.Text & "','" & ProductNameTextBox.Text & "','" & CilentNameTextBox.Text & "') ", con)
- con.Open()
- cmd.ExecuteNonQuery()
- con.Close()
- End Sub
- Public Sub Bag7_Insert()
- Dim dt As New DataTable
- Dim cmd As New OleDbCommand
- dt.Clear()
- cmd = New OleDbCommand("INSERT INTO Bag7 (IDP,ProductID,ProductName,CilentName) values ('" & Bag7IDTextBox.Text & "','" & ProductIDTextBox.Text & "','" & ProductNameTextBox.Text & "','" & CilentNameTextBox.Text & "') ", con)
- con.Open()
- cmd.ExecuteNonQuery()
- con.Close()
- End Sub
- Public Sub Bag8_Insert()
- Dim dt As New DataTable
- Dim cmd As New OleDbCommand
- dt.Clear()
- cmd = New OleDbCommand("INSERT INTO Bag8 (IDP,ProductID,ProductName,CilentName) values ('" & Bag8IDTextBox.Text & "','" & ProductIDTextBox.Text & "','" & ProductNameTextBox.Text & "','" & CilentNameTextBox.Text & "') ", con)
- con.Open()
- cmd.ExecuteNonQuery()
- con.Close()
- End Sub
- Public Sub Bag9_Insert()
- Dim dt As New DataTable
- Dim cmd As New OleDbCommand
- dt.Clear()
- cmd = New OleDbCommand("INSERT INTO Bag9 (IDP,ProductID,ProductName,CilentName) values ('" & Bag9IDTextBox.Text & "','" & ProductIDTextBox.Text & "','" & ProductNameTextBox.Text & "','" & CilentNameTextBox.Text & "') ", con)
- con.Open()
- cmd.ExecuteNonQuery()
- con.Close()
- End Sub
- Public Sub Bag10_Insert()
- Dim dt As New DataTable
- Dim cmd As New OleDbCommand
- dt.Clear()
- cmd = New OleDbCommand("INSERT INTO Bag10 (IDP,ProductID,ProductName,CilentName) values ('" & Bag10IDTextBox.Text & "','" & ProductIDTextBox.Text & "','" & ProductNameTextBox.Text & "','" & CilentNameTextBox.Text & "') ", con)
- con.Open()
- cmd.ExecuteNonQuery()
- con.Close()
- End Sub
- Public Sub Bag11_Insert()
- Dim dt As New DataTable
- Dim cmd As New OleDbCommand
- dt.Clear()
- cmd = New OleDbCommand("INSERT INTO Bag11 (IDP,ProductID,ProductName,CilentName) values ('" & Bag11IDTextBox.Text & "','" & ProductIDTextBox.Text & "','" & ProductNameTextBox.Text & "','" & CilentNameTextBox.Text & "') ", con)
- con.Open()
- cmd.ExecuteNonQuery()
- con.Close()
- End Sub
- Public Sub Bag12_Insert()
- Dim dt As New DataTable
- Dim cmd As New OleDbCommand
- dt.Clear()
- cmd = New OleDbCommand("INSERT INTO Bag12 (IDP,ProductID,ProductName,CilentName) values ('" & Bag12IDTextBox.Text & "','" & ProductIDTextBox.Text & "','" & ProductNameTextBox.Text & "','" & CilentNameTextBox.Text & "') ", con)
- con.Open()
- cmd.ExecuteNonQuery()
- con.Close()
- End Sub
- Public Sub Bag13_Insert()
- Dim dt As New DataTable
- Dim cmd As New OleDbCommand
- dt.Clear()
- cmd = New OleDbCommand("INSERT INTO Bag13 (IDP,ProductID,ProductName,CilentName) values ('" & Bag13IDTextBox.Text & "','" & ProductIDTextBox.Text & "','" & ProductNameTextBox.Text & "','" & CilentNameTextBox.Text & "') ", con)
- con.Open()
- cmd.ExecuteNonQuery()
- con.Close()
- End Sub
- Public Sub Bag14_Insert()
- Dim dt As New DataTable
- Dim cmd As New OleDbCommand
- dt.Clear()
- cmd = New OleDbCommand("INSERT INTO Bag14 (IDP,ProductID,ProductName,CilentName) values ('" & Bag14IDTextBox.Text & "','" & ProductIDTextBox.Text & "','" & ProductNameTextBox.Text & "','" & CilentNameTextBox.Text & "') ", con)
- con.Open()
- cmd.ExecuteNonQuery()
- con.Close()
- End Sub
- Public Sub New_Product()
- If BagsComboBox.Text = "Bag1" Then
- Bag1Page_GridView()
- End If
- If BagsComboBox.Text = "Bag2" Then
- Bag2Page_GridView()
- End If
- If BagsComboBox.Text = "Bag3" Then
- Bag3Page_GridView()
- End If
- If BagsComboBox.Text = "Bag4" Then
- Bag4Page_GridView()
- End If
- If BagsComboBox.Text = "Bag5" Then
- Bag5Page_GridView()
- End If
- If BagsComboBox.Text = "Bag6" Then
- Bag6Page_GridView()
- End If
- If BagsComboBox.Text = "Bag7" Then
- Bag7Page_GridView()
- End If
- If BagsComboBox.Text = "Bag8" Then
- Bag8Page_GridView()
- End If
- If BagsComboBox.Text = "Bag9" Then
- Bag9Page_GridView()
- End If
- If BagsComboBox.Text = "Bag10" Then
- Bag10Page_GridView()
- End If
- If BagsComboBox.Text = "Bag11" Then
- Bag11Page_GridView()
- End If
- If BagsComboBox.Text = "Bag12" Then
- Bag12Page_GridView()
- End If
- If BagsComboBox.Text = "Bag13" Then
- Bag13Page_GridView()
- End If
- If BagsComboBox.Text = "Bag14" Then
- Bag14Page_GridView()
- End If
- Bag1_ID()
- Bag2_ID()
- Bag3_ID()
- Bag4_ID()
- Bag5_ID()
- Bag6_ID()
- Bag7_ID()
- Bag8_ID()
- Bag9_ID()
- Bag10_ID()
- Bag11_ID()
- Bag12_ID()
- Bag13_ID()
- Bag14_ID()
- CilentNameTextBox.Text = "None"
- ProductIDTextBox.Text = ""
- ProductNameTextBox.Text = ""
- GridBag1IDTextBox.Text = ""
- GridBag2IDTextBox.Text = ""
- GridBag3IDTextBox.Text = ""
- GridBag4IDTextBox.Text = ""
- GridBag5IDTextBox.Text = ""
- GridBag6IDTextBox.Text = ""
- GridBag7IDTextBox.Text = ""
- GridBag8IDTextBox.Text = ""
- GridBag9IDTextBox.Text = ""
- GridBag10IDTextBox.Text = ""
- GridBag11IDTextBox.Text = ""
- GridBag12IDTextBox.Text = ""
- GridBag13IDTextBox.Text = ""
- GridBag14IDTextBox.Text = ""
- GridCilentNameTextBox.Text = ""
- GridProductIDTextBox.Text = ""
- GridProductNameTextBox.Text = ""
- GridStatusComboBox.Text = ""
- SearchTextBox.Text = ""
- If ProductNameCheckBox.Checked = True Then
- ProductNameCheckBox.Checked = False
- End If
- End Sub
- Public Sub Update_Bag1()
- Dim cmd As New OleDbCommand
- cmd = New OleDbCommand("Update Bag1 set ProductID = '" & GridProductIDTextBox.Text & "', ProductName = '" & GridProductNameTextBox.Text & "', CilentName = '" & GridCilentNameTextBox.Text & "', Status = '" & GridStatusComboBox.Text & "' where IDP like '" & GridBag1IDTextBox.Text & "'", con)
- con.Open()
- cmd.ExecuteNonQuery()
- con.Close()
- End Sub
- Public Sub Update_Bag2()
- Dim cmd As New OleDbCommand
- cmd = New OleDbCommand("Update Bag2 set ProductID = '" & GridProductIDTextBox.Text & "', ProductName = '" & GridProductNameTextBox.Text & "', CilentName = '" & GridCilentNameTextBox.Text & "', Status = '" & GridStatusComboBox.Text & "' where IDP like '" & GridBag2IDTextBox.Text & "'", con)
- con.Open()
- cmd.ExecuteNonQuery()
- con.Close()
- End Sub
- Public Sub Update_Bag3()
- Dim cmd As New OleDbCommand
- cmd = New OleDbCommand("Update Bag3 set ProductID = '" & GridProductIDTextBox.Text & "', ProductName = '" & GridProductNameTextBox.Text & "', CilentName = '" & GridCilentNameTextBox.Text & "', Status = '" & GridStatusComboBox.Text & "' where IDP like '" & GridBag3IDTextBox.Text & "'", con)
- con.Open()
- cmd.ExecuteNonQuery()
- con.Close()
- End Sub
- Public Sub Update_Bag4()
- Dim cmd As New OleDbCommand
- cmd = New OleDbCommand("Update Bag4 set ProductID = '" & GridProductIDTextBox.Text & "', ProductName = '" & GridProductNameTextBox.Text & "', CilentName = '" & GridCilentNameTextBox.Text & "', Status = '" & GridStatusComboBox.Text & "' where IDP like '" & GridBag4IDTextBox.Text & "'", con)
- con.Open()
- cmd.ExecuteNonQuery()
- con.Close()
- End Sub
- Public Sub Update_Bag5()
- Dim cmd As New OleDbCommand
- cmd = New OleDbCommand("Update Bag5 set ProductID = '" & GridProductIDTextBox.Text & "', ProductName = '" & GridProductNameTextBox.Text & "', CilentName = '" & GridCilentNameTextBox.Text & "', Status = '" & GridStatusComboBox.Text & "' where IDP like '" & GridBag5IDTextBox.Text & "'", con)
- con.Open()
- cmd.ExecuteNonQuery()
- con.Close()
- End Sub
- Public Sub Update_Bag6()
- Dim cmd As New OleDbCommand
- cmd = New OleDbCommand("Update Bag6 set ProductID = '" & GridProductIDTextBox.Text & "', ProductName = '" & GridProductNameTextBox.Text & "', CilentName = '" & GridCilentNameTextBox.Text & "', Status = '" & GridStatusComboBox.Text & "' where IDP like '" & GridBag6IDTextBox.Text & "'", con)
- con.Open()
- cmd.ExecuteNonQuery()
- con.Close()
- End Sub
- Public Sub Update_Bag7()
- Dim cmd As New OleDbCommand
- cmd = New OleDbCommand("Update Bag7 set ProductID = '" & GridProductIDTextBox.Text & "', ProductName = '" & GridProductNameTextBox.Text & "', CilentName = '" & GridCilentNameTextBox.Text & "', Status = '" & GridStatusComboBox.Text & "' where IDP like '" & GridBag7IDTextBox.Text & "'", con)
- con.Open()
- cmd.ExecuteNonQuery()
- con.Close()
- End Sub
- Public Sub Update_Bag8()
- Dim cmd As New OleDbCommand
- cmd = New OleDbCommand("Update Bag8 set ProductID = '" & GridProductIDTextBox.Text & "', ProductName = '" & GridProductNameTextBox.Text & "', CilentName = '" & GridCilentNameTextBox.Text & "', Status = '" & GridStatusComboBox.Text & "' where IDP like '" & GridBag8IDTextBox.Text & "'", con)
- con.Open()
- cmd.ExecuteNonQuery()
- con.Close()
- End Sub
- Public Sub Update_Bag9()
- Dim cmd As New OleDbCommand
- cmd = New OleDbCommand("Update Bag9 set ProductID = '" & GridProductIDTextBox.Text & "', ProductName = '" & GridProductNameTextBox.Text & "', CilentName = '" & GridCilentNameTextBox.Text & "', Status = '" & GridStatusComboBox.Text & "' where IDP like '" & GridBag9IDTextBox.Text & "'", con)
- con.Open()
- cmd.ExecuteNonQuery()
- con.Close()
- End Sub
- Public Sub Update_Bag10()
- Dim cmd As New OleDbCommand
- cmd = New OleDbCommand("Update Bag10 set ProductID = '" & GridProductIDTextBox.Text & "', ProductName = '" & GridProductNameTextBox.Text & "', CilentName = '" & GridCilentNameTextBox.Text & "', Status = '" & GridStatusComboBox.Text & "' where IDP like '" & GridBag10IDTextBox.Text & "'", con)
- con.Open()
- cmd.ExecuteNonQuery()
- con.Close()
- End Sub
- Public Sub Update_Bag11()
- Dim cmd As New OleDbCommand
- cmd = New OleDbCommand("Update Bag11 set ProductID = '" & GridProductIDTextBox.Text & "', ProductName = '" & GridProductNameTextBox.Text & "', CilentName = '" & GridCilentNameTextBox.Text & "', Status = '" & GridStatusComboBox.Text & "' where IDP like '" & GridBag11IDTextBox.Text & "'", con)
- con.Open()
- cmd.ExecuteNonQuery()
- con.Close()
- End Sub
- Public Sub Update_Bag12()
- Dim cmd As New OleDbCommand
- cmd = New OleDbCommand("Update Bag12 set ProductID = '" & GridProductIDTextBox.Text & "', ProductName = '" & GridProductNameTextBox.Text & "', CilentName = '" & GridCilentNameTextBox.Text & "', Status = '" & GridStatusComboBox.Text & "' where IDP like '" & GridBag12IDTextBox.Text & "'", con)
- con.Open()
- cmd.ExecuteNonQuery()
- con.Close()
- End Sub
- Public Sub Update_Bag13()
- Dim cmd As New OleDbCommand
- cmd = New OleDbCommand("Update Bag13 set ProductID = '" & GridProductIDTextBox.Text & "', ProductName = '" & GridProductNameTextBox.Text & "', CilentName = '" & GridCilentNameTextBox.Text & "', Status = '" & GridStatusComboBox.Text & "' where IDP like '" & GridBag13IDTextBox.Text & "'", con)
- con.Open()
- cmd.ExecuteNonQuery()
- con.Close()
- End Sub
- Public Sub Update_Bag14()
- Dim cmd As New OleDbCommand
- cmd = New OleDbCommand("Update Bag14 set ProductID = '" & GridProductIDTextBox.Text & "', ProductName = '" & GridProductNameTextBox.Text & "', CilentName = '" & GridCilentNameTextBox.Text & "', Status = '" & GridStatusComboBox.Text & "' where IDP like '" & GridBag14IDTextBox.Text & "'", con)
- con.Open()
- cmd.ExecuteNonQuery()
- con.Close()
- End Sub
- '=========================================================================================================================================
- Public Sub Delete_Bag1()
- Dim cmd As New OleDbCommand
- cmd = New OleDbCommand(" Delete from Bag1 where IDP like '" & GridBag1IDTextBox.Text & "'", con)
- con.Open()
- cmd.ExecuteNonQuery()
- con.Close()
- End Sub
- Public Sub Delete_Bag2()
- Dim cmd As New OleDbCommand
- cmd = New OleDbCommand(" Delete from Bag2 where IDP like '" & GridBag2IDTextBox.Text & "'", con)
- con.Open()
- cmd.ExecuteNonQuery()
- con.Close()
- End Sub
- Public Sub Delete_Bag3()
- Dim cmd As New OleDbCommand
- cmd = New OleDbCommand(" Delete from Bag3 where IDP like '" & GridBag3IDTextBox.Text & "'", con)
- con.Open()
- cmd.ExecuteNonQuery()
- con.Close()
- End Sub
- Public Sub Delete_Bag4()
- Dim cmd As New OleDbCommand
- cmd = New OleDbCommand(" Delete from Bag4 where IDP like '" & GridBag4IDTextBox.Text & "'", con)
- con.Open()
- cmd.ExecuteNonQuery()
- con.Close()
- End Sub
- Public Sub Delete_Bag5()
- Dim cmd As New OleDbCommand
- cmd = New OleDbCommand(" Delete from Bag5 where IDP like '" & GridBag5IDTextBox.Text & "'", con)
- con.Open()
- cmd.ExecuteNonQuery()
- con.Close()
- End Sub
- Public Sub Delete_Bag6()
- Dim cmd As New OleDbCommand
- cmd = New OleDbCommand(" Delete from Bag6 where IDP like '" & GridBag6IDTextBox.Text & "'", con)
- con.Open()
- cmd.ExecuteNonQuery()
- con.Close()
- End Sub
- Public Sub Delete_Bag7()
- Dim cmd As New OleDbCommand
- cmd = New OleDbCommand(" Delete from Bag7 where IDP like '" & GridBag7IDTextBox.Text & "'", con)
- con.Open()
- cmd.ExecuteNonQuery()
- con.Close()
- End Sub
- Public Sub Delete_Bag8()
- Dim cmd As New OleDbCommand
- cmd = New OleDbCommand(" Delete from Bag8 where IDP like '" & GridBag8IDTextBox.Text & "'", con)
- con.Open()
- cmd.ExecuteNonQuery()
- con.Close()
- End Sub
- Public Sub Delete_Bag9()
- Dim cmd As New OleDbCommand
- cmd = New OleDbCommand(" Delete from Bag9 where IDP like '" & GridBag9IDTextBox.Text & "'", con)
- con.Open()
- cmd.ExecuteNonQuery()
- con.Close()
- End Sub
- Public Sub Delete_Bag10()
- Dim cmd As New OleDbCommand
- cmd = New OleDbCommand(" Delete from Bag10 where IDP like '" & GridBag10IDTextBox.Text & "'", con)
- con.Open()
- cmd.ExecuteNonQuery()
- con.Close()
- End Sub
- Public Sub Delete_Bag11()
- Dim cmd As New OleDbCommand
- cmd = New OleDbCommand(" Delete from Bag11 where IDP like '" & GridBag11IDTextBox.Text & "'", con)
- con.Open()
- cmd.ExecuteNonQuery()
- con.Close()
- End Sub
- Public Sub Delete_Bag12()
- Dim cmd As New OleDbCommand
- cmd = New OleDbCommand(" Delete from Bag12 where IDP like '" & GridBag12IDTextBox.Text & "'", con)
- con.Open()
- cmd.ExecuteNonQuery()
- con.Close()
- End Sub
- Public Sub Delete_Bag13()
- Dim cmd As New OleDbCommand
- cmd = New OleDbCommand(" Delete from Bag13 where IDP like '" & GridBag13IDTextBox.Text & "'", con)
- con.Open()
- cmd.ExecuteNonQuery()
- con.Close()
- End Sub
- Public Sub Delete_Bag14()
- Dim cmd As New OleDbCommand
- cmd = New OleDbCommand(" Delete from Bag14 where IDP like '" & GridBag14IDTextBox.Text & "'", con)
- con.Open()
- cmd.ExecuteNonQuery()
- con.Close()
- End Sub
- Private Sub BagsComboBox_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BagsComboBox.TextChanged
- If BagsComboBox.Text = "Bag1" Then
- New_Product()
- ElseIf BagsComboBox.Text = "Bag2" Then
- New_Product()
- ElseIf BagsComboBox.Text = "Bag3" Then
- New_Product()
- ElseIf BagsComboBox.Text = "Bag4" Then
- New_Product()
- ElseIf BagsComboBox.Text = "Bag5" Then
- New_Product()
- ElseIf BagsComboBox.Text = "Bag6" Then
- New_Product()
- ElseIf BagsComboBox.Text = "Bag7" Then
- New_Product()
- ElseIf BagsComboBox.Text = "Bag8" Then
- New_Product()
- ElseIf BagsComboBox.Text = "Bag9" Then
- New_Product()
- ElseIf BagsComboBox.Text = "Bag10" Then
- New_Product()
- ElseIf BagsComboBox.Text = "Bag11" Then
- New_Product()
- ElseIf BagsComboBox.Text = "Bag12" Then
- New_Product()
- ElseIf BagsComboBox.Text = "Bag13" Then
- New_Product()
- ElseIf BagsComboBox.Text = "Bag14" Then
- New_Product()
- End If
- End Sub
- Private Sub SaveBtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SaveBtn.Click
- If CilentNameTextBox.Text = "" Or ProductIDTextBox.Text = "" Or ProductNameTextBox.Text = "" Then
- Dim show1 As New mb.ShowMessagebox
- show1.Fonts(New Font("Modern No. 20", 15, FontStyle.Bold), mb.TextColor.Red)
- show1.ShowBox(" Please Fill Up all Fields! ", mb.MStyle.ok, mb.FStyle.Critical, "Confrim")
- Else
- If BagsComboBox.Text = "Bag1" Then
- Bag1_Insert()
- New_Product()
- End If
- If BagsComboBox.Text = "Bag2" Then
- Bag2_Insert()
- New_Product()
- End If
- If BagsComboBox.Text = "Bag3" Then
- Bag3_Insert()
- New_Product()
- End If
- If BagsComboBox.Text = "Bag4" Then
- Bag4_Insert()
- New_Product()
- End If
- If BagsComboBox.Text = "Bag5" Then
- Bag5_Insert()
- New_Product()
- End If
- If BagsComboBox.Text = "Bag6" Then
- Bag6_Insert()
- New_Product()
- End If
- If BagsComboBox.Text = "Bag7" Then
- Bag7_Insert()
- New_Product()
- End If
- If BagsComboBox.Text = "Bag8" Then
- Bag8_Insert()
- New_Product()
- End If
- If BagsComboBox.Text = "Bag9" Then
- Bag9_Insert()
- New_Product()
- End If
- If BagsComboBox.Text = "Bag10" Then
- Bag10_Insert()
- New_Product()
- End If
- If BagsComboBox.Text = "Bag11" Then
- Bag11_Insert()
- New_Product()
- End If
- If BagsComboBox.Text = "Bag12" Then
- Bag12_Insert()
- New_Product()
- End If
- If BagsComboBox.Text = "Bag13" Then
- Bag13_Insert()
- New_Product()
- End If
- If BagsComboBox.Text = "Bag14" Then
- Bag13_Insert()
- New_Product()
- End If
- End If
- End Sub
- Private Sub DataGridView1_CellEnter(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView1.CellEnter
- If BagsComboBox.Text = "Bag1" Then
- GridBag1IDTextBox.Text = DataGridView1.CurrentRow.Cells(0).Value
- GridProductIDTextBox.Text = DataGridView1.CurrentRow.Cells(1).Value
- GridProductNameTextBox.Text = DataGridView1.CurrentRow.Cells(2).Value
- GridCilentNameTextBox.Text = DataGridView1.CurrentRow.Cells(3).Value
- GridStatusComboBox.Text = DataGridView1.CurrentRow.Cells(4).Value
- End If
- If BagsComboBox.Text = "Bag2" Then
- GridBag2IDTextBox.Text = DataGridView1.CurrentRow.Cells(0).Value
- GridProductIDTextBox.Text = DataGridView1.CurrentRow.Cells(1).Value
- GridProductNameTextBox.Text = DataGridView1.CurrentRow.Cells(2).Value
- GridCilentNameTextBox.Text = DataGridView1.CurrentRow.Cells(3).Value
- GridStatusComboBox.Text = DataGridView1.CurrentRow.Cells(4).Value
- End If
- If BagsComboBox.Text = "Bag3" Then
- GridBag3IDTextBox.Text = DataGridView1.CurrentRow.Cells(0).Value
- GridProductIDTextBox.Text = DataGridView1.CurrentRow.Cells(1).Value
- GridProductNameTextBox.Text = DataGridView1.CurrentRow.Cells(2).Value
- GridCilentNameTextBox.Text = DataGridView1.CurrentRow.Cells(3).Value
- GridStatusComboBox.Text = DataGridView1.CurrentRow.Cells(4).Value
- End If
- If BagsComboBox.Text = "Bag4" Then
- GridBag4IDTextBox.Text = DataGridView1.CurrentRow.Cells(0).Value
- GridProductIDTextBox.Text = DataGridView1.CurrentRow.Cells(1).Value
- GridProductNameTextBox.Text = DataGridView1.CurrentRow.Cells(2).Value
- GridCilentNameTextBox.Text = DataGridView1.CurrentRow.Cells(3).Value
- GridStatusComboBox.Text = DataGridView1.CurrentRow.Cells(4).Value
- End If
- If BagsComboBox.Text = "Bag5" Then
- GridBag5IDTextBox.Text = DataGridView1.CurrentRow.Cells(0).Value
- GridProductIDTextBox.Text = DataGridView1.CurrentRow.Cells(1).Value
- GridProductNameTextBox.Text = DataGridView1.CurrentRow.Cells(2).Value
- GridCilentNameTextBox.Text = DataGridView1.CurrentRow.Cells(3).Value
- GridStatusComboBox.Text = DataGridView1.CurrentRow.Cells(4).Value
- End If
- If BagsComboBox.Text = "Bag6" Then
- GridBag6IDTextBox.Text = DataGridView1.CurrentRow.Cells(0).Value
- GridProductIDTextBox.Text = DataGridView1.CurrentRow.Cells(1).Value
- GridProductNameTextBox.Text = DataGridView1.CurrentRow.Cells(2).Value
- GridCilentNameTextBox.Text = DataGridView1.CurrentRow.Cells(3).Value
- GridStatusComboBox.Text = DataGridView1.CurrentRow.Cells(4).Value
- End If
- If BagsComboBox.Text = "Bag7" Then
- GridBag7IDTextBox.Text = DataGridView1.CurrentRow.Cells(0).Value
- GridProductIDTextBox.Text = DataGridView1.CurrentRow.Cells(1).Value
- GridProductNameTextBox.Text = DataGridView1.CurrentRow.Cells(2).Value
- GridCilentNameTextBox.Text = DataGridView1.CurrentRow.Cells(3).Value
- GridStatusComboBox.Text = DataGridView1.CurrentRow.Cells(4).Value
- End If
- If BagsComboBox.Text = "Bag8" Then
- GridBag8IDTextBox.Text = DataGridView1.CurrentRow.Cells(0).Value
- GridProductIDTextBox.Text = DataGridView1.CurrentRow.Cells(1).Value
- GridProductNameTextBox.Text = DataGridView1.CurrentRow.Cells(2).Value
- GridCilentNameTextBox.Text = DataGridView1.CurrentRow.Cells(3).Value
- GridStatusComboBox.Text = DataGridView1.CurrentRow.Cells(4).Value
- End If
- If BagsComboBox.Text = "Bag9" Then
- GridBag9IDTextBox.Text = DataGridView1.CurrentRow.Cells(0).Value
- GridProductIDTextBox.Text = DataGridView1.CurrentRow.Cells(1).Value
- GridProductNameTextBox.Text = DataGridView1.CurrentRow.Cells(2).Value
- GridCilentNameTextBox.Text = DataGridView1.CurrentRow.Cells(3).Value
- GridStatusComboBox.Text = DataGridView1.CurrentRow.Cells(4).Value
- End If
- If BagsComboBox.Text = "Bag10" Then
- GridBag10IDTextBox.Text = DataGridView1.CurrentRow.Cells(0).Value
- GridProductIDTextBox.Text = DataGridView1.CurrentRow.Cells(1).Value
- GridProductNameTextBox.Text = DataGridView1.CurrentRow.Cells(2).Value
- GridCilentNameTextBox.Text = DataGridView1.CurrentRow.Cells(3).Value
- GridStatusComboBox.Text = DataGridView1.CurrentRow.Cells(4).Value
- End If
- If BagsComboBox.Text = "Bag11" Then
- GridBag11IDTextBox.Text = DataGridView1.CurrentRow.Cells(0).Value
- GridProductIDTextBox.Text = DataGridView1.CurrentRow.Cells(1).Value
- GridProductNameTextBox.Text = DataGridView1.CurrentRow.Cells(2).Value
- GridCilentNameTextBox.Text = DataGridView1.CurrentRow.Cells(3).Value
- GridStatusComboBox.Text = DataGridView1.CurrentRow.Cells(4).Value
- End If
- If BagsComboBox.Text = "Bag12" Then
- GridBag12IDTextBox.Text = DataGridView1.CurrentRow.Cells(0).Value
- GridProductIDTextBox.Text = DataGridView1.CurrentRow.Cells(1).Value
- GridProductNameTextBox.Text = DataGridView1.CurrentRow.Cells(2).Value
- GridCilentNameTextBox.Text = DataGridView1.CurrentRow.Cells(3).Value
- GridStatusComboBox.Text = DataGridView1.CurrentRow.Cells(4).Value
- End If
- If BagsComboBox.Text = "Bag13" Then
- GridBag13IDTextBox.Text = DataGridView1.CurrentRow.Cells(0).Value
- GridProductIDTextBox.Text = DataGridView1.CurrentRow.Cells(1).Value
- GridProductNameTextBox.Text = DataGridView1.CurrentRow.Cells(2).Value
- GridCilentNameTextBox.Text = DataGridView1.CurrentRow.Cells(3).Value
- GridStatusComboBox.Text = DataGridView1.CurrentRow.Cells(4).Value
- End If
- If BagsComboBox.Text = "Bag14" Then
- GridBag14IDTextBox.Text = DataGridView1.CurrentRow.Cells(0).Value
- GridProductIDTextBox.Text = DataGridView1.CurrentRow.Cells(1).Value
- GridProductNameTextBox.Text = DataGridView1.CurrentRow.Cells(2).Value
- GridCilentNameTextBox.Text = DataGridView1.CurrentRow.Cells(3).Value
- GridStatusComboBox.Text = DataGridView1.CurrentRow.Cells(4).Value
- End If
- End Sub
- Private Sub UpdateBtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles UpdateBtn.Click
- If GridCilentNameTextBox.Text = "" Or GridProductIDTextBox.Text = "" Or GridProductNameTextBox.Text = "" Or GridStatusComboBox.Text = "" Then
- Dim show1 As New mb.ShowMessagebox
- show1.Fonts(New Font("Modern No. 20", 15, FontStyle.Bold), mb.TextColor.Red)
- show1.ShowBox(" Please Fill Up all Fields! ", mb.MStyle.ok, mb.FStyle.Critical, "Confrim")
- Else
- If BagsComboBox.Text = "Bag1" Then
- Update_Bag1()
- New_Product()
- End If
- If BagsComboBox.Text = "Bag2" Then
- Update_Bag2()
- New_Product()
- End If
- If BagsComboBox.Text = "Bag3" Then
- Update_Bag3()
- New_Product()
- End If
- If BagsComboBox.Text = "Bag4" Then
- Update_Bag4()
- New_Product()
- End If
- If BagsComboBox.Text = "Bag5" Then
- Update_Bag5()
- New_Product()
- End If
- If BagsComboBox.Text = "Bag6" Then
- Update_Bag6()
- New_Product()
- End If
- If BagsComboBox.Text = "Bag7" Then
- Update_Bag7()
- New_Product()
- End If
- If BagsComboBox.Text = "Bag8" Then
- Update_Bag8()
- New_Product()
- End If
- If BagsComboBox.Text = "Bag9" Then
- Update_Bag9()
- New_Product()
- End If
- If BagsComboBox.Text = "Bag10" Then
- Update_Bag10()
- New_Product()
- End If
- If BagsComboBox.Text = "Bag11" Then
- Update_Bag11()
- New_Product()
- End If
- If BagsComboBox.Text = "Bag12" Then
- Update_Bag12()
- New_Product()
- End If
- If BagsComboBox.Text = "Bag13" Then
- Update_Bag13()
- New_Product()
- End If
- If BagsComboBox.Text = "Bag14" Then
- Update_Bag14()
- New_Product()
- End If
- End If
- End Sub
- Private Sub DeleteBtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DeleteBtn.Click
- If GridCilentNameTextBox.Text = "" Or GridProductIDTextBox.Text = "" Or GridProductNameTextBox.Text = "" Or GridStatusComboBox.Text = "" Then
- Dim show1 As New mb.ShowMessagebox
- show1.Fonts(New Font("Modern No. 20", 15, FontStyle.Bold), mb.TextColor.Red)
- show1.ShowBox(" Please Fill Up all Fields! ", mb.MStyle.ok, mb.FStyle.Critical, "Confrim")
- Else
- If BagsComboBox.Text = "Bag1" Then
- Delete_Bag1()
- New_Product()
- End If
- If BagsComboBox.Text = "Bag2" Then
- Delete_Bag2()
- New_Product()
- End If
- If BagsComboBox.Text = "Bag3" Then
- Delete_Bag3()
- New_Product()
- End If
- If BagsComboBox.Text = "Bag4" Then
- Delete_Bag4()
- New_Product()
- End If
- If BagsComboBox.Text = "Bag5" Then
- Delete_Bag5()
- New_Product()
- End If
- If BagsComboBox.Text = "Bag6" Then
- Delete_Bag6()
- New_Product()
- End If
- If BagsComboBox.Text = "Bag7" Then
- Delete_Bag7()
- New_Product()
- End If
- If BagsComboBox.Text = "Bag8" Then
- Delete_Bag8()
- New_Product()
- End If
- If BagsComboBox.Text = "Bag9" Then
- Delete_Bag9()
- New_Product()
- End If
- If BagsComboBox.Text = "Bag10" Then
- Delete_Bag10()
- New_Product()
- End If
- If BagsComboBox.Text = "Bag11" Then
- Delete_Bag11()
- New_Product()
- End If
- If BagsComboBox.Text = "Bag12" Then
- Delete_Bag12()
- New_Product()
- End If
- If BagsComboBox.Text = "Bag13" Then
- Delete_Bag13()
- New_Product()
- End If
- If BagsComboBox.Text = "Bag14" Then
- Delete_Bag14()
- New_Product()
- End If
- End If
- End Sub
- Private Sub ResetBtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ResetBtn.Click
- If BagsComboBox.Text = "Bag1" Then
- Bag1Page_GridView()
- End If
- If BagsComboBox.Text = "Bag2" Then
- Bag2Page_GridView()
- End If
- If BagsComboBox.Text = "Bag3" Then
- Bag3Page_GridView()
- End If
- If BagsComboBox.Text = "Bag4" Then
- Bag4Page_GridView()
- End If
- If BagsComboBox.Text = "Bag5" Then
- Bag5Page_GridView()
- End If
- If BagsComboBox.Text = "Bag6" Then
- Bag6Page_GridView()
- End If
- If BagsComboBox.Text = "Bag7" Then
- Bag7Page_GridView()
- End If
- If BagsComboBox.Text = "Bag8" Then
- Bag8Page_GridView()
- End If
- If BagsComboBox.Text = "Bag9" Then
- Bag9Page_GridView()
- End If
- If BagsComboBox.Text = "Bag10" Then
- Bag10Page_GridView()
- End If
- If BagsComboBox.Text = "Bag11" Then
- Bag11Page_GridView()
- End If
- If BagsComboBox.Text = "Bag12" Then
- Bag12Page_GridView()
- End If
- If BagsComboBox.Text = "Bag13" Then
- Bag13Page_GridView()
- End If
- If BagsComboBox.Text = "Bag14" Then
- Bag14Page_GridView()
- End If
- End Sub
- Private Sub SearchBtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SearchBtn.Click
- If ProductNameCheckBox.Checked = True Then
- If BagsComboBox.Text = "Bag1" Then
- Dim daz As New OleDbDataAdapter
- Dim dbDataSet As New DataTable
- Dim dsz As New DataSet
- dsz.Tables.Add(dbDataSet)
- daz = New OleDbDataAdapter("SELECT Bag1.IDP AS ID, Bag1.ProductID, Bag1.ProductName, Bag1.CilentName, Bag1.Status FROM Bag1", con)
- daz.Fill(dbDataSet)
- Dim DV As New DataView(dbDataSet)
- DV.RowFilter = String.Format("ProductName Like '%{0}%'", SearchTextBox.Text)
- DataGridView1.DataSource = DV
- End If
- If BagsComboBox.Text = "Bag2" Then
- Dim daz As New OleDbDataAdapter
- Dim dbDataSet As New DataTable
- Dim dsz As New DataSet
- dsz.Tables.Add(dbDataSet)
- daz = New OleDbDataAdapter("SELECT Bag2.IDP AS ID, Bag2.ProductID, Bag2.ProductName, Bag2.CilentName, Bag2.Status FROM Bag2", con)
- daz.Fill(dbDataSet)
- Dim DV As New DataView(dbDataSet)
- DV.RowFilter = String.Format("ProductName Like '%{0}%'", SearchTextBox.Text)
- DataGridView1.DataSource = DV
- End If
- If BagsComboBox.Text = "Bag3" Then
- Dim daz As New OleDbDataAdapter
- Dim dbDataSet As New DataTable
- Dim dsz As New DataSet
- dsz.Tables.Add(dbDataSet)
- daz = New OleDbDataAdapter("SELECT Bag3.IDP AS ID, Bag3.ProductID, Bag3.ProductName, Bag3.CilentName, Bag3.Status FROM Bag3", con)
- daz.Fill(dbDataSet)
- Dim DV As New DataView(dbDataSet)
- DV.RowFilter = String.Format("ProductName Like '%{0}%'", SearchTextBox.Text)
- DataGridView1.DataSource = DV
- End If
- If BagsComboBox.Text = "Bag4" Then
- Dim daz As New OleDbDataAdapter
- Dim dbDataSet As New DataTable
- Dim dsz As New DataSet
- dsz.Tables.Add(dbDataSet)
- daz = New OleDbDataAdapter("SELECT Bag4.IDP AS ID, Bag4.ProductID, Bag4.ProductName, Bag4.CilentName, Bag4.Status FROM Bag4", con)
- daz.Fill(dbDataSet)
- Dim DV As New DataView(dbDataSet)
- DV.RowFilter = String.Format("ProductName Like '%{0}%'", SearchTextBox.Text)
- DataGridView1.DataSource = DV
- End If
- If BagsComboBox.Text = "Bag5" Then
- Dim daz As New OleDbDataAdapter
- Dim dbDataSet As New DataTable
- Dim dsz As New DataSet
- dsz.Tables.Add(dbDataSet)
- daz = New OleDbDataAdapter("SELECT Bag5.IDP AS ID, Bag5.ProductID, Bag5.ProductName, Bag5.CilentName, Bag5.Status FROM Bag5", con)
- daz.Fill(dbDataSet)
- Dim DV As New DataView(dbDataSet)
- DV.RowFilter = String.Format("ProductName Like '%{0}%'", SearchTextBox.Text)
- DataGridView1.DataSource = DV
- End If
- If BagsComboBox.Text = "Bag6" Then
- Dim daz As New OleDbDataAdapter
- Dim dbDataSet As New DataTable
- Dim dsz As New DataSet
- dsz.Tables.Add(dbDataSet)
- daz = New OleDbDataAdapter("SELECT Bag6.IDP AS ID, Bag6.ProductID, Bag6.ProductName, Bag6.CilentName, Bag6.Status FROM Bag6", con)
- daz.Fill(dbDataSet)
- Dim DV As New DataView(dbDataSet)
- DV.RowFilter = String.Format("ProductName Like '%{0}%'", SearchTextBox.Text)
- DataGridView1.DataSource = DV
- End If
- If BagsComboBox.Text = "Bag7" Then
- Dim daz As New OleDbDataAdapter
- Dim dbDataSet As New DataTable
- Dim dsz As New DataSet
- dsz.Tables.Add(dbDataSet)
- daz = New OleDbDataAdapter("SELECT Bag7.IDP AS ID, Bag7.ProductID, Bag7.ProductName, Bag7.CilentName, Bag7.Status FROM Bag7", con)
- daz.Fill(dbDataSet)
- Dim DV As New DataView(dbDataSet)
- DV.RowFilter = String.Format("ProductName Like '%{0}%'", SearchTextBox.Text)
- DataGridView1.DataSource = DV
- End If
- If BagsComboBox.Text = "Bag8" Then
- Dim daz As New OleDbDataAdapter
- Dim dbDataSet As New DataTable
- Dim dsz As New DataSet
- dsz.Tables.Add(dbDataSet)
- daz = New OleDbDataAdapter("SELECT Bag8.IDP AS ID, Bag8.ProductID, Bag8.ProductName, Bag8.CilentName, Bag8.Status FROM Bag8", con)
- daz.Fill(dbDataSet)
- Dim DV As New DataView(dbDataSet)
- DV.RowFilter = String.Format("ProductName Like '%{0}%'", SearchTextBox.Text)
- DataGridView1.DataSource = DV
- End If
- If BagsComboBox.Text = "Bag9" Then
- Dim daz As New OleDbDataAdapter
- Dim dbDataSet As New DataTable
- Dim dsz As New DataSet
- dsz.Tables.Add(dbDataSet)
- daz = New OleDbDataAdapter("SELECT Bag9.IDP AS ID, Bag9.ProductID, Bag9.ProductName, Bag9.CilentName, Bag9.Status FROM Bag9", con)
- daz.Fill(dbDataSet)
- Dim DV As New DataView(dbDataSet)
- DV.RowFilter = String.Format("ProductName Like '%{0}%'", SearchTextBox.Text)
- DataGridView1.DataSource = DV
- End If
- If BagsComboBox.Text = "Bag10" Then
- Dim daz As New OleDbDataAdapter
- Dim dbDataSet As New DataTable
- Dim dsz As New DataSet
- dsz.Tables.Add(dbDataSet)
- daz = New OleDbDataAdapter("SELECT Bag10.IDP AS ID, Bag10.ProductID, Bag10.ProductName, Bag10.CilentName, Bag10.Status FROM Bag10", con)
- daz.Fill(dbDataSet)
- Dim DV As New DataView(dbDataSet)
- DV.RowFilter = String.Format("ProductName Like '%{0}%'", SearchTextBox.Text)
- DataGridView1.DataSource = DV
- End If
- If BagsComboBox.Text = "Bag11" Then
- Dim daz As New OleDbDataAdapter
- Dim dbDataSet As New DataTable
- Dim dsz As New DataSet
- dsz.Tables.Add(dbDataSet)
- daz = New OleDbDataAdapter("SELECT Bag11.IDP AS ID, Bag11.ProductID, Bag11.ProductName, Bag11.CilentName, Bag11.Status FROM Bag11", con)
- daz.Fill(dbDataSet)
- Dim DV As New DataView(dbDataSet)
- DV.RowFilter = String.Format("ProductName Like '%{0}%'", SearchTextBox.Text)
- DataGridView1.DataSource = DV
- End If
- If BagsComboBox.Text = "Bag12" Then
- Dim daz As New OleDbDataAdapter
- Dim dbDataSet As New DataTable
- Dim dsz As New DataSet
- dsz.Tables.Add(dbDataSet)
- daz = New OleDbDataAdapter("SELECT Bag12.IDP AS ID, Bag12.ProductID, Bag12.ProductName, Bag12.CilentName, Bag12.Status FROM Bag12", con)
- daz.Fill(dbDataSet)
- Dim DV As New DataView(dbDataSet)
- DV.RowFilter = String.Format("ProductName Like '%{0}%'", SearchTextBox.Text)
- DataGridView1.DataSource = DV
- End If
- If BagsComboBox.Text = "Bag13" Then
- Dim daz As New OleDbDataAdapter
- Dim dbDataSet As New DataTable
- Dim dsz As New DataSet
- dsz.Tables.Add(dbDataSet)
- daz = New OleDbDataAdapter("SELECT Bag13.IDP AS ID, Bag13.ProductID, Bag13.ProductName, Bag13.CilentName, Bag13.Status FROM Bag13", con)
- daz.Fill(dbDataSet)
- Dim DV As New DataView(dbDataSet)
- DV.RowFilter = String.Format("ProductName Like '%{0}%'", SearchTextBox.Text)
- DataGridView1.DataSource = DV
- End If
- If BagsComboBox.Text = "Bag14" Then
- Dim daz As New OleDbDataAdapter
- Dim dbDataSet As New DataTable
- Dim dsz As New DataSet
- dsz.Tables.Add(dbDataSet)
- daz = New OleDbDataAdapter("SELECT Bag14.IDP AS ID, Bag14.ProductID, Bag14.ProductName, Bag14.CilentName, Bag14.Status FROM Bag14", con)
- daz.Fill(dbDataSet)
- Dim DV As New DataView(dbDataSet)
- DV.RowFilter = String.Format("ProductName Like '%{0}%'", SearchTextBox.Text)
- DataGridView1.DataSource = DV
- End If
- End If
- End Sub
- Private Sub DataGridView1_CellFormatting(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellFormattingEventArgs) Handles DataGridView1.CellFormatting
- If DataGridView1.Rows.Count > 0 Then
- For i As Integer = 0 To DataGridView1.Rows.Count - 1
- For j As Integer = 0 To DataGridView1.Columns.Count - 1
- Dim CellChange As String = DataGridView1.Rows(i).Cells(j).Value.ToString().Trim()
- If CellChange.Contains("DONE") = True Then
- With DataGridView1
- .Rows(i).Cells(j).Style.BackColor = Color.Lime
- .Rows(i).Cells(j).Style.ForeColor = Color.White
- End With
- End If
- If CellChange.Contains("UNDONE") = True Then
- With DataGridView1
- .Rows(i).Cells(j).Style.BackColor = Color.DeepPink
- .Rows(i).Cells(j).Style.ForeColor = Color.White
- End With
- End If
- If CellChange.Contains("AWAITING") = True Then
- With DataGridView1
- .Rows(i).Cells(j).Style.BackColor = Color.Gold
- .Rows(i).Cells(j).Style.ForeColor = Color.White
- End With
- End If
- Next
- Next
- End If
- End Sub
- Private Sub BagsComboBox_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BagsComboBox.SelectedIndexChanged
- End Sub
- End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement