private void outputToTimesheet(DateTime date) { //DateTime date = DateTime.Now; DateTime rangeStart = getRangeStart(date); List <work_period> DayRange = getRange(rangeStart.AddDays(-1.0), 15); String name = this.personInfo.GivenNames + " " + this.personInfo.Surname; List <PremiumCode> outCodes = CodeChecker.CheckCodes(DayRange, ref settings); createOvertimeDataSheet(outCodes, date); Debug.WriteLine(outCodes.Count + " codes found."); Sheet_PhoenixOT sheet = new Sheet_PhoenixOT(personInfo, outCodes, rangeStart, wp, ref settings); List <Sheet> sheets = new List <Sheet>(); sheets.Add(sheet); SheetViewer sv = new SheetViewer(sheets); sv.ShowDialog(); }
private List <data_4600> createWashup4600(DateTime d1, DateTime d2) { int days = (int)d2.Subtract(d1).TotalDays + 1; //Added one to correct for last day not appearing List <work_period> periodCovered = getRange(d1, days); List <data_4600> dataSheets = new List <data_4600>(); dataSheets.Add(new data_4600()); List <PremiumCode> codes = new List <PremiumCode>( CodeChecker.CheckCodes(periodCovered, ref settings).Where((x) => x.Code == CodeChecker.Code290.DEFAULT_CODE) ); int rowCount = 0; int sheetCount = 1; foreach (PremiumCode c in codes) { if (rowCount > 15) { dataSheets.Add(new data_4600()); ++sheetCount; rowCount = 0; } string washupMessage; if (c.StartDate.DayOfWeek == DayOfWeek.Saturday || c.StartDate.DayOfWeek == DayOfWeek.Sunday) { washupMessage = "Art 60 - Washup - Wknd OT"; } else { washupMessage = "Art 60 - Washup"; } dataSheets[sheetCount - 1].FillNewRow( c.StartDate, c.EndDate, ShiftInformation.LunchLength, CodeChecker.Code290.DEFAULT_CODE, c.GetArrayHours(PremiumCode.HoursMultiplier.X100).TotalHours, c.GetArrayHours(PremiumCode.HoursMultiplier.X150).TotalHours, c.GetArrayHours(PremiumCode.HoursMultiplier.X175).TotalHours, c.GetArrayHours(PremiumCode.HoursMultiplier.X200).TotalHours, washupMessage); ++rowCount; } setWashupLeaveHours(dataSheets); foreach (data_4600 d4 in dataSheets) { foreach (string line in d4.exportRowInformation()) { Debug.WriteLine(line); } } return(dataSheets); }