I was wondering if you could help me out on my project. I have a List called Jobs and a List called JobListOrder. List<Jobs> is where the original project information is stored. List<JobListOrder> is where I would like it to go into so that I can run some logic to get the EndTimes. I have been trying stuff out for weeks and I just got to this.
Here is the Jobs List
What it looks like
Here is the JobListOrder
I would like the JobListOrder to look like this.
Afterwards I wanna take the max of the current indexes JobNum (example Max of all Job 1's EndHour) and the max of the current indexes Workstation (example Max of all Milling EndHour) then add ProcTime to the max of JobNumMax and WorkstationMax and place it in EndHour.
Here is the Jobs List
C#:
public class Jobs
{
public int JobNum { get; set; }
public int Priority { get; set; }
public DateTime DueDate { get; set; }
public string WS1 { get; set; }
public int Seq1 { get; set; }
public string WS2 { get; set; }
public int Seq2 { get; set; }
public string WS3 { get; set; }
public int Seq3 { get; set; }
public string WS4 { get; set; }
public int Seq4 { get; set; }
}
C#:
new Jobs {JobNum = 1, Priority = 0, DueDate = DateTime.Today, WS1 = "Milling", Seq1 = 1, WS2 = "CNC", Seq2 = 1, WS3 = "Drilling", Seq3 = 1, WS4 = "Finish", Seq4 = 1 },
new Jobs {JobNum = 2, Priority = 0, DueDate = DateTime.Today, WS1 = "Milling", Seq1 = 2, WS2 = "Drilling", Seq2 = 1, WS3 = "Milling", Seq3 = 1, WS4 = "Finish", Seq4 = 1 },
new Jobs {JobNum = 3, Priority = 1, DueDate = DateTime.Today, WS1 = "Drilling", Seq1 = 1, WS2 = "CNC", Seq2 = 1, WS3 = "Milling", Seq3 = 1, WS4 = "Finish", Seq4 = 1 }
};
Here is the JobListOrder
C#:
public class JobListOrder
{
public int JobNum { get; set; }
public string Workstation { get; set; }
public int Sequence { get; set; }
public int ProcTime { get; set; }
public int EndHour { get; set; }
public DateTime StartTime { get; set; }
public DateTime EndTime { get; set; }
}
I would like the JobListOrder to look like this.
JobNum | Workstation | Sequence | ProcTime | EndHour | StartTime | EndTime |
1 | Milling | 1 | 1 | Calculated | Calculated | Calculated |
2 | Milling | 1 | 1 | Calculated | Calculated | Calculated |
3 | Drilling | 1 | 1 | Calculated | Calculated | Calculated |
1 | CNC | 2 | 1 | Calculated | Calculated | Calculated |
2 | Drilling | 2 | 1 | Calculated | Calculated | Calculated |
3 | CNC | 2 | 1 | Calculated | Calculated | Calculated |
1 | Drilling | 3 | 1 | Calculated | Calculated | Calculated |
2 | Milling | 3 | 1 | Calculated | Calculated | Calculated |
3 | Milling | 3 | 1 | Calculated | Calculated | Calculated |
1 | Finish | 4 | 1 | Calculated | Calculated | Calculated |
2 | Finish | 4 | 1 | Calculated | Calculated | Calculated |
3 | Finish | 4 | 1 | Calculated | Calculated | Calculated |
Afterwards I wanna take the max of the current indexes JobNum (example Max of all Job 1's EndHour) and the max of the current indexes Workstation (example Max of all Milling EndHour) then add ProcTime to the max of JobNumMax and WorkstationMax and place it in EndHour.