暫無描述
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

人員明細表.vb 3.8KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. Imports System.Globalization
  2. Public Class 人員明細表
  3. Private Sub Set_清單()
  4. Dim ds1 As New DataSet
  5. 清單_dgv.DataSource = Nothing : ds1.Clear()
  6. 清單_dgv.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
  7. 清單_dgv.ColumnHeadersHeight = 35 : 清單_dgv.AllowUserToAddRows = False : 清單_dgv.RowTemplate.Height = 30
  8. SQL_人員明細_履歷(PA50)
  9. da.Fill(ds1) : 清單_dgv.DataSource = ds1.Tables(0) : conn.Close()
  10. 清單_dgv.Columns("原始開始").Visible = False : 清單_dgv.Columns("原始結束").Visible = False
  11. '.姓名, .人員狀態, .外出地點, .開始時間, .結束時間, .聯絡函單號, .申請日期
  12. '180 181 182 183 184 185 186
  13. For i As Integer = 0 To 清單_dgv.Rows.Count - 1
  14. Dim 借車時間 As String = 清單_dgv.Rows(i).Cells("原始開始").Value.ToString : Dim 格式 As String = "yyyyMMddHHmmss"
  15. Dim 轉換後的時間 As DateTime = DateTime.ParseExact(借車時間, 格式, CultureInfo.InvariantCulture)
  16. 清單_dgv.Rows(i).Cells(表頭(183)).Value = Strings.Format(轉換後的時間, "yyyy/MM/dd-HH:mm:ss")
  17. Dim 還車時間 As String = 清單_dgv.Rows(i).Cells("原始結束").Value.ToString
  18. 轉換後的時間 = DateTime.ParseExact(還車時間, 格式, CultureInfo.InvariantCulture)
  19. 清單_dgv.Rows(i).Cells(表頭(184)).Value = Strings.Format(轉換後的時間, "yyyy/MM/dd-HH:mm:ss")
  20. If i <> 0 Then
  21. 清單_dgv.Rows(i).Cells(表頭(180)).Value = ""
  22. End If
  23. If 系統語言 <> "繁體中文" Then
  24. If 清單_dgv.Rows(i).Cells(表頭(181)).Value = "外出" Then : 清單_dgv.Rows(i).Cells(表頭(181)).Value = "Keluar"
  25. ElseIf 清單_dgv.Rows(i).Cells(表頭(181)).Value = "請假" Then : 清單_dgv.Rows(i).Cells(表頭(181)).Value = "Cuti"
  26. End If
  27. End If
  28. Next
  29. End Sub
  30. Private Sub 語言轉換讀取()
  31. If 系統語言 = "繁體中文" Then : 語言 = "CH" : ElseIf 系統語言 = "English" Then : 語言 = "EN" : ElseIf 系統語言 = "Indonesian" Then : 語言 = "IN" : End If
  32. '.姓名, .人員狀態, .外出地點, .開始時間, .結束時間, .聯絡函單號, .申請日期
  33. '180 181 182 183 184 185 186
  34. 表頭(180) = 系統語言字典("H601-103-" & 語言) : 表頭(181) = 系統語言字典("H001-279-" & 語言) : 表頭(182) = 系統語言字典("H001-282-" & 語言)
  35. 表頭(183) = 系統語言字典("H001-280-" & 語言) : 表頭(184) = 系統語言字典("H001-281-" & 語言) : 表頭(185) = 系統語言字典("H904-107-" & 語言)
  36. 表頭(186) = 系統語言字典("H904-104-" & 語言)
  37. End Sub
  38. Private Sub 人員明細表_Load(sender As Object, e As EventArgs) Handles MyBase.Load
  39. 語言轉換讀取() : 風格() : Set_清單()
  40. End Sub
  41. Private Sub 風格()
  42. If 深色風格 = False Then
  43. 清單_dgv.EnableHeadersVisualStyles = True : 清單_dgv.BackgroundColor = Color.White : 清單_dgv.ColumnHeadersDefaultCellStyle.ForeColor = Color.Black
  44. 清單_dgv.AlternatingRowsDefaultCellStyle.BackColor = Color.White
  45. 清單_dgv.DefaultCellStyle.BackColor = Color.White : 清單_dgv.DefaultCellStyle.ForeColor = Color.Black
  46. Else
  47. 清單_dgv.EnableHeadersVisualStyles = False : 清單_dgv.BackgroundColor = Color.DimGray : 清單_dgv.ColumnHeadersDefaultCellStyle.ForeColor = Color.White
  48. 清單_dgv.ColumnHeadersDefaultCellStyle.BackColor = Color.Black : 清單_dgv.AlternatingRowsDefaultCellStyle.BackColor = Color.DimGray
  49. 清單_dgv.DefaultCellStyle.BackColor = Color.DimGray : 清單_dgv.DefaultCellStyle.ForeColor = Color.White
  50. End If
  51. End Sub
  52. End Class