private static List <ClockStamp> generateClockStampsWithLunches(double HoursDay, int NumberOfDays) { // The list were adding too var list = new List <ClockStamp>(); // The clock Id var id = 100; // The Date Time we will use to manipulate var dateTime = DateTime.Now.AddDays(-7); // The Id of the empoyee's clock in's var employeeId = 2; // The person who logged the timestamp var createdBy = "Bob"; // Loops according to number of days for (int i = 0; i < NumberOfDays; i++) { var timestamp1 = new ClockStamp() { Id = id++, EmployeeId = employeeId, CreatedBy = createdBy, TimeStamp = dateTime.AddHours(-HoursDay), In = true }; list.Add(timestamp1); var timestamp2 = new ClockStamp() { Id = id++, EmployeeId = employeeId, CreatedBy = createdBy, TimeStamp = dateTime.AddHours(-HoursDay / 2), In = false }; list.Add(timestamp2); var timestamp3 = new ClockStamp() { Id = id++, EmployeeId = employeeId, CreatedBy = createdBy, TimeStamp = dateTime.AddHours(-HoursDay / 2).AddMinutes(30), In = true }; list.Add(timestamp3); var timestamp4 = new ClockStamp() { Id = id++, EmployeeId = employeeId, CreatedBy = createdBy, TimeStamp = dateTime.AddMinutes(30), In = false }; list.Add(timestamp4); dateTime = dateTime.AddDays(1); } return(list); }
private static List <ClockStamp> generateSimpleClockStamps(double HoursDay, int NumberOfDays) { // The list were adding too var list = new List <ClockStamp>(); // The clock Id var id = 0; // The Date Time we will use to manipulate var dateTime = DateTime.Now.AddDays(-7); // The Id of the empoyee's clock in's var employeeId = 1; // The person who logged the timestamp var createdBy = "Lucas"; // Loop 5 times created 5 days worth of stamps, Should come out to 40 hours for (int i = 0; i < NumberOfDays; i++) { var timestamp1 = new ClockStamp() { Id = id++, EmployeeId = employeeId, CreatedBy = createdBy, TimeStamp = dateTime.AddHours(-HoursDay), In = true }; list.Add(timestamp1); var timestamp2 = new ClockStamp() { Id = id++, EmployeeId = employeeId, CreatedBy = createdBy, TimeStamp = dateTime, In = false }; list.Add(timestamp2); dateTime = dateTime.AddDays(NumberOfDays); } return(list); }