David Smith

David Smith

  • NA
  • 2k
  • 0

Get Split Payroll Base upon 14 days

Dec 15 2015 2:05 PM

There are a total of 14 days in a payperiod I will like to determine base upon a user input start data and end data, what are the split payroll start and end date time periods for week 1 and week 2. I create a struct with information below. The struct return the information below.


Example: This complete 14 day payperiod is from 12/5/2015 to 12/18/2015

So the input for the GetSplitPayRoll(12/5/2015 , 12/18/2015);

We take the inputs and split into 2 complete weeks.

Week 1 PayPeriod is 12/5/2015(start) to 12/11/2015(end)

Week 2 Payperiod is 12/12/2015(start) to 12/18/2015(end)

struct SplitPayrollStruct
{
public DateTime WeekOneSplitPayrollPeriodStart;
public DateTime WeekOneSplitPayrollPeriodEnd;
public DateTime WeekTwoSplitPayrollPeriodStart;
public DateTime WeekTwoSplitPayrollPeriodEnd;
}

private SplitPayrollStruct GetSplitPayRoll(DateTime startDate, DateTime endDate)
{
SplitPayrollStruct payroll = new SplitPayrollStruct();

payroll.WeekOneSplitPayrollPeriodStart = ???

payroll.WeekOneSplitPayrollPeriodEnd = ???

payroll.WeekTowSplitPayrollPeriodStart = ???

payroll.WeekTwoSplitPayrollPeriodEnd = ???

return payroll;
}