I have an ASP.NET app, I need some help in achieving this particular logic of code.
I have an arraylist which holds a custom object Sample ( SampleTest, Frequency)
Here is some data from the Arraylist
1) Sample A, MWF
3)Sample C, Daily
4) SampleD, Weekly
5) Sample e , Monthly
I need to create one or more SampleOrders between two dates supplied. All days are valid working days
So my method has the following
Function CreateOrders (arrayList, StartDate and EndDate) As OrderList
In the above test data assumimg there are 61 days, with Start date 03/01/2011 and end date 04/30/2011, would result in 61 orders.
But on 03/01 being a Tuesday we would have the Order having the following SAmpleTests
Sample C, Sample B, Sample D, and Sample E (weekly and monthly test always begin on the StartDate entered)
on 3/2 being a Wed We would have an Order with
Sample C, Sample A
Sample C, Sample B
Sample C, Sample B, Sample D
Sample C, Sample E
In the above scenario we would have weekly sample test - Sample D done on 3/1, 3/8, 3/15. 3/22, 3/29 , 4/5, 4/12, 4/19, 4/26.
The monthly would occur on 3/1/ and 4/1
I need to be able to group these tests into Orders, with the Order date the tests need to be conducted based on the fequency.