/// <summary> /// Henter data logs fra fil /// </summary> private void LoadFile() { //Hent class med functioner Model.FileClass.function funcFile = new Model.FileClass.function(); //Sæt elev info Label_name.Content = Inc.Settings.fileInput.name; Label_cpr.Content = Inc.Settings.fileInput.cpr; //Sorter dagbog log efter dato Model.FileClass.function.sortDateArray orderLog = funcFile.DateSort(Inc.Settings.fileInput); //tilføj logs for (int i = 0; i < orderLog.dato.Count; i++) { if (orderLog.text[i] != "") { AddLogs(orderLog.dato[i].ToShortDateString(), orderLog.text[i]); } } //opdater link/dokumenter liste for (int i = 0; i < Inc.Settings.fileInput.files.Count; i++) { UpdateLinkList(i); } }
/// <summary> /// Opretter dagbog layout /// </summary> private PdfPTable makePdfTable() { Model.FileClass.fileInput input = Inc.Settings.fileInput; Model.FileClass.function funcFile = new FileClass.function(); Model.FileClass.function.sortDateArray sortData = funcFile.DateSort(input); PdfPCell whiteSpace = new PdfPCell(); whiteSpace.Border = 0; whiteSpace.FixedHeight = 10; PdfPTable PersonTable = new PdfPTable(2); PersonTable.DefaultCell.Border = 0; PersonTable.SetWidths(new int[] { 1, 5 }); PersonTable.AddCell(InsertText("Navn:", true)); PersonTable.AddCell(InsertText(input.name)); PersonTable.AddCell(InsertText("CPR:", true)); PersonTable.AddCell(InsertText(input.cpr)); PdfPTable logTable = new PdfPTable(1); for (int i = 0; i < sortData.dato.Count; i++) { logTable.AddCell(whiteSpace); PdfPTable newLog = new PdfPTable(1); newLog.DefaultCell.Border = 0; newLog.AddCell(InsertText(sortData.dato[i].ToShortDateString(), true, new int[] { 5, 5, 5, 5 })); newLog.AddCell(InsertText(sortData.text[i], false, new int[] { 15, 5, 5, 5 })); logTable.AddCell(new PdfPCell(newLog)); } PdfPTable document = new PdfPTable(1); document.DefaultCell.Border = 0; document.AddCell(ConvertTableToCell(PersonTable)); document.AddCell(ConvertTableToCell(logTable)); return(document); }