Нет описания
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. Imports System.Data.SqlClient
  2. Public Class FrmStaff
  3. Dim cmd As New SqlCommand
  4. Private Sub FrmStaff_Load(sender As Object, e As EventArgs) Handles MyBase.Load
  5. Dim conn As New SqlConnection
  6. Dim DT1 As New DataTable
  7. Dim DT2 As New DataTable
  8. Dim DT3 As New DataTable
  9. conn.ConnectionString = connstring
  10. conn.Open()
  11. cmd.Connection = conn
  12. Dim sql As String
  13. Dim da As New SqlDataAdapter
  14. Dim dt As New DataTable
  15. Me.MdiParent = FrmMDI
  16. If conn.State = ConnectionState.Closed Then
  17. conn.ConnectionString = connstring
  18. conn.Open()
  19. End If
  20. sql = "select * from tblstaff order by staff_id"
  21. cmd.CommandText = Sql
  22. da.SelectCommand = cmd
  23. da.Fill(dt)
  24. DGV1.DataSource = dt
  25. set_grid()
  26. conn.Close()
  27. End Sub
  28. Private Sub set_grid()
  29. For x As Integer = 3 To DGV1.Columns.Count - 1
  30. DGV1.Columns(x).Visible = False
  31. Next
  32. DGV1.RowHeadersWidth = 5
  33. DGV1.Columns(0).Width = 100
  34. End Sub
  35. Private Sub DGV1_CellClick(sender As Object, e As DataGridViewCellEventArgs) Handles DGV1.CellClick
  36. TextBox1.Text = DGV1.Rows(e.RowIndex).Cells("name").Value.ToString
  37. TextBox2.Text = DGV1.Rows(e.RowIndex).Cells("Staff_id").Value
  38. TextBox3.Text = DGV1.Rows(e.RowIndex).Cells("pw").Value
  39. chkSales.Checked = DGV1.Rows(e.RowIndex).Cells("con1").Value
  40. chkOrder.Checked = DGV1.Rows(e.RowIndex).Cells("con2").Value
  41. chkOrderControl.Checked = DGV1.Rows(e.RowIndex).Cells("con3").Value
  42. chkCFMorder.Checked = DGV1.Rows(e.RowIndex).Cells("con4").Value
  43. chkQuation.Checked = DGV1.Rows(e.RowIndex).Cells("con5").Value
  44. chkOrderEditRecord.Checked = DGV1.Rows(e.RowIndex).Cells("con6").Value
  45. chkOrderRecord.Checked = DGV1.Rows(e.RowIndex).Cells("con7").Value
  46. chkShip.Checked = DGV1.Rows(e.RowIndex).Cells("con8").Value
  47. chkShipCFM.Checked = DGV1.Rows(e.RowIndex).Cells("con9").Value
  48. chkShipPrint.Checked = DGV1.Rows(e.RowIndex).Cells("con10").Value
  49. chkShipEdit.Checked = DGV1.Rows(e.RowIndex).Cells("con11").Value
  50. chkShipped.Checked = DGV1.Rows(e.RowIndex).Cells("con12").Value
  51. chkShippedEditRecord.Checked = DGV1.Rows(e.RowIndex).Cells("con13").Value
  52. chkShipped1.Checked = DGV1.Rows(e.RowIndex).Cells("con14").Value
  53. chkChemical.Checked = DGV1.Rows(e.RowIndex).Cells("con15").Value
  54. chkRecipe.Checked = DGV1.Rows(e.RowIndex).Cells("con16").Value
  55. chkLeather.Checked = DGV1.Rows(e.RowIndex).Cells("con17").Value
  56. chkRawhide.Checked = DGV1.Rows(e.RowIndex).Cells("con18").Value
  57. chkWetblue.Checked = DGV1.Rows(e.RowIndex).Cells("con19").Value
  58. chkCrustFinish.Checked = DGV1.Rows(e.RowIndex).Cells("con20").Value
  59. chkReport.Checked = DGV1.Rows(e.RowIndex).Cells("con21").Value
  60. chkSystem.Checked = DGV1.Rows(e.RowIndex).Cells("con22").Value
  61. chkOther.Checked = DGV1.Rows(e.RowIndex).Cells("con23").Value
  62. End Sub
  63. End Class