Advertisement
Guest User

Untitled

a guest
Apr 22nd, 2019
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 59.02 KB | None | 0 0
  1. Imports System.Data.OleDb
  2.  
  3. Public Class Bags
  4.  
  5. Private Sub wait(ByVal seconds As Integer)
  6. For i As Integer = 0 To seconds * 100
  7. System.Threading.Thread.Sleep(10)
  8. 'Application.DoEvents()
  9. Application.DoEvents()
  10. Next
  11. End Sub
  12. ' Dim dt As DateTime = Date.Today.ToString("dd.MM.yyyy")
  13. Dim dt As DateTime = Date.Today
  14. Dim dtime As DateTime = TimeOfDay
  15. Public con As New OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & CStr(Application.StartupPath) & "\Data\Lenzo.accdb")
  16.  
  17. Public Sub Bag1Page_GridView()
  18.  
  19.  
  20. Dim daz As New OleDbDataAdapter
  21. Dim dtz As New DataTable
  22. Dim dsz As New DataSet
  23. dsz.Tables.Add(dtz)
  24. daz = New OleDbDataAdapter("SELECT Bag1.IDP AS ID, Bag1.ProductID, Bag1.ProductName, Bag1.CilentName, Bag1.Status FROM Bag1", con)
  25. daz.Fill(dtz)
  26. DataGridView1.DataSource = dtz.DefaultView
  27.  
  28. End Sub
  29.  
  30. Public Sub Bag2Page_GridView()
  31.  
  32.  
  33. Dim daz As New OleDbDataAdapter
  34. Dim dtz As New DataTable
  35. Dim dsz As New DataSet
  36. dsz.Tables.Add(dtz)
  37. daz = New OleDbDataAdapter("SELECT Bag2.IDP AS ID, Bag2.ProductID, Bag2.ProductName, Bag2.CilentName, Bag2.Status FROM Bag2", con)
  38. daz.Fill(dtz)
  39. DataGridView1.DataSource = dtz.DefaultView
  40.  
  41. End Sub
  42.  
  43. Public Sub Bag3Page_GridView()
  44.  
  45.  
  46. Dim daz As New OleDbDataAdapter
  47. Dim dtz As New DataTable
  48. Dim dsz As New DataSet
  49. dsz.Tables.Add(dtz)
  50. daz = New OleDbDataAdapter("SELECT Bag3.IDP AS ID, Bag3.ProductID, Bag3.ProductName, Bag3.CilentName, Bag3.Status FROM Bag3", con)
  51. daz.Fill(dtz)
  52. DataGridView1.DataSource = dtz.DefaultView
  53.  
  54. End Sub
  55.  
  56. Public Sub Bag4Page_GridView()
  57.  
  58.  
  59. Dim daz As New OleDbDataAdapter
  60. Dim dtz As New DataTable
  61. Dim dsz As New DataSet
  62. dsz.Tables.Add(dtz)
  63. daz = New OleDbDataAdapter("SELECT Bag4.IDP AS ID, Bag4.ProductID, Bag4.ProductName, Bag4.CilentName, Bag4.Status FROM Bag4", con)
  64. daz.Fill(dtz)
  65. DataGridView1.DataSource = dtz.DefaultView
  66.  
  67. End Sub
  68.  
  69. Public Sub Bag5Page_GridView()
  70.  
  71.  
  72. Dim daz As New OleDbDataAdapter
  73. Dim dtz As New DataTable
  74. Dim dsz As New DataSet
  75. dsz.Tables.Add(dtz)
  76. daz = New OleDbDataAdapter("SELECT Bag5.IDP AS ID, Bag5.ProductID, Bag5.ProductName, Bag5.CilentName, Bag5.Status FROM Bag5", con)
  77. daz.Fill(dtz)
  78. DataGridView1.DataSource = dtz.DefaultView
  79.  
  80. End Sub
  81.  
  82. Public Sub Bag6Page_GridView()
  83.  
  84.  
  85. Dim daz As New OleDbDataAdapter
  86. Dim dtz As New DataTable
  87. Dim dsz As New DataSet
  88. dsz.Tables.Add(dtz)
  89. daz = New OleDbDataAdapter("SELECT Bag6.IDP AS ID, Bag6.ProductID, Bag6.ProductName, Bag6.CilentName, Bag6.Status FROM Bag6", con)
  90. daz.Fill(dtz)
  91. DataGridView1.DataSource = dtz.DefaultView
  92.  
  93. End Sub
  94.  
  95. Public Sub Bag7Page_GridView()
  96.  
  97.  
  98. Dim daz As New OleDbDataAdapter
  99. Dim dtz As New DataTable
  100. Dim dsz As New DataSet
  101. dsz.Tables.Add(dtz)
  102. daz = New OleDbDataAdapter("SELECT Bag7.IDP AS ID, Bag7.ProductID, Bag7.ProductName, Bag7.CilentName, Bag7.Status FROM Bag7", con)
  103. daz.Fill(dtz)
  104. DataGridView1.DataSource = dtz.DefaultView
  105.  
  106. End Sub
  107.  
  108. Public Sub Bag8Page_GridView()
  109.  
  110.  
  111. Dim daz As New OleDbDataAdapter
  112. Dim dtz As New DataTable
  113. Dim dsz As New DataSet
  114. dsz.Tables.Add(dtz)
  115. daz = New OleDbDataAdapter("SELECT Bag8.IDP AS ID, Bag8.ProductID, Bag8.ProductName, Bag8.CilentName, Bag8.Status FROM Bag8", con)
  116. daz.Fill(dtz)
  117. DataGridView1.DataSource = dtz.DefaultView
  118.  
  119. End Sub
  120.  
  121. Public Sub Bag9Page_GridView()
  122.  
  123.  
  124. Dim daz As New OleDbDataAdapter
  125. Dim dtz As New DataTable
  126. Dim dsz As New DataSet
  127. dsz.Tables.Add(dtz)
  128. daz = New OleDbDataAdapter("SELECT Bag9.IDP AS ID, Bag9.ProductID, Bag9.ProductName, Bag9.CilentName, Bag9.Status FROM Bag9", con)
  129. daz.Fill(dtz)
  130. DataGridView1.DataSource = dtz.DefaultView
  131.  
  132. End Sub
  133.  
  134. Public Sub Bag10Page_GridView()
  135.  
  136.  
  137. Dim daz As New OleDbDataAdapter
  138. Dim dtz As New DataTable
  139. Dim dsz As New DataSet
  140. dsz.Tables.Add(dtz)
  141. daz = New OleDbDataAdapter("SELECT Bag10.IDP AS ID, Bag10.ProductID, Bag10.ProductName, Bag10.CilentName, Bag10.Status FROM Bag10", con)
  142. daz.Fill(dtz)
  143. DataGridView1.DataSource = dtz.DefaultView
  144.  
  145. End Sub
  146.  
  147. Public Sub Bag11Page_GridView()
  148.  
  149.  
  150. Dim daz As New OleDbDataAdapter
  151. Dim dtz As New DataTable
  152. Dim dsz As New DataSet
  153. dsz.Tables.Add(dtz)
  154. daz = New OleDbDataAdapter("SELECT Bag11.IDP AS ID, Bag11.ProductID, Bag11.ProductName, Bag11.CilentName, Bag11.Status FROM Bag11", con)
  155. daz.Fill(dtz)
  156. DataGridView1.DataSource = dtz.DefaultView
  157.  
  158. End Sub
  159.  
  160. Public Sub Bag12Page_GridView()
  161.  
  162.  
  163. Dim daz As New OleDbDataAdapter
  164. Dim dtz As New DataTable
  165. Dim dsz As New DataSet
  166. dsz.Tables.Add(dtz)
  167. daz = New OleDbDataAdapter("SELECT Bag12.IDP AS ID, Bag12.ProductID, Bag12.ProductName, Bag12.CilentName, Bag12.Status FROM Bag12", con)
  168. daz.Fill(dtz)
  169. DataGridView1.DataSource = dtz.DefaultView
  170.  
  171. End Sub
  172.  
  173. Public Sub Bag13Page_GridView()
  174.  
  175.  
  176. Dim daz As New OleDbDataAdapter
  177. Dim dtz As New DataTable
  178. Dim dsz As New DataSet
  179. dsz.Tables.Add(dtz)
  180. daz = New OleDbDataAdapter("SELECT Bag13.IDP AS ID, Bag13.ProductID, Bag13.ProductName, Bag13.CilentName, Bag13.Status FROM Bag13", con)
  181. daz.Fill(dtz)
  182. DataGridView1.DataSource = dtz.DefaultView
  183.  
  184. End Sub
  185.  
  186. Public Sub Bag14Page_GridView()
  187.  
  188.  
  189. Dim daz As New OleDbDataAdapter
  190. Dim dtz As New DataTable
  191. Dim dsz As New DataSet
  192. dsz.Tables.Add(dtz)
  193. daz = New OleDbDataAdapter("SELECT Bag14.IDP AS ID, Bag14.ProductID, Bag14.ProductName, Bag14.CilentName, Bag14.Status FROM Bag14", con)
  194. daz.Fill(dtz)
  195. DataGridView1.DataSource = dtz.DefaultView
  196.  
  197. End Sub
  198.  
  199. Public Sub Bags_Combobox()
  200. con.Open()
  201. Dim da As New OleDbDataAdapter
  202. Dim dt As New DataTable
  203.  
  204. da = New OleDbDataAdapter("Select * from Bags ", con)
  205. da.Fill(dt)
  206.  
  207. BagsComboBox.DataSource = dt
  208. BagsComboBox.DisplayMember = "Bags"
  209. BagsComboBox.ValueMember = "BagName"
  210.  
  211.  
  212. con.Close()
  213. End Sub
  214.  
  215. Private Sub Bags_Enter(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Enter
  216. Bags_Combobox()
  217. End Sub
  218.  
  219. Private Sub Bags_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
  220. Bags_Combobox()
  221. End Sub
  222.  
  223. Public Sub Bag1_ID()
  224.  
  225. Dim autoID As Single
  226. Dim mycmd As New OleDbCommand
  227. con.Open()
  228. mycmd = New OleDbCommand("select count (*) as Valuez from Bag1", con)
  229. Dim objdatareader As OleDbDataReader
  230. objdatareader = mycmd.ExecuteReader
  231. While objdatareader.Read
  232. autoID = Val(objdatareader.Item("Valuez").ToString) + 1
  233. End While
  234. Bag1IDTextBox.Text = autoID
  235. con.Close()
  236. End Sub
  237.  
  238. Public Sub Bag2_ID()
  239.  
  240. Dim autoID As Single
  241. Dim mycmd As New OleDbCommand
  242. con.Open()
  243. mycmd = New OleDbCommand("select count (*) as Valuez from Bag2", con)
  244. Dim objdatareader As OleDbDataReader
  245. objdatareader = mycmd.ExecuteReader
  246. While objdatareader.Read
  247. autoID = Val(objdatareader.Item("Valuez").ToString) + 1
  248. End While
  249. Bag2IDTextBox.Text = autoID
  250. con.Close()
  251. End Sub
  252.  
  253. Public Sub Bag3_ID()
  254.  
  255. Dim autoID As Single
  256. Dim mycmd As New OleDbCommand
  257. con.Open()
  258. mycmd = New OleDbCommand("select count (*) as Valuez from Bag3", con)
  259. Dim objdatareader As OleDbDataReader
  260. objdatareader = mycmd.ExecuteReader
  261. While objdatareader.Read
  262. autoID = Val(objdatareader.Item("Valuez").ToString) + 1
  263. End While
  264. Bag3IDTextBox.Text = autoID
  265. con.Close()
  266. End Sub
  267.  
  268. Public Sub Bag4_ID()
  269.  
  270. Dim autoID As Single
  271. Dim mycmd As New OleDbCommand
  272. con.Open()
  273. mycmd = New OleDbCommand("select count (*) as Valuez from Bag4", con)
  274. Dim objdatareader As OleDbDataReader
  275. objdatareader = mycmd.ExecuteReader
  276. While objdatareader.Read
  277. autoID = Val(objdatareader.Item("Valuez").ToString) + 1
  278. End While
  279. Bag4IDTextBox.Text = autoID
  280. con.Close()
  281. End Sub
  282.  
  283. Public Sub Bag5_ID()
  284.  
  285. Dim autoID As Single
  286. Dim mycmd As New OleDbCommand
  287. con.Open()
  288. mycmd = New OleDbCommand("select count (*) as Valuez from Bag5", con)
  289. Dim objdatareader As OleDbDataReader
  290. objdatareader = mycmd.ExecuteReader
  291. While objdatareader.Read
  292. autoID = Val(objdatareader.Item("Valuez").ToString) + 1
  293. End While
  294. Bag5IDTextBox.Text = autoID
  295. con.Close()
  296. End Sub
  297.  
  298. Public Sub Bag6_ID()
  299.  
  300. Dim autoID As Single
  301. Dim mycmd As New OleDbCommand
  302. con.Open()
  303. mycmd = New OleDbCommand("select count (*) as Valuez from Bag6", con)
  304. Dim objdatareader As OleDbDataReader
  305. objdatareader = mycmd.ExecuteReader
  306. While objdatareader.Read
  307. autoID = Val(objdatareader.Item("Valuez").ToString) + 1
  308. End While
  309. Bag6IDTextBox.Text = autoID
  310. con.Close()
  311. End Sub
  312.  
  313. Public Sub Bag7_ID()
  314.  
  315. Dim autoID As Single
  316. Dim mycmd As New OleDbCommand
  317. con.Open()
  318. mycmd = New OleDbCommand("select count (*) as Valuez from Bag7", con)
  319. Dim objdatareader As OleDbDataReader
  320. objdatareader = mycmd.ExecuteReader
  321. While objdatareader.Read
  322. autoID = Val(objdatareader.Item("Valuez").ToString) + 1
  323. End While
  324. Bag7IDTextBox.Text = autoID
  325. con.Close()
  326. End Sub
  327.  
  328. Public Sub Bag8_ID()
  329.  
  330. Dim autoID As Single
  331. Dim mycmd As New OleDbCommand
  332. con.Open()
  333. mycmd = New OleDbCommand("select count (*) as Valuez from Bag8", con)
  334. Dim objdatareader As OleDbDataReader
  335. objdatareader = mycmd.ExecuteReader
  336. While objdatareader.Read
  337. autoID = Val(objdatareader.Item("Valuez").ToString) + 1
  338. End While
  339. Bag8IDTextBox.Text = autoID
  340. con.Close()
  341. End Sub
  342.  
  343. Public Sub Bag9_ID()
  344.  
  345. Dim autoID As Single
  346. Dim mycmd As New OleDbCommand
  347. con.Open()
  348. mycmd = New OleDbCommand("select count (*) as Valuez from Bag9", con)
  349. Dim objdatareader As OleDbDataReader
  350. objdatareader = mycmd.ExecuteReader
  351. While objdatareader.Read
  352. autoID = Val(objdatareader.Item("Valuez").ToString) + 1
  353. End While
  354. Bag9IDTextBox.Text = autoID
  355. con.Close()
  356. End Sub
  357.  
  358.  
  359. Public Sub Bag10_ID()
  360.  
  361. Dim autoID As Single
  362. Dim mycmd As New OleDbCommand
  363. con.Open()
  364. mycmd = New OleDbCommand("select count (*) as Valuez from Bag10", con)
  365. Dim objdatareader As OleDbDataReader
  366. objdatareader = mycmd.ExecuteReader
  367. While objdatareader.Read
  368. autoID = Val(objdatareader.Item("Valuez").ToString) + 1
  369. End While
  370. Bag10IDTextBox.Text = autoID
  371. con.Close()
  372. End Sub
  373.  
  374.  
  375. Public Sub Bag11_ID()
  376.  
  377. Dim autoID As Single
  378. Dim mycmd As New OleDbCommand
  379. con.Open()
  380. mycmd = New OleDbCommand("select count (*) as Valuez from Bag11", con)
  381. Dim objdatareader As OleDbDataReader
  382. objdatareader = mycmd.ExecuteReader
  383. While objdatareader.Read
  384. autoID = Val(objdatareader.Item("Valuez").ToString) + 1
  385. End While
  386. Bag11IDTextBox.Text = autoID
  387. con.Close()
  388. End Sub
  389.  
  390. Public Sub Bag12_ID()
  391.  
  392. Dim autoID As Single
  393. Dim mycmd As New OleDbCommand
  394. con.Open()
  395. mycmd = New OleDbCommand("select count (*) as Valuez from Bag12", con)
  396. Dim objdatareader As OleDbDataReader
  397. objdatareader = mycmd.ExecuteReader
  398. While objdatareader.Read
  399. autoID = Val(objdatareader.Item("Valuez").ToString) + 1
  400. End While
  401. Bag12IDTextBox.Text = autoID
  402. con.Close()
  403. End Sub
  404.  
  405. Public Sub Bag13_ID()
  406.  
  407. Dim autoID As Single
  408. Dim mycmd As New OleDbCommand
  409. con.Open()
  410. mycmd = New OleDbCommand("select count (*) as Valuez from Bag13", con)
  411. Dim objdatareader As OleDbDataReader
  412. objdatareader = mycmd.ExecuteReader
  413. While objdatareader.Read
  414. autoID = Val(objdatareader.Item("Valuez").ToString) + 1
  415. End While
  416. Bag13IDTextBox.Text = autoID
  417. con.Close()
  418. End Sub
  419.  
  420. Public Sub Bag14_ID()
  421.  
  422. Dim autoID As Single
  423. Dim mycmd As New OleDbCommand
  424. con.Open()
  425. mycmd = New OleDbCommand("select count (*) as Valuez from Bag14", con)
  426. Dim objdatareader As OleDbDataReader
  427. objdatareader = mycmd.ExecuteReader
  428. While objdatareader.Read
  429. autoID = Val(objdatareader.Item("Valuez").ToString) + 1
  430. End While
  431. Bag14IDTextBox.Text = autoID
  432. con.Close()
  433. End Sub
  434.  
  435.  
  436.  
  437. Public Sub Bag1_Insert()
  438.  
  439. Dim dt As New DataTable
  440. Dim cmd As New OleDbCommand
  441. dt.Clear()
  442.  
  443. cmd = New OleDbCommand("INSERT INTO Bag1 (IDP,ProductID,ProductName,CilentName) values ('" & Bag1IDTextBox.Text & "','" & ProductIDTextBox.Text & "','" & ProductNameTextBox.Text & "','" & CilentNameTextBox.Text & "') ", con)
  444. con.Open()
  445. cmd.ExecuteNonQuery()
  446. con.Close()
  447.  
  448. End Sub
  449.  
  450. Public Sub Bag2_Insert()
  451.  
  452. Dim dt As New DataTable
  453. Dim cmd As New OleDbCommand
  454. dt.Clear()
  455.  
  456. cmd = New OleDbCommand("INSERT INTO Bag2 (IDP,ProductID,ProductName,CilentName) values ('" & Bag2IDTextBox.Text & "','" & ProductIDTextBox.Text & "','" & ProductNameTextBox.Text & "','" & CilentNameTextBox.Text & "') ", con)
  457. con.Open()
  458. cmd.ExecuteNonQuery()
  459. con.Close()
  460.  
  461. End Sub
  462.  
  463. Public Sub Bag3_Insert()
  464.  
  465. Dim dt As New DataTable
  466. Dim cmd As New OleDbCommand
  467. dt.Clear()
  468.  
  469. cmd = New OleDbCommand("INSERT INTO Bag3 (IDP,ProductID,ProductName,CilentName) values ('" & Bag3IDTextBox.Text & "','" & ProductIDTextBox.Text & "','" & ProductNameTextBox.Text & "','" & CilentNameTextBox.Text & "') ", con)
  470. con.Open()
  471. cmd.ExecuteNonQuery()
  472. con.Close()
  473.  
  474. End Sub
  475.  
  476. Public Sub Bag4_Insert()
  477.  
  478. Dim dt As New DataTable
  479. Dim cmd As New OleDbCommand
  480. dt.Clear()
  481.  
  482. cmd = New OleDbCommand("INSERT INTO Bag4 (IDP,ProductID,ProductName,CilentName) values ('" & Bag4IDTextBox.Text & "','" & ProductIDTextBox.Text & "','" & ProductNameTextBox.Text & "','" & CilentNameTextBox.Text & "') ", con)
  483. con.Open()
  484. cmd.ExecuteNonQuery()
  485. con.Close()
  486.  
  487. End Sub
  488.  
  489. Public Sub Bag5_Insert()
  490.  
  491. Dim dt As New DataTable
  492. Dim cmd As New OleDbCommand
  493. dt.Clear()
  494.  
  495. cmd = New OleDbCommand("INSERT INTO Bag5 (IDP,ProductID,ProductName,CilentName) values ('" & Bag5IDTextBox.Text & "','" & ProductIDTextBox.Text & "','" & ProductNameTextBox.Text & "','" & CilentNameTextBox.Text & "') ", con)
  496. con.Open()
  497. cmd.ExecuteNonQuery()
  498. con.Close()
  499.  
  500. End Sub
  501.  
  502. Public Sub Bag6_Insert()
  503.  
  504. Dim dt As New DataTable
  505. Dim cmd As New OleDbCommand
  506. dt.Clear()
  507.  
  508. cmd = New OleDbCommand("INSERT INTO Bag6 (IDP,ProductID,ProductName,CilentName) values ('" & Bag6IDTextBox.Text & "','" & ProductIDTextBox.Text & "','" & ProductNameTextBox.Text & "','" & CilentNameTextBox.Text & "') ", con)
  509. con.Open()
  510. cmd.ExecuteNonQuery()
  511. con.Close()
  512.  
  513. End Sub
  514.  
  515. Public Sub Bag7_Insert()
  516.  
  517. Dim dt As New DataTable
  518. Dim cmd As New OleDbCommand
  519. dt.Clear()
  520.  
  521. cmd = New OleDbCommand("INSERT INTO Bag7 (IDP,ProductID,ProductName,CilentName) values ('" & Bag7IDTextBox.Text & "','" & ProductIDTextBox.Text & "','" & ProductNameTextBox.Text & "','" & CilentNameTextBox.Text & "') ", con)
  522. con.Open()
  523. cmd.ExecuteNonQuery()
  524. con.Close()
  525.  
  526. End Sub
  527.  
  528. Public Sub Bag8_Insert()
  529.  
  530. Dim dt As New DataTable
  531. Dim cmd As New OleDbCommand
  532. dt.Clear()
  533.  
  534. cmd = New OleDbCommand("INSERT INTO Bag8 (IDP,ProductID,ProductName,CilentName) values ('" & Bag8IDTextBox.Text & "','" & ProductIDTextBox.Text & "','" & ProductNameTextBox.Text & "','" & CilentNameTextBox.Text & "') ", con)
  535. con.Open()
  536. cmd.ExecuteNonQuery()
  537. con.Close()
  538.  
  539. End Sub
  540.  
  541. Public Sub Bag9_Insert()
  542.  
  543. Dim dt As New DataTable
  544. Dim cmd As New OleDbCommand
  545. dt.Clear()
  546.  
  547. cmd = New OleDbCommand("INSERT INTO Bag9 (IDP,ProductID,ProductName,CilentName) values ('" & Bag9IDTextBox.Text & "','" & ProductIDTextBox.Text & "','" & ProductNameTextBox.Text & "','" & CilentNameTextBox.Text & "') ", con)
  548. con.Open()
  549. cmd.ExecuteNonQuery()
  550. con.Close()
  551.  
  552. End Sub
  553.  
  554. Public Sub Bag10_Insert()
  555.  
  556. Dim dt As New DataTable
  557. Dim cmd As New OleDbCommand
  558. dt.Clear()
  559.  
  560. cmd = New OleDbCommand("INSERT INTO Bag10 (IDP,ProductID,ProductName,CilentName) values ('" & Bag10IDTextBox.Text & "','" & ProductIDTextBox.Text & "','" & ProductNameTextBox.Text & "','" & CilentNameTextBox.Text & "') ", con)
  561. con.Open()
  562. cmd.ExecuteNonQuery()
  563. con.Close()
  564.  
  565. End Sub
  566.  
  567.  
  568. Public Sub Bag11_Insert()
  569.  
  570. Dim dt As New DataTable
  571. Dim cmd As New OleDbCommand
  572. dt.Clear()
  573.  
  574. cmd = New OleDbCommand("INSERT INTO Bag11 (IDP,ProductID,ProductName,CilentName) values ('" & Bag11IDTextBox.Text & "','" & ProductIDTextBox.Text & "','" & ProductNameTextBox.Text & "','" & CilentNameTextBox.Text & "') ", con)
  575. con.Open()
  576. cmd.ExecuteNonQuery()
  577. con.Close()
  578.  
  579. End Sub
  580.  
  581. Public Sub Bag12_Insert()
  582.  
  583. Dim dt As New DataTable
  584. Dim cmd As New OleDbCommand
  585. dt.Clear()
  586.  
  587. cmd = New OleDbCommand("INSERT INTO Bag12 (IDP,ProductID,ProductName,CilentName) values ('" & Bag12IDTextBox.Text & "','" & ProductIDTextBox.Text & "','" & ProductNameTextBox.Text & "','" & CilentNameTextBox.Text & "') ", con)
  588. con.Open()
  589. cmd.ExecuteNonQuery()
  590. con.Close()
  591.  
  592. End Sub
  593.  
  594. Public Sub Bag13_Insert()
  595.  
  596. Dim dt As New DataTable
  597. Dim cmd As New OleDbCommand
  598. dt.Clear()
  599.  
  600. cmd = New OleDbCommand("INSERT INTO Bag13 (IDP,ProductID,ProductName,CilentName) values ('" & Bag13IDTextBox.Text & "','" & ProductIDTextBox.Text & "','" & ProductNameTextBox.Text & "','" & CilentNameTextBox.Text & "') ", con)
  601. con.Open()
  602. cmd.ExecuteNonQuery()
  603. con.Close()
  604.  
  605. End Sub
  606.  
  607. Public Sub Bag14_Insert()
  608.  
  609. Dim dt As New DataTable
  610. Dim cmd As New OleDbCommand
  611. dt.Clear()
  612.  
  613. cmd = New OleDbCommand("INSERT INTO Bag14 (IDP,ProductID,ProductName,CilentName) values ('" & Bag14IDTextBox.Text & "','" & ProductIDTextBox.Text & "','" & ProductNameTextBox.Text & "','" & CilentNameTextBox.Text & "') ", con)
  614. con.Open()
  615. cmd.ExecuteNonQuery()
  616. con.Close()
  617.  
  618. End Sub
  619.  
  620.  
  621.  
  622.  
  623. Public Sub New_Product()
  624. If BagsComboBox.Text = "Bag1" Then
  625. Bag1Page_GridView()
  626. End If
  627.  
  628. If BagsComboBox.Text = "Bag2" Then
  629. Bag2Page_GridView()
  630. End If
  631.  
  632. If BagsComboBox.Text = "Bag3" Then
  633. Bag3Page_GridView()
  634. End If
  635.  
  636. If BagsComboBox.Text = "Bag4" Then
  637. Bag4Page_GridView()
  638. End If
  639.  
  640. If BagsComboBox.Text = "Bag5" Then
  641. Bag5Page_GridView()
  642. End If
  643.  
  644. If BagsComboBox.Text = "Bag6" Then
  645. Bag6Page_GridView()
  646. End If
  647.  
  648. If BagsComboBox.Text = "Bag7" Then
  649. Bag7Page_GridView()
  650. End If
  651.  
  652. If BagsComboBox.Text = "Bag8" Then
  653. Bag8Page_GridView()
  654. End If
  655.  
  656. If BagsComboBox.Text = "Bag9" Then
  657. Bag9Page_GridView()
  658. End If
  659.  
  660. If BagsComboBox.Text = "Bag10" Then
  661. Bag10Page_GridView()
  662. End If
  663.  
  664. If BagsComboBox.Text = "Bag11" Then
  665. Bag11Page_GridView()
  666. End If
  667.  
  668. If BagsComboBox.Text = "Bag12" Then
  669. Bag12Page_GridView()
  670. End If
  671.  
  672. If BagsComboBox.Text = "Bag13" Then
  673. Bag13Page_GridView()
  674. End If
  675.  
  676. If BagsComboBox.Text = "Bag14" Then
  677. Bag14Page_GridView()
  678. End If
  679.  
  680. Bag1_ID()
  681. Bag2_ID()
  682. Bag3_ID()
  683. Bag4_ID()
  684. Bag5_ID()
  685. Bag6_ID()
  686. Bag7_ID()
  687. Bag8_ID()
  688. Bag9_ID()
  689. Bag10_ID()
  690. Bag11_ID()
  691. Bag12_ID()
  692. Bag13_ID()
  693. Bag14_ID()
  694. CilentNameTextBox.Text = "None"
  695. ProductIDTextBox.Text = ""
  696. ProductNameTextBox.Text = ""
  697.  
  698. GridBag1IDTextBox.Text = ""
  699. GridBag2IDTextBox.Text = ""
  700. GridBag3IDTextBox.Text = ""
  701. GridBag4IDTextBox.Text = ""
  702. GridBag5IDTextBox.Text = ""
  703. GridBag6IDTextBox.Text = ""
  704. GridBag7IDTextBox.Text = ""
  705. GridBag8IDTextBox.Text = ""
  706. GridBag9IDTextBox.Text = ""
  707. GridBag10IDTextBox.Text = ""
  708. GridBag11IDTextBox.Text = ""
  709. GridBag12IDTextBox.Text = ""
  710. GridBag13IDTextBox.Text = ""
  711. GridBag14IDTextBox.Text = ""
  712.  
  713. GridCilentNameTextBox.Text = ""
  714. GridProductIDTextBox.Text = ""
  715. GridProductNameTextBox.Text = ""
  716. GridStatusComboBox.Text = ""
  717. SearchTextBox.Text = ""
  718.  
  719. If ProductNameCheckBox.Checked = True Then
  720. ProductNameCheckBox.Checked = False
  721. End If
  722. End Sub
  723.  
  724. Public Sub Update_Bag1()
  725.  
  726. Dim cmd As New OleDbCommand
  727. cmd = New OleDbCommand("Update Bag1 set ProductID = '" & GridProductIDTextBox.Text & "', ProductName = '" & GridProductNameTextBox.Text & "', CilentName = '" & GridCilentNameTextBox.Text & "', Status = '" & GridStatusComboBox.Text & "' where IDP like '" & GridBag1IDTextBox.Text & "'", con)
  728. con.Open()
  729. cmd.ExecuteNonQuery()
  730. con.Close()
  731.  
  732. End Sub
  733.  
  734. Public Sub Update_Bag2()
  735.  
  736. Dim cmd As New OleDbCommand
  737. cmd = New OleDbCommand("Update Bag2 set ProductID = '" & GridProductIDTextBox.Text & "', ProductName = '" & GridProductNameTextBox.Text & "', CilentName = '" & GridCilentNameTextBox.Text & "', Status = '" & GridStatusComboBox.Text & "' where IDP like '" & GridBag2IDTextBox.Text & "'", con)
  738. con.Open()
  739. cmd.ExecuteNonQuery()
  740. con.Close()
  741.  
  742. End Sub
  743.  
  744. Public Sub Update_Bag3()
  745.  
  746. Dim cmd As New OleDbCommand
  747. cmd = New OleDbCommand("Update Bag3 set ProductID = '" & GridProductIDTextBox.Text & "', ProductName = '" & GridProductNameTextBox.Text & "', CilentName = '" & GridCilentNameTextBox.Text & "', Status = '" & GridStatusComboBox.Text & "' where IDP like '" & GridBag3IDTextBox.Text & "'", con)
  748. con.Open()
  749. cmd.ExecuteNonQuery()
  750. con.Close()
  751.  
  752. End Sub
  753.  
  754. Public Sub Update_Bag4()
  755.  
  756. Dim cmd As New OleDbCommand
  757. cmd = New OleDbCommand("Update Bag4 set ProductID = '" & GridProductIDTextBox.Text & "', ProductName = '" & GridProductNameTextBox.Text & "', CilentName = '" & GridCilentNameTextBox.Text & "', Status = '" & GridStatusComboBox.Text & "' where IDP like '" & GridBag4IDTextBox.Text & "'", con)
  758. con.Open()
  759. cmd.ExecuteNonQuery()
  760. con.Close()
  761.  
  762. End Sub
  763.  
  764. Public Sub Update_Bag5()
  765.  
  766. Dim cmd As New OleDbCommand
  767. cmd = New OleDbCommand("Update Bag5 set ProductID = '" & GridProductIDTextBox.Text & "', ProductName = '" & GridProductNameTextBox.Text & "', CilentName = '" & GridCilentNameTextBox.Text & "', Status = '" & GridStatusComboBox.Text & "' where IDP like '" & GridBag5IDTextBox.Text & "'", con)
  768. con.Open()
  769. cmd.ExecuteNonQuery()
  770. con.Close()
  771.  
  772. End Sub
  773.  
  774. Public Sub Update_Bag6()
  775.  
  776. Dim cmd As New OleDbCommand
  777. cmd = New OleDbCommand("Update Bag6 set ProductID = '" & GridProductIDTextBox.Text & "', ProductName = '" & GridProductNameTextBox.Text & "', CilentName = '" & GridCilentNameTextBox.Text & "', Status = '" & GridStatusComboBox.Text & "' where IDP like '" & GridBag6IDTextBox.Text & "'", con)
  778. con.Open()
  779. cmd.ExecuteNonQuery()
  780. con.Close()
  781.  
  782. End Sub
  783.  
  784. Public Sub Update_Bag7()
  785.  
  786. Dim cmd As New OleDbCommand
  787. cmd = New OleDbCommand("Update Bag7 set ProductID = '" & GridProductIDTextBox.Text & "', ProductName = '" & GridProductNameTextBox.Text & "', CilentName = '" & GridCilentNameTextBox.Text & "', Status = '" & GridStatusComboBox.Text & "' where IDP like '" & GridBag7IDTextBox.Text & "'", con)
  788. con.Open()
  789. cmd.ExecuteNonQuery()
  790. con.Close()
  791.  
  792. End Sub
  793.  
  794. Public Sub Update_Bag8()
  795.  
  796. Dim cmd As New OleDbCommand
  797. cmd = New OleDbCommand("Update Bag8 set ProductID = '" & GridProductIDTextBox.Text & "', ProductName = '" & GridProductNameTextBox.Text & "', CilentName = '" & GridCilentNameTextBox.Text & "', Status = '" & GridStatusComboBox.Text & "' where IDP like '" & GridBag8IDTextBox.Text & "'", con)
  798. con.Open()
  799. cmd.ExecuteNonQuery()
  800. con.Close()
  801.  
  802. End Sub
  803.  
  804. Public Sub Update_Bag9()
  805.  
  806. Dim cmd As New OleDbCommand
  807. cmd = New OleDbCommand("Update Bag9 set ProductID = '" & GridProductIDTextBox.Text & "', ProductName = '" & GridProductNameTextBox.Text & "', CilentName = '" & GridCilentNameTextBox.Text & "', Status = '" & GridStatusComboBox.Text & "' where IDP like '" & GridBag9IDTextBox.Text & "'", con)
  808. con.Open()
  809. cmd.ExecuteNonQuery()
  810. con.Close()
  811.  
  812. End Sub
  813.  
  814.  
  815. Public Sub Update_Bag10()
  816.  
  817. Dim cmd As New OleDbCommand
  818. cmd = New OleDbCommand("Update Bag10 set ProductID = '" & GridProductIDTextBox.Text & "', ProductName = '" & GridProductNameTextBox.Text & "', CilentName = '" & GridCilentNameTextBox.Text & "', Status = '" & GridStatusComboBox.Text & "' where IDP like '" & GridBag10IDTextBox.Text & "'", con)
  819. con.Open()
  820. cmd.ExecuteNonQuery()
  821. con.Close()
  822.  
  823. End Sub
  824.  
  825.  
  826. Public Sub Update_Bag11()
  827.  
  828. Dim cmd As New OleDbCommand
  829. cmd = New OleDbCommand("Update Bag11 set ProductID = '" & GridProductIDTextBox.Text & "', ProductName = '" & GridProductNameTextBox.Text & "', CilentName = '" & GridCilentNameTextBox.Text & "', Status = '" & GridStatusComboBox.Text & "' where IDP like '" & GridBag11IDTextBox.Text & "'", con)
  830. con.Open()
  831. cmd.ExecuteNonQuery()
  832. con.Close()
  833.  
  834. End Sub
  835.  
  836.  
  837. Public Sub Update_Bag12()
  838.  
  839. Dim cmd As New OleDbCommand
  840. cmd = New OleDbCommand("Update Bag12 set ProductID = '" & GridProductIDTextBox.Text & "', ProductName = '" & GridProductNameTextBox.Text & "', CilentName = '" & GridCilentNameTextBox.Text & "', Status = '" & GridStatusComboBox.Text & "' where IDP like '" & GridBag12IDTextBox.Text & "'", con)
  841. con.Open()
  842. cmd.ExecuteNonQuery()
  843. con.Close()
  844.  
  845. End Sub
  846.  
  847. Public Sub Update_Bag13()
  848.  
  849. Dim cmd As New OleDbCommand
  850. cmd = New OleDbCommand("Update Bag13 set ProductID = '" & GridProductIDTextBox.Text & "', ProductName = '" & GridProductNameTextBox.Text & "', CilentName = '" & GridCilentNameTextBox.Text & "', Status = '" & GridStatusComboBox.Text & "' where IDP like '" & GridBag13IDTextBox.Text & "'", con)
  851. con.Open()
  852. cmd.ExecuteNonQuery()
  853. con.Close()
  854.  
  855. End Sub
  856.  
  857. Public Sub Update_Bag14()
  858.  
  859. Dim cmd As New OleDbCommand
  860. cmd = New OleDbCommand("Update Bag14 set ProductID = '" & GridProductIDTextBox.Text & "', ProductName = '" & GridProductNameTextBox.Text & "', CilentName = '" & GridCilentNameTextBox.Text & "', Status = '" & GridStatusComboBox.Text & "' where IDP like '" & GridBag14IDTextBox.Text & "'", con)
  861. con.Open()
  862. cmd.ExecuteNonQuery()
  863. con.Close()
  864.  
  865. End Sub
  866. '=========================================================================================================================================
  867. Public Sub Delete_Bag1()
  868.  
  869. Dim cmd As New OleDbCommand
  870.  
  871. cmd = New OleDbCommand(" Delete from Bag1 where IDP like '" & GridBag1IDTextBox.Text & "'", con)
  872. con.Open()
  873. cmd.ExecuteNonQuery()
  874. con.Close()
  875.  
  876. End Sub
  877.  
  878. Public Sub Delete_Bag2()
  879.  
  880. Dim cmd As New OleDbCommand
  881.  
  882. cmd = New OleDbCommand(" Delete from Bag2 where IDP like '" & GridBag2IDTextBox.Text & "'", con)
  883. con.Open()
  884. cmd.ExecuteNonQuery()
  885. con.Close()
  886.  
  887. End Sub
  888.  
  889. Public Sub Delete_Bag3()
  890.  
  891. Dim cmd As New OleDbCommand
  892.  
  893. cmd = New OleDbCommand(" Delete from Bag3 where IDP like '" & GridBag3IDTextBox.Text & "'", con)
  894. con.Open()
  895. cmd.ExecuteNonQuery()
  896. con.Close()
  897.  
  898. End Sub
  899.  
  900. Public Sub Delete_Bag4()
  901.  
  902. Dim cmd As New OleDbCommand
  903.  
  904. cmd = New OleDbCommand(" Delete from Bag4 where IDP like '" & GridBag4IDTextBox.Text & "'", con)
  905. con.Open()
  906. cmd.ExecuteNonQuery()
  907. con.Close()
  908.  
  909. End Sub
  910.  
  911. Public Sub Delete_Bag5()
  912.  
  913. Dim cmd As New OleDbCommand
  914.  
  915. cmd = New OleDbCommand(" Delete from Bag5 where IDP like '" & GridBag5IDTextBox.Text & "'", con)
  916. con.Open()
  917. cmd.ExecuteNonQuery()
  918. con.Close()
  919.  
  920. End Sub
  921.  
  922. Public Sub Delete_Bag6()
  923.  
  924. Dim cmd As New OleDbCommand
  925.  
  926. cmd = New OleDbCommand(" Delete from Bag6 where IDP like '" & GridBag6IDTextBox.Text & "'", con)
  927. con.Open()
  928. cmd.ExecuteNonQuery()
  929. con.Close()
  930.  
  931. End Sub
  932.  
  933. Public Sub Delete_Bag7()
  934.  
  935. Dim cmd As New OleDbCommand
  936.  
  937. cmd = New OleDbCommand(" Delete from Bag7 where IDP like '" & GridBag7IDTextBox.Text & "'", con)
  938. con.Open()
  939. cmd.ExecuteNonQuery()
  940. con.Close()
  941.  
  942. End Sub
  943.  
  944. Public Sub Delete_Bag8()
  945.  
  946. Dim cmd As New OleDbCommand
  947.  
  948. cmd = New OleDbCommand(" Delete from Bag8 where IDP like '" & GridBag8IDTextBox.Text & "'", con)
  949. con.Open()
  950. cmd.ExecuteNonQuery()
  951. con.Close()
  952.  
  953. End Sub
  954.  
  955. Public Sub Delete_Bag9()
  956.  
  957. Dim cmd As New OleDbCommand
  958.  
  959. cmd = New OleDbCommand(" Delete from Bag9 where IDP like '" & GridBag9IDTextBox.Text & "'", con)
  960. con.Open()
  961. cmd.ExecuteNonQuery()
  962. con.Close()
  963.  
  964. End Sub
  965.  
  966. Public Sub Delete_Bag10()
  967.  
  968. Dim cmd As New OleDbCommand
  969.  
  970. cmd = New OleDbCommand(" Delete from Bag10 where IDP like '" & GridBag10IDTextBox.Text & "'", con)
  971. con.Open()
  972. cmd.ExecuteNonQuery()
  973. con.Close()
  974.  
  975. End Sub
  976.  
  977.  
  978. Public Sub Delete_Bag11()
  979.  
  980. Dim cmd As New OleDbCommand
  981.  
  982. cmd = New OleDbCommand(" Delete from Bag11 where IDP like '" & GridBag11IDTextBox.Text & "'", con)
  983. con.Open()
  984. cmd.ExecuteNonQuery()
  985. con.Close()
  986.  
  987. End Sub
  988.  
  989. Public Sub Delete_Bag12()
  990.  
  991. Dim cmd As New OleDbCommand
  992.  
  993. cmd = New OleDbCommand(" Delete from Bag12 where IDP like '" & GridBag12IDTextBox.Text & "'", con)
  994. con.Open()
  995. cmd.ExecuteNonQuery()
  996. con.Close()
  997.  
  998. End Sub
  999.  
  1000. Public Sub Delete_Bag13()
  1001.  
  1002. Dim cmd As New OleDbCommand
  1003.  
  1004. cmd = New OleDbCommand(" Delete from Bag13 where IDP like '" & GridBag13IDTextBox.Text & "'", con)
  1005. con.Open()
  1006. cmd.ExecuteNonQuery()
  1007. con.Close()
  1008.  
  1009. End Sub
  1010.  
  1011. Public Sub Delete_Bag14()
  1012.  
  1013. Dim cmd As New OleDbCommand
  1014.  
  1015. cmd = New OleDbCommand(" Delete from Bag14 where IDP like '" & GridBag14IDTextBox.Text & "'", con)
  1016. con.Open()
  1017. cmd.ExecuteNonQuery()
  1018. con.Close()
  1019.  
  1020. End Sub
  1021.  
  1022. Private Sub BagsComboBox_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BagsComboBox.TextChanged
  1023.  
  1024. If BagsComboBox.Text = "Bag1" Then
  1025.  
  1026. New_Product()
  1027.  
  1028.  
  1029. ElseIf BagsComboBox.Text = "Bag2" Then
  1030. New_Product()
  1031.  
  1032. ElseIf BagsComboBox.Text = "Bag3" Then
  1033. New_Product()
  1034.  
  1035. ElseIf BagsComboBox.Text = "Bag4" Then
  1036. New_Product()
  1037.  
  1038. ElseIf BagsComboBox.Text = "Bag5" Then
  1039. New_Product()
  1040.  
  1041. ElseIf BagsComboBox.Text = "Bag6" Then
  1042. New_Product()
  1043.  
  1044. ElseIf BagsComboBox.Text = "Bag7" Then
  1045. New_Product()
  1046.  
  1047. ElseIf BagsComboBox.Text = "Bag8" Then
  1048. New_Product()
  1049.  
  1050. ElseIf BagsComboBox.Text = "Bag9" Then
  1051. New_Product()
  1052.  
  1053. ElseIf BagsComboBox.Text = "Bag10" Then
  1054. New_Product()
  1055.  
  1056. ElseIf BagsComboBox.Text = "Bag11" Then
  1057. New_Product()
  1058.  
  1059. ElseIf BagsComboBox.Text = "Bag12" Then
  1060. New_Product()
  1061.  
  1062. ElseIf BagsComboBox.Text = "Bag13" Then
  1063. New_Product()
  1064.  
  1065. ElseIf BagsComboBox.Text = "Bag14" Then
  1066. New_Product()
  1067. End If
  1068. End Sub
  1069.  
  1070. Private Sub SaveBtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SaveBtn.Click
  1071. If CilentNameTextBox.Text = "" Or ProductIDTextBox.Text = "" Or ProductNameTextBox.Text = "" Then
  1072. Dim show1 As New mb.ShowMessagebox
  1073. show1.Fonts(New Font("Modern No. 20", 15, FontStyle.Bold), mb.TextColor.Red)
  1074. show1.ShowBox(" Please Fill Up all Fields! ", mb.MStyle.ok, mb.FStyle.Critical, "Confrim")
  1075. Else
  1076. If BagsComboBox.Text = "Bag1" Then
  1077. Bag1_Insert()
  1078. New_Product()
  1079. End If
  1080.  
  1081. If BagsComboBox.Text = "Bag2" Then
  1082. Bag2_Insert()
  1083. New_Product()
  1084. End If
  1085.  
  1086. If BagsComboBox.Text = "Bag3" Then
  1087. Bag3_Insert()
  1088. New_Product()
  1089. End If
  1090.  
  1091. If BagsComboBox.Text = "Bag4" Then
  1092. Bag4_Insert()
  1093. New_Product()
  1094. End If
  1095.  
  1096. If BagsComboBox.Text = "Bag5" Then
  1097. Bag5_Insert()
  1098. New_Product()
  1099. End If
  1100.  
  1101. If BagsComboBox.Text = "Bag6" Then
  1102. Bag6_Insert()
  1103. New_Product()
  1104. End If
  1105.  
  1106. If BagsComboBox.Text = "Bag7" Then
  1107. Bag7_Insert()
  1108. New_Product()
  1109. End If
  1110.  
  1111. If BagsComboBox.Text = "Bag8" Then
  1112. Bag8_Insert()
  1113. New_Product()
  1114. End If
  1115.  
  1116. If BagsComboBox.Text = "Bag9" Then
  1117. Bag9_Insert()
  1118. New_Product()
  1119. End If
  1120.  
  1121. If BagsComboBox.Text = "Bag10" Then
  1122. Bag10_Insert()
  1123. New_Product()
  1124. End If
  1125.  
  1126.  
  1127. If BagsComboBox.Text = "Bag11" Then
  1128. Bag11_Insert()
  1129. New_Product()
  1130. End If
  1131.  
  1132. If BagsComboBox.Text = "Bag12" Then
  1133. Bag12_Insert()
  1134. New_Product()
  1135. End If
  1136.  
  1137. If BagsComboBox.Text = "Bag13" Then
  1138. Bag13_Insert()
  1139. New_Product()
  1140. End If
  1141.  
  1142. If BagsComboBox.Text = "Bag14" Then
  1143. Bag13_Insert()
  1144. New_Product()
  1145. End If
  1146. End If
  1147. End Sub
  1148.  
  1149. Private Sub DataGridView1_CellEnter(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView1.CellEnter
  1150.  
  1151. If BagsComboBox.Text = "Bag1" Then
  1152. GridBag1IDTextBox.Text = DataGridView1.CurrentRow.Cells(0).Value
  1153. GridProductIDTextBox.Text = DataGridView1.CurrentRow.Cells(1).Value
  1154. GridProductNameTextBox.Text = DataGridView1.CurrentRow.Cells(2).Value
  1155. GridCilentNameTextBox.Text = DataGridView1.CurrentRow.Cells(3).Value
  1156. GridStatusComboBox.Text = DataGridView1.CurrentRow.Cells(4).Value
  1157. End If
  1158.  
  1159. If BagsComboBox.Text = "Bag2" Then
  1160. GridBag2IDTextBox.Text = DataGridView1.CurrentRow.Cells(0).Value
  1161. GridProductIDTextBox.Text = DataGridView1.CurrentRow.Cells(1).Value
  1162. GridProductNameTextBox.Text = DataGridView1.CurrentRow.Cells(2).Value
  1163. GridCilentNameTextBox.Text = DataGridView1.CurrentRow.Cells(3).Value
  1164. GridStatusComboBox.Text = DataGridView1.CurrentRow.Cells(4).Value
  1165. End If
  1166.  
  1167. If BagsComboBox.Text = "Bag3" Then
  1168. GridBag3IDTextBox.Text = DataGridView1.CurrentRow.Cells(0).Value
  1169. GridProductIDTextBox.Text = DataGridView1.CurrentRow.Cells(1).Value
  1170. GridProductNameTextBox.Text = DataGridView1.CurrentRow.Cells(2).Value
  1171. GridCilentNameTextBox.Text = DataGridView1.CurrentRow.Cells(3).Value
  1172. GridStatusComboBox.Text = DataGridView1.CurrentRow.Cells(4).Value
  1173. End If
  1174.  
  1175. If BagsComboBox.Text = "Bag4" Then
  1176. GridBag4IDTextBox.Text = DataGridView1.CurrentRow.Cells(0).Value
  1177. GridProductIDTextBox.Text = DataGridView1.CurrentRow.Cells(1).Value
  1178. GridProductNameTextBox.Text = DataGridView1.CurrentRow.Cells(2).Value
  1179. GridCilentNameTextBox.Text = DataGridView1.CurrentRow.Cells(3).Value
  1180. GridStatusComboBox.Text = DataGridView1.CurrentRow.Cells(4).Value
  1181. End If
  1182.  
  1183. If BagsComboBox.Text = "Bag5" Then
  1184. GridBag5IDTextBox.Text = DataGridView1.CurrentRow.Cells(0).Value
  1185. GridProductIDTextBox.Text = DataGridView1.CurrentRow.Cells(1).Value
  1186. GridProductNameTextBox.Text = DataGridView1.CurrentRow.Cells(2).Value
  1187. GridCilentNameTextBox.Text = DataGridView1.CurrentRow.Cells(3).Value
  1188. GridStatusComboBox.Text = DataGridView1.CurrentRow.Cells(4).Value
  1189. End If
  1190.  
  1191. If BagsComboBox.Text = "Bag6" Then
  1192. GridBag6IDTextBox.Text = DataGridView1.CurrentRow.Cells(0).Value
  1193. GridProductIDTextBox.Text = DataGridView1.CurrentRow.Cells(1).Value
  1194. GridProductNameTextBox.Text = DataGridView1.CurrentRow.Cells(2).Value
  1195. GridCilentNameTextBox.Text = DataGridView1.CurrentRow.Cells(3).Value
  1196. GridStatusComboBox.Text = DataGridView1.CurrentRow.Cells(4).Value
  1197. End If
  1198.  
  1199. If BagsComboBox.Text = "Bag7" Then
  1200. GridBag7IDTextBox.Text = DataGridView1.CurrentRow.Cells(0).Value
  1201. GridProductIDTextBox.Text = DataGridView1.CurrentRow.Cells(1).Value
  1202. GridProductNameTextBox.Text = DataGridView1.CurrentRow.Cells(2).Value
  1203. GridCilentNameTextBox.Text = DataGridView1.CurrentRow.Cells(3).Value
  1204. GridStatusComboBox.Text = DataGridView1.CurrentRow.Cells(4).Value
  1205. End If
  1206.  
  1207. If BagsComboBox.Text = "Bag8" Then
  1208. GridBag8IDTextBox.Text = DataGridView1.CurrentRow.Cells(0).Value
  1209. GridProductIDTextBox.Text = DataGridView1.CurrentRow.Cells(1).Value
  1210. GridProductNameTextBox.Text = DataGridView1.CurrentRow.Cells(2).Value
  1211. GridCilentNameTextBox.Text = DataGridView1.CurrentRow.Cells(3).Value
  1212. GridStatusComboBox.Text = DataGridView1.CurrentRow.Cells(4).Value
  1213. End If
  1214.  
  1215. If BagsComboBox.Text = "Bag9" Then
  1216. GridBag9IDTextBox.Text = DataGridView1.CurrentRow.Cells(0).Value
  1217. GridProductIDTextBox.Text = DataGridView1.CurrentRow.Cells(1).Value
  1218. GridProductNameTextBox.Text = DataGridView1.CurrentRow.Cells(2).Value
  1219. GridCilentNameTextBox.Text = DataGridView1.CurrentRow.Cells(3).Value
  1220. GridStatusComboBox.Text = DataGridView1.CurrentRow.Cells(4).Value
  1221. End If
  1222.  
  1223.  
  1224. If BagsComboBox.Text = "Bag10" Then
  1225. GridBag10IDTextBox.Text = DataGridView1.CurrentRow.Cells(0).Value
  1226. GridProductIDTextBox.Text = DataGridView1.CurrentRow.Cells(1).Value
  1227. GridProductNameTextBox.Text = DataGridView1.CurrentRow.Cells(2).Value
  1228. GridCilentNameTextBox.Text = DataGridView1.CurrentRow.Cells(3).Value
  1229. GridStatusComboBox.Text = DataGridView1.CurrentRow.Cells(4).Value
  1230. End If
  1231.  
  1232. If BagsComboBox.Text = "Bag11" Then
  1233. GridBag11IDTextBox.Text = DataGridView1.CurrentRow.Cells(0).Value
  1234. GridProductIDTextBox.Text = DataGridView1.CurrentRow.Cells(1).Value
  1235. GridProductNameTextBox.Text = DataGridView1.CurrentRow.Cells(2).Value
  1236. GridCilentNameTextBox.Text = DataGridView1.CurrentRow.Cells(3).Value
  1237. GridStatusComboBox.Text = DataGridView1.CurrentRow.Cells(4).Value
  1238. End If
  1239.  
  1240. If BagsComboBox.Text = "Bag12" Then
  1241. GridBag12IDTextBox.Text = DataGridView1.CurrentRow.Cells(0).Value
  1242. GridProductIDTextBox.Text = DataGridView1.CurrentRow.Cells(1).Value
  1243. GridProductNameTextBox.Text = DataGridView1.CurrentRow.Cells(2).Value
  1244. GridCilentNameTextBox.Text = DataGridView1.CurrentRow.Cells(3).Value
  1245. GridStatusComboBox.Text = DataGridView1.CurrentRow.Cells(4).Value
  1246. End If
  1247.  
  1248. If BagsComboBox.Text = "Bag13" Then
  1249. GridBag13IDTextBox.Text = DataGridView1.CurrentRow.Cells(0).Value
  1250. GridProductIDTextBox.Text = DataGridView1.CurrentRow.Cells(1).Value
  1251. GridProductNameTextBox.Text = DataGridView1.CurrentRow.Cells(2).Value
  1252. GridCilentNameTextBox.Text = DataGridView1.CurrentRow.Cells(3).Value
  1253. GridStatusComboBox.Text = DataGridView1.CurrentRow.Cells(4).Value
  1254. End If
  1255.  
  1256. If BagsComboBox.Text = "Bag14" Then
  1257. GridBag14IDTextBox.Text = DataGridView1.CurrentRow.Cells(0).Value
  1258. GridProductIDTextBox.Text = DataGridView1.CurrentRow.Cells(1).Value
  1259. GridProductNameTextBox.Text = DataGridView1.CurrentRow.Cells(2).Value
  1260. GridCilentNameTextBox.Text = DataGridView1.CurrentRow.Cells(3).Value
  1261. GridStatusComboBox.Text = DataGridView1.CurrentRow.Cells(4).Value
  1262. End If
  1263. End Sub
  1264.  
  1265. Private Sub UpdateBtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles UpdateBtn.Click
  1266. If GridCilentNameTextBox.Text = "" Or GridProductIDTextBox.Text = "" Or GridProductNameTextBox.Text = "" Or GridStatusComboBox.Text = "" Then
  1267. Dim show1 As New mb.ShowMessagebox
  1268. show1.Fonts(New Font("Modern No. 20", 15, FontStyle.Bold), mb.TextColor.Red)
  1269. show1.ShowBox(" Please Fill Up all Fields! ", mb.MStyle.ok, mb.FStyle.Critical, "Confrim")
  1270. Else
  1271.  
  1272. If BagsComboBox.Text = "Bag1" Then
  1273. Update_Bag1()
  1274. New_Product()
  1275. End If
  1276.  
  1277. If BagsComboBox.Text = "Bag2" Then
  1278. Update_Bag2()
  1279. New_Product()
  1280. End If
  1281.  
  1282. If BagsComboBox.Text = "Bag3" Then
  1283. Update_Bag3()
  1284. New_Product()
  1285. End If
  1286.  
  1287. If BagsComboBox.Text = "Bag4" Then
  1288. Update_Bag4()
  1289. New_Product()
  1290. End If
  1291.  
  1292. If BagsComboBox.Text = "Bag5" Then
  1293. Update_Bag5()
  1294. New_Product()
  1295. End If
  1296.  
  1297. If BagsComboBox.Text = "Bag6" Then
  1298. Update_Bag6()
  1299. New_Product()
  1300. End If
  1301.  
  1302. If BagsComboBox.Text = "Bag7" Then
  1303. Update_Bag7()
  1304. New_Product()
  1305. End If
  1306.  
  1307. If BagsComboBox.Text = "Bag8" Then
  1308. Update_Bag8()
  1309. New_Product()
  1310. End If
  1311.  
  1312. If BagsComboBox.Text = "Bag9" Then
  1313. Update_Bag9()
  1314. New_Product()
  1315. End If
  1316.  
  1317. If BagsComboBox.Text = "Bag10" Then
  1318. Update_Bag10()
  1319. New_Product()
  1320. End If
  1321.  
  1322. If BagsComboBox.Text = "Bag11" Then
  1323. Update_Bag11()
  1324. New_Product()
  1325. End If
  1326.  
  1327. If BagsComboBox.Text = "Bag12" Then
  1328. Update_Bag12()
  1329. New_Product()
  1330. End If
  1331.  
  1332. If BagsComboBox.Text = "Bag13" Then
  1333. Update_Bag13()
  1334. New_Product()
  1335. End If
  1336.  
  1337. If BagsComboBox.Text = "Bag14" Then
  1338. Update_Bag14()
  1339. New_Product()
  1340. End If
  1341. End If
  1342. End Sub
  1343.  
  1344. Private Sub DeleteBtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DeleteBtn.Click
  1345. If GridCilentNameTextBox.Text = "" Or GridProductIDTextBox.Text = "" Or GridProductNameTextBox.Text = "" Or GridStatusComboBox.Text = "" Then
  1346. Dim show1 As New mb.ShowMessagebox
  1347. show1.Fonts(New Font("Modern No. 20", 15, FontStyle.Bold), mb.TextColor.Red)
  1348. show1.ShowBox(" Please Fill Up all Fields! ", mb.MStyle.ok, mb.FStyle.Critical, "Confrim")
  1349. Else
  1350.  
  1351. If BagsComboBox.Text = "Bag1" Then
  1352. Delete_Bag1()
  1353. New_Product()
  1354. End If
  1355.  
  1356. If BagsComboBox.Text = "Bag2" Then
  1357. Delete_Bag2()
  1358. New_Product()
  1359. End If
  1360.  
  1361. If BagsComboBox.Text = "Bag3" Then
  1362. Delete_Bag3()
  1363. New_Product()
  1364. End If
  1365.  
  1366. If BagsComboBox.Text = "Bag4" Then
  1367. Delete_Bag4()
  1368. New_Product()
  1369. End If
  1370.  
  1371. If BagsComboBox.Text = "Bag5" Then
  1372. Delete_Bag5()
  1373. New_Product()
  1374. End If
  1375.  
  1376. If BagsComboBox.Text = "Bag6" Then
  1377. Delete_Bag6()
  1378. New_Product()
  1379. End If
  1380.  
  1381. If BagsComboBox.Text = "Bag7" Then
  1382. Delete_Bag7()
  1383. New_Product()
  1384. End If
  1385.  
  1386. If BagsComboBox.Text = "Bag8" Then
  1387. Delete_Bag8()
  1388. New_Product()
  1389. End If
  1390.  
  1391. If BagsComboBox.Text = "Bag9" Then
  1392. Delete_Bag9()
  1393. New_Product()
  1394. End If
  1395.  
  1396. If BagsComboBox.Text = "Bag10" Then
  1397. Delete_Bag10()
  1398. New_Product()
  1399. End If
  1400.  
  1401. If BagsComboBox.Text = "Bag11" Then
  1402. Delete_Bag11()
  1403. New_Product()
  1404. End If
  1405.  
  1406. If BagsComboBox.Text = "Bag12" Then
  1407. Delete_Bag12()
  1408. New_Product()
  1409. End If
  1410.  
  1411. If BagsComboBox.Text = "Bag13" Then
  1412. Delete_Bag13()
  1413. New_Product()
  1414. End If
  1415.  
  1416. If BagsComboBox.Text = "Bag14" Then
  1417. Delete_Bag14()
  1418. New_Product()
  1419. End If
  1420. End If
  1421. End Sub
  1422.  
  1423. Private Sub ResetBtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ResetBtn.Click
  1424.  
  1425. If BagsComboBox.Text = "Bag1" Then
  1426. Bag1Page_GridView()
  1427. End If
  1428.  
  1429. If BagsComboBox.Text = "Bag2" Then
  1430. Bag2Page_GridView()
  1431. End If
  1432.  
  1433. If BagsComboBox.Text = "Bag3" Then
  1434. Bag3Page_GridView()
  1435. End If
  1436.  
  1437. If BagsComboBox.Text = "Bag4" Then
  1438. Bag4Page_GridView()
  1439. End If
  1440.  
  1441. If BagsComboBox.Text = "Bag5" Then
  1442. Bag5Page_GridView()
  1443. End If
  1444.  
  1445. If BagsComboBox.Text = "Bag6" Then
  1446. Bag6Page_GridView()
  1447. End If
  1448.  
  1449. If BagsComboBox.Text = "Bag7" Then
  1450. Bag7Page_GridView()
  1451. End If
  1452.  
  1453. If BagsComboBox.Text = "Bag8" Then
  1454. Bag8Page_GridView()
  1455. End If
  1456.  
  1457. If BagsComboBox.Text = "Bag9" Then
  1458. Bag9Page_GridView()
  1459. End If
  1460.  
  1461. If BagsComboBox.Text = "Bag10" Then
  1462. Bag10Page_GridView()
  1463. End If
  1464.  
  1465. If BagsComboBox.Text = "Bag11" Then
  1466. Bag11Page_GridView()
  1467. End If
  1468.  
  1469. If BagsComboBox.Text = "Bag12" Then
  1470. Bag12Page_GridView()
  1471. End If
  1472.  
  1473. If BagsComboBox.Text = "Bag13" Then
  1474. Bag13Page_GridView()
  1475. End If
  1476.  
  1477. If BagsComboBox.Text = "Bag14" Then
  1478. Bag14Page_GridView()
  1479. End If
  1480. End Sub
  1481.  
  1482. Private Sub SearchBtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SearchBtn.Click
  1483. If ProductNameCheckBox.Checked = True Then
  1484.  
  1485. If BagsComboBox.Text = "Bag1" Then
  1486.  
  1487. Dim daz As New OleDbDataAdapter
  1488. Dim dbDataSet As New DataTable
  1489. Dim dsz As New DataSet
  1490. dsz.Tables.Add(dbDataSet)
  1491.  
  1492. daz = New OleDbDataAdapter("SELECT Bag1.IDP AS ID, Bag1.ProductID, Bag1.ProductName, Bag1.CilentName, Bag1.Status FROM Bag1", con)
  1493. daz.Fill(dbDataSet)
  1494.  
  1495. Dim DV As New DataView(dbDataSet)
  1496. DV.RowFilter = String.Format("ProductName Like '%{0}%'", SearchTextBox.Text)
  1497. DataGridView1.DataSource = DV
  1498.  
  1499. End If
  1500.  
  1501. If BagsComboBox.Text = "Bag2" Then
  1502.  
  1503. Dim daz As New OleDbDataAdapter
  1504. Dim dbDataSet As New DataTable
  1505. Dim dsz As New DataSet
  1506. dsz.Tables.Add(dbDataSet)
  1507.  
  1508. daz = New OleDbDataAdapter("SELECT Bag2.IDP AS ID, Bag2.ProductID, Bag2.ProductName, Bag2.CilentName, Bag2.Status FROM Bag2", con)
  1509. daz.Fill(dbDataSet)
  1510.  
  1511. Dim DV As New DataView(dbDataSet)
  1512. DV.RowFilter = String.Format("ProductName Like '%{0}%'", SearchTextBox.Text)
  1513. DataGridView1.DataSource = DV
  1514.  
  1515. End If
  1516.  
  1517. If BagsComboBox.Text = "Bag3" Then
  1518.  
  1519. Dim daz As New OleDbDataAdapter
  1520. Dim dbDataSet As New DataTable
  1521. Dim dsz As New DataSet
  1522. dsz.Tables.Add(dbDataSet)
  1523.  
  1524. daz = New OleDbDataAdapter("SELECT Bag3.IDP AS ID, Bag3.ProductID, Bag3.ProductName, Bag3.CilentName, Bag3.Status FROM Bag3", con)
  1525. daz.Fill(dbDataSet)
  1526.  
  1527. Dim DV As New DataView(dbDataSet)
  1528. DV.RowFilter = String.Format("ProductName Like '%{0}%'", SearchTextBox.Text)
  1529. DataGridView1.DataSource = DV
  1530.  
  1531. End If
  1532.  
  1533. If BagsComboBox.Text = "Bag4" Then
  1534.  
  1535. Dim daz As New OleDbDataAdapter
  1536. Dim dbDataSet As New DataTable
  1537. Dim dsz As New DataSet
  1538. dsz.Tables.Add(dbDataSet)
  1539.  
  1540. daz = New OleDbDataAdapter("SELECT Bag4.IDP AS ID, Bag4.ProductID, Bag4.ProductName, Bag4.CilentName, Bag4.Status FROM Bag4", con)
  1541. daz.Fill(dbDataSet)
  1542.  
  1543. Dim DV As New DataView(dbDataSet)
  1544. DV.RowFilter = String.Format("ProductName Like '%{0}%'", SearchTextBox.Text)
  1545. DataGridView1.DataSource = DV
  1546.  
  1547. End If
  1548.  
  1549. If BagsComboBox.Text = "Bag5" Then
  1550.  
  1551. Dim daz As New OleDbDataAdapter
  1552. Dim dbDataSet As New DataTable
  1553. Dim dsz As New DataSet
  1554. dsz.Tables.Add(dbDataSet)
  1555.  
  1556. daz = New OleDbDataAdapter("SELECT Bag5.IDP AS ID, Bag5.ProductID, Bag5.ProductName, Bag5.CilentName, Bag5.Status FROM Bag5", con)
  1557. daz.Fill(dbDataSet)
  1558.  
  1559. Dim DV As New DataView(dbDataSet)
  1560. DV.RowFilter = String.Format("ProductName Like '%{0}%'", SearchTextBox.Text)
  1561. DataGridView1.DataSource = DV
  1562.  
  1563. End If
  1564.  
  1565. If BagsComboBox.Text = "Bag6" Then
  1566.  
  1567. Dim daz As New OleDbDataAdapter
  1568. Dim dbDataSet As New DataTable
  1569. Dim dsz As New DataSet
  1570. dsz.Tables.Add(dbDataSet)
  1571.  
  1572. daz = New OleDbDataAdapter("SELECT Bag6.IDP AS ID, Bag6.ProductID, Bag6.ProductName, Bag6.CilentName, Bag6.Status FROM Bag6", con)
  1573. daz.Fill(dbDataSet)
  1574.  
  1575. Dim DV As New DataView(dbDataSet)
  1576. DV.RowFilter = String.Format("ProductName Like '%{0}%'", SearchTextBox.Text)
  1577. DataGridView1.DataSource = DV
  1578.  
  1579. End If
  1580.  
  1581. If BagsComboBox.Text = "Bag7" Then
  1582.  
  1583. Dim daz As New OleDbDataAdapter
  1584. Dim dbDataSet As New DataTable
  1585. Dim dsz As New DataSet
  1586. dsz.Tables.Add(dbDataSet)
  1587.  
  1588. daz = New OleDbDataAdapter("SELECT Bag7.IDP AS ID, Bag7.ProductID, Bag7.ProductName, Bag7.CilentName, Bag7.Status FROM Bag7", con)
  1589. daz.Fill(dbDataSet)
  1590.  
  1591. Dim DV As New DataView(dbDataSet)
  1592. DV.RowFilter = String.Format("ProductName Like '%{0}%'", SearchTextBox.Text)
  1593. DataGridView1.DataSource = DV
  1594.  
  1595. End If
  1596.  
  1597. If BagsComboBox.Text = "Bag8" Then
  1598.  
  1599. Dim daz As New OleDbDataAdapter
  1600. Dim dbDataSet As New DataTable
  1601. Dim dsz As New DataSet
  1602. dsz.Tables.Add(dbDataSet)
  1603.  
  1604. daz = New OleDbDataAdapter("SELECT Bag8.IDP AS ID, Bag8.ProductID, Bag8.ProductName, Bag8.CilentName, Bag8.Status FROM Bag8", con)
  1605. daz.Fill(dbDataSet)
  1606.  
  1607. Dim DV As New DataView(dbDataSet)
  1608. DV.RowFilter = String.Format("ProductName Like '%{0}%'", SearchTextBox.Text)
  1609. DataGridView1.DataSource = DV
  1610.  
  1611. End If
  1612.  
  1613. If BagsComboBox.Text = "Bag9" Then
  1614.  
  1615. Dim daz As New OleDbDataAdapter
  1616. Dim dbDataSet As New DataTable
  1617. Dim dsz As New DataSet
  1618. dsz.Tables.Add(dbDataSet)
  1619.  
  1620. daz = New OleDbDataAdapter("SELECT Bag9.IDP AS ID, Bag9.ProductID, Bag9.ProductName, Bag9.CilentName, Bag9.Status FROM Bag9", con)
  1621. daz.Fill(dbDataSet)
  1622.  
  1623. Dim DV As New DataView(dbDataSet)
  1624. DV.RowFilter = String.Format("ProductName Like '%{0}%'", SearchTextBox.Text)
  1625. DataGridView1.DataSource = DV
  1626.  
  1627. End If
  1628.  
  1629.  
  1630. If BagsComboBox.Text = "Bag10" Then
  1631.  
  1632. Dim daz As New OleDbDataAdapter
  1633. Dim dbDataSet As New DataTable
  1634. Dim dsz As New DataSet
  1635. dsz.Tables.Add(dbDataSet)
  1636.  
  1637. daz = New OleDbDataAdapter("SELECT Bag10.IDP AS ID, Bag10.ProductID, Bag10.ProductName, Bag10.CilentName, Bag10.Status FROM Bag10", con)
  1638. daz.Fill(dbDataSet)
  1639.  
  1640. Dim DV As New DataView(dbDataSet)
  1641. DV.RowFilter = String.Format("ProductName Like '%{0}%'", SearchTextBox.Text)
  1642. DataGridView1.DataSource = DV
  1643.  
  1644. End If
  1645.  
  1646. If BagsComboBox.Text = "Bag11" Then
  1647.  
  1648. Dim daz As New OleDbDataAdapter
  1649. Dim dbDataSet As New DataTable
  1650. Dim dsz As New DataSet
  1651. dsz.Tables.Add(dbDataSet)
  1652.  
  1653. daz = New OleDbDataAdapter("SELECT Bag11.IDP AS ID, Bag11.ProductID, Bag11.ProductName, Bag11.CilentName, Bag11.Status FROM Bag11", con)
  1654. daz.Fill(dbDataSet)
  1655.  
  1656. Dim DV As New DataView(dbDataSet)
  1657. DV.RowFilter = String.Format("ProductName Like '%{0}%'", SearchTextBox.Text)
  1658. DataGridView1.DataSource = DV
  1659.  
  1660. End If
  1661.  
  1662. If BagsComboBox.Text = "Bag12" Then
  1663.  
  1664. Dim daz As New OleDbDataAdapter
  1665. Dim dbDataSet As New DataTable
  1666. Dim dsz As New DataSet
  1667. dsz.Tables.Add(dbDataSet)
  1668.  
  1669. daz = New OleDbDataAdapter("SELECT Bag12.IDP AS ID, Bag12.ProductID, Bag12.ProductName, Bag12.CilentName, Bag12.Status FROM Bag12", con)
  1670. daz.Fill(dbDataSet)
  1671.  
  1672. Dim DV As New DataView(dbDataSet)
  1673. DV.RowFilter = String.Format("ProductName Like '%{0}%'", SearchTextBox.Text)
  1674. DataGridView1.DataSource = DV
  1675.  
  1676. End If
  1677.  
  1678. If BagsComboBox.Text = "Bag13" Then
  1679.  
  1680. Dim daz As New OleDbDataAdapter
  1681. Dim dbDataSet As New DataTable
  1682. Dim dsz As New DataSet
  1683. dsz.Tables.Add(dbDataSet)
  1684.  
  1685. daz = New OleDbDataAdapter("SELECT Bag13.IDP AS ID, Bag13.ProductID, Bag13.ProductName, Bag13.CilentName, Bag13.Status FROM Bag13", con)
  1686. daz.Fill(dbDataSet)
  1687.  
  1688. Dim DV As New DataView(dbDataSet)
  1689. DV.RowFilter = String.Format("ProductName Like '%{0}%'", SearchTextBox.Text)
  1690. DataGridView1.DataSource = DV
  1691.  
  1692. End If
  1693.  
  1694. If BagsComboBox.Text = "Bag14" Then
  1695.  
  1696. Dim daz As New OleDbDataAdapter
  1697. Dim dbDataSet As New DataTable
  1698. Dim dsz As New DataSet
  1699. dsz.Tables.Add(dbDataSet)
  1700.  
  1701. daz = New OleDbDataAdapter("SELECT Bag14.IDP AS ID, Bag14.ProductID, Bag14.ProductName, Bag14.CilentName, Bag14.Status FROM Bag14", con)
  1702. daz.Fill(dbDataSet)
  1703.  
  1704. Dim DV As New DataView(dbDataSet)
  1705. DV.RowFilter = String.Format("ProductName Like '%{0}%'", SearchTextBox.Text)
  1706. DataGridView1.DataSource = DV
  1707.  
  1708. End If
  1709. End If
  1710.  
  1711.  
  1712.  
  1713.  
  1714. End Sub
  1715.  
  1716. Private Sub DataGridView1_CellFormatting(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellFormattingEventArgs) Handles DataGridView1.CellFormatting
  1717. If DataGridView1.Rows.Count > 0 Then
  1718. For i As Integer = 0 To DataGridView1.Rows.Count - 1
  1719. For j As Integer = 0 To DataGridView1.Columns.Count - 1
  1720. Dim CellChange As String = DataGridView1.Rows(i).Cells(j).Value.ToString().Trim()
  1721. If CellChange.Contains("DONE") = True Then
  1722.  
  1723. With DataGridView1
  1724. .Rows(i).Cells(j).Style.BackColor = Color.Lime
  1725. .Rows(i).Cells(j).Style.ForeColor = Color.White
  1726. End With
  1727.  
  1728. End If
  1729. If CellChange.Contains("UNDONE") = True Then
  1730.  
  1731. With DataGridView1
  1732. .Rows(i).Cells(j).Style.BackColor = Color.DeepPink
  1733. .Rows(i).Cells(j).Style.ForeColor = Color.White
  1734. End With
  1735.  
  1736. End If
  1737. If CellChange.Contains("AWAITING") = True Then
  1738.  
  1739. With DataGridView1
  1740. .Rows(i).Cells(j).Style.BackColor = Color.Gold
  1741. .Rows(i).Cells(j).Style.ForeColor = Color.White
  1742. End With
  1743.  
  1744. End If
  1745. Next
  1746. Next
  1747. End If
  1748. End Sub
  1749.  
  1750. Private Sub BagsComboBox_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BagsComboBox.SelectedIndexChanged
  1751.  
  1752. End Sub
  1753. End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement