Advertisement
Guest User

Untitled

a guest
Jul 18th, 2019
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.90 KB | None | 0 0
  1. Dim Table As New DataTable
  2. Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
  3.  
  4. Table.Columns.Add("Operación", Type.GetType("System.String"))
  5. Table.Columns.Add("Fecha Inicial", Type.GetType("System.DateTime"))
  6. Table.Columns.Add("Fecha Final", Type.GetType("System.DateTime"))
  7.  
  8. DataGridView1.DataSource = Table
  9.  
  10. For C As Integer = 0 To DataGridView1.Columns.Count - 1
  11. DataGridView1.Columns(C).HeaderCell.Style.Font = New Font("Microsoft Sans Serif", 10, FontStyle.Bold)
  12. DataGridView1.Columns(C).AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells
  13. Next C
  14.  
  15. End Sub
  16.  
  17. Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
  18.  
  19. Dim date1 As Date
  20. Try ' En el caso de error en TextBox1
  21. date1 = CType(TextBox1.Text, Date)
  22. Catch
  23. Exit Sub
  24. End Try
  25.  
  26. Dim numRows As Integer
  27. Dim DateBegin As Date
  28. Dim DateEnd As Date
  29. Dim Duration As Integer
  30.  
  31. '----------------CHANNEL
  32. Table.Rows.Add("CHANNEL")
  33. If Integer.TryParse(TextBox4.Text, numRows) Then
  34. If (numRows >= 1) Then
  35. For i As Integer = 1 To numRows
  36.  
  37. Duration = 1 ' Duración de esta actividad
  38. DateBegin = NoWeekEnd(date1) ' El mismo dia de inicio ' Comienza este trabajo
  39. DateEnd = NoWeekEnd(DateBegin.AddDays(Duration))
  40. Table.Rows.Add("TRACE AND CUT PLATE C" & i, DateBegin, DateEnd)
  41. Next
  42. End If
  43.  
  44. '----------------ENGINEERING
  45. Table.Rows.Add("ENGINEERING")
  46. Duration = TextBox2.Text
  47. DateBegin = NoWeekEnd(date1)
  48. DateEnd = NoWeekEnd(DateBegin.AddDays(Duration))
  49. Table.Rows.Add("SENDING DRAWINGS FOR APPROVAL", DateBegin, DateEnd)
  50. date1 = DateEnd
  51. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement