/// <summary> /// Henter data fra fil og indlæser dem /// </summary> private void LoadFile() { //Hent class med functioner Model.FileClass.function funcFile = new Model.FileClass.function(); //Sæt elev info TextBox_name.Text = Inc.Settings.fileInput.name; TextBox_cpr.Text = Inc.Settings.fileInput.cpr; //Sorter dagbog log efter dato Model.FileClass.function.sortDateArray daglog = funcFile.DateSort(Inc.Settings.fileInput); this.FilesList = Inc.Settings.fileInput.files; //Hent links/Dokumenter for elev /* * Tilføj en nye tekst boks for hver log der er */ for (int i = 0; i < daglog.dato.Count; i++) { AddFreeText(); DatePicker datePickerDato = this.FindName("DatePicker_Dato_" + i) as DatePicker; RichTextBox RichTextBoxFreeText = this.FindName("RichTextBox_FreeText_" + i) as RichTextBox; DateTime selectDate = daglog.dato[i]; datePickerDato.SelectedDate = selectDate; SetRichTextbox(RichTextBoxFreeText, daglog.text[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); }