Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Dim Table As New DataTable
- Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
- Table.Columns.Add("Operación", Type.GetType("System.String"))
- Table.Columns.Add("Fecha Inicial", Type.GetType("System.DateTime"))
- Table.Columns.Add("Fecha Final", Type.GetType("System.DateTime"))
- DataGridView1.DataSource = Table
- For C As Integer = 0 To DataGridView1.Columns.Count - 1
- DataGridView1.Columns(C).HeaderCell.Style.Font = New Font("Microsoft Sans Serif", 10, FontStyle.Bold)
- DataGridView1.Columns(C).AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells
- Next C
- End Sub
- Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
- Dim date1 As Date
- Try ' En el caso de error en TextBox1
- date1 = CType(TextBox1.Text, Date)
- Catch
- Exit Sub
- End Try
- Dim numRows As Integer
- Dim DateBegin As Date
- Dim DateEnd As Date
- Dim Duration As Integer
- '----------------CHANNEL
- Table.Rows.Add("CHANNEL")
- If Integer.TryParse(TextBox4.Text, numRows) Then
- If (numRows >= 1) Then
- For i As Integer = 1 To numRows
- Duration = 1 ' Duración de esta actividad
- DateBegin = NoWeekEnd(date1) ' El mismo dia de inicio ' Comienza este trabajo
- DateEnd = NoWeekEnd(DateBegin.AddDays(Duration))
- Table.Rows.Add("TRACE AND CUT PLATE C" & i, DateBegin, DateEnd)
- Next
- End If
- '----------------ENGINEERING
- Table.Rows.Add("ENGINEERING")
- Duration = TextBox2.Text
- DateBegin = NoWeekEnd(date1)
- DateEnd = NoWeekEnd(DateBegin.AddDays(Duration))
- Table.Rows.Add("SENDING DRAWINGS FOR APPROVAL", DateBegin, DateEnd)
- date1 = DateEnd
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement