diff --git a/BeWo/View/Detail/MassnahmenTreeViewView.xaml.cs b/BeWo/View/Detail/MassnahmenTreeViewView.xaml.cs index adc7f27dc..fc9fe4223 100644 --- a/BeWo/View/Detail/MassnahmenTreeViewView.xaml.cs +++ b/BeWo/View/Detail/MassnahmenTreeViewView.xaml.cs @@ -336,7 +336,7 @@ namespace BeWo.View.Detail var ve = _TreeViewItemsList.FirstOrDefault(f => f.GoalEntryVM != null && f.GoalEntryVM.Equals(ziel)); if (ve != null) { - GoalService.RecursiveSynchronousValueListEntrySave(ve); + GoalService.RecursiveSynchronousValueListEntrySave(ve); // Hier passiert bei Komponente E ein Fehler } } } diff --git a/BeWo/View/Detail/Report/AbwesenheitsView.xaml.cs b/BeWo/View/Detail/Report/AbwesenheitsView.xaml.cs index efb4da333..0bc7e47fa 100644 --- a/BeWo/View/Detail/Report/AbwesenheitsView.xaml.cs +++ b/BeWo/View/Detail/Report/AbwesenheitsView.xaml.cs @@ -312,7 +312,21 @@ namespace BeWo.View.Detail.Report SchedulerHelper.OverrideAppointmentWithAbsenceTime(appointment, absence); //Auskommentieren entfernt Einträge aus Planer appointment.Start = absence.Start.Value; - appointment.End = absence.End.Value.Date == absence.Start.Value.Date ? absence.End.Value : absence.End.Value.AddDays(1); + if (absence.End.HasValue) + appointment.End = absence.End.Value.Date == absence.Start.Value.Date ? absence.End.Value : absence.End.Value.AddDays(1); + else + { + if (appointment.Start.Date.Year >= SelectedYear && appointment.Start.Date.Month <= SelectedMonth) + { + if (SelectedMonth < 12) + appointment.End = new DateTime(SelectedYear, SelectedMonth + 1, 1); + else + appointment.End = new DateTime(SelectedYear + 1, 1, 1); + } + } + + if (appointment.End == null) + Console.WriteLine("test"); _AppointmentStorage.Add(appointment); } diff --git a/BeWo/View/Detail/Report/IcfImportControl.xaml.cs b/BeWo/View/Detail/Report/IcfImportControl.xaml.cs index 168646e31..8abb545dd 100644 --- a/BeWo/View/Detail/Report/IcfImportControl.xaml.cs +++ b/BeWo/View/Detail/Report/IcfImportControl.xaml.cs @@ -75,6 +75,7 @@ namespace BeWo.View.Detail.Report { // Hier muss eine zusätzliche Verschachtelungsstufe erstellt werden, also ICF -> Kategorie -> Einschränkungsarten/Ziele + // Erzeugt das Objekt var goalItem = new SupportConceptGoalDC { @@ -158,27 +159,101 @@ namespace BeWo.View.Detail.Report List listEntries = new List(); + var counter = 0; foreach (var list in icfs) { if (listEntries.Count == 0) + { listEntries.Add(list[0]); - else + listEntries = AddKlassifikationen(listEntries); + } + if (listEntries.Count > 0) { foreach (var item in list) { if (item != null) { + int? parentOid = null; + switch (counter) + { + case 0: + parentOid = -2; + break; + case 1: + parentOid = -3; + break; + case 2: + parentOid = -4; + break; + case 3: + parentOid = -5; + break; + } + if (item.DisplayName != "ICF") + { + if (item.ParentOid == null) + item.ParentOid = (int)parentOid; listEntries.Add(item); + } } } + counter++; } } + //foreach (var list in icfs) + //{ + // if (listEntries.Count == 0) + // { + // listEntries.Add(list[0]); + // } + // else + // { + // foreach (var item in list) + // { + // if (item != null) + // { + // if (item.DisplayName != "ICF") + // listEntries.Add(item); + // } + // } + // } + //} + + // Hier müssen die Children alle Oberkategorien sein und erst nach diesen die Unterkategorien // In jedem ersten Slot der Listen befindet sich das Objekt ICF TreeViewGoalItem = GetSupportConceptGoal(null, listEntries.Find(x => x.ParentOid == -1), listEntries); } + public List AddKlassifikationen(List listEntries) + { + listEntries.Add(new ValueListEntryDC() + { + TypeDescription = "Klassifikation der Körperfunktionen (Komponente b)", + ParentOid = null, + ValueListEntryOid = -2 + }); + listEntries.Add(new ValueListEntryDC() + { + TypeDescription = "Klassifikation der Körperstrukturen (Komponente s)", + ParentOid = null, + ValueListEntryOid = -3 + }); + listEntries.Add(new ValueListEntryDC() + { + TypeDescription = "Klassifikation der Aktivitäten und Partizipationen (Komponente d)", + ParentOid = null, + ValueListEntryOid = -4 + }); + listEntries.Add(new ValueListEntryDC() + { + TypeDescription = "Klassifikation der Umweltfaktoren (Komponente e)", + ParentOid = null, + ValueListEntryOid = -5 + }); + return listEntries; + } } } diff --git a/Data/ICF/ICFDAO.cs b/Data/ICF/ICFDAO.cs index 3d2496baa..a85185b24 100644 --- a/Data/ICF/ICFDAO.cs +++ b/Data/ICF/ICFDAO.cs @@ -28,8 +28,8 @@ namespace BeWo.Data.ICF { file = "icf.xml"; } - //file = BS.Shared.Core.Utils.CreateSavePath(AppDomain.CurrentDomain.BaseDirectory, @"bin\ICF\" + file); - file = @"D:\Projects\beyondSoft\BeWoPlaner\BeWo\Data\ICF\icf.xml"; + file = BS.Shared.Core.Utils.CreateSavePath(AppDomain.CurrentDomain.BaseDirectory, @"bin\ICF\" + file); + //file = @"D:\Projects\beyondSoft\BeWoPlaner\BeWo\Data\ICF\icf.xml"; _File = XDocument.Load(file); Debug.WriteLine("Dokument geladen"); diff --git a/Host/ReportView.aspx.cs b/Host/ReportView.aspx.cs index 6049980f9..7a8497c25 100644 --- a/Host/ReportView.aspx.cs +++ b/Host/ReportView.aspx.cs @@ -567,12 +567,15 @@ namespace Host string goalOids = Request.Params["goals"].ToString(); var oids = goalOids.Split(','); var alleValueListEntries = DAOFactory.GenericDAO.GetAllActive(); - foreach (var oid in oids) + if (goalOids != null && goalOids != "") { - foreach (var item in alleValueListEntries) + foreach (var oid in oids) { - if (long.Parse(oid) == item.Oid) - ziele.Add(MapperFactory.ValueListEntryDC_ValueListEntry.MapToNewDC(item)); + foreach (var item in alleValueListEntries) + { + if (long.Parse(oid) == item.Oid) + ziele.Add(MapperFactory.ValueListEntryDC_ValueListEntry.MapToNewDC(item)); + } } } } diff --git a/Model/Changes_2021_11_15_ValueListEntry.txt b/Model/Changes_2021_11_15_ValueListEntry.txt new file mode 100644 index 000000000..534984731 --- /dev/null +++ b/Model/Changes_2021_11_15_ValueListEntry.txt @@ -0,0 +1,2 @@ +ALTER TABLE `bewodemo`.`valuelistentry` +CHANGE COLUMN `Notice` `Notice` VARCHAR(2048) NULL DEFAULT NULL ; diff --git a/Report/ReportObjects/RosterRO.cs b/Report/ReportObjects/RosterRO.cs index 8ad6df7fb..3fa0a57c7 100644 --- a/Report/ReportObjects/RosterRO.cs +++ b/Report/ReportObjects/RosterRO.cs @@ -171,22 +171,37 @@ namespace BeWo.Report.ReportObjects { foreach (var block in alleEintraegeSortiert) { + int lastRowIndex = 0; + foreach (var item in block) + { + if (item.Zeile > lastRowIndex) + lastRowIndex = item.Zeile; + } + RosterReportRow row = null; double[] sum = new double[6]; - List[] eintraegeNachZeilen = new List[3]; - eintraegeNachZeilen[0] = new List(); - eintraegeNachZeilen[1] = new List(); - eintraegeNachZeilen[2] = new List(); + List[] eintraegeNachZeilen = new List[lastRowIndex + 1]; + for (int i = 0; i <= lastRowIndex; i++) + eintraegeNachZeilen[i] = new List(); foreach (var b in block) eintraegeNachZeilen[b.Zeile].Add(b); EmployeeDC currentEmployee = new EmployeeDC(); + + foreach (var zeile in eintraegeNachZeilen) + { + if (zeile.Count > 0) + currentEmployee = employee.First(e => e.EmployeeOid == zeile[0].EmployeeOid); + } + + double monthlyHours = 0; for (int i = 0; i < eintraegeNachZeilen.Length; i++) { var aktuellerBlock = eintraegeNachZeilen[i]; + row = new RosterReportRow() { Pos = i, @@ -194,27 +209,30 @@ namespace BeWo.Report.ReportObjects AlleDienste = infoDict }; - EmployeeDC emp = new EmployeeDC(); - foreach (var e in employee) + if (currentEmployee.EmployeeOid == null) { - foreach (var b in aktuellerBlock) + EmployeeDC emp = new EmployeeDC(); + foreach (var e in employee) { - if (b.EmployeeOid == e.EmployeeOid) + foreach (var b in aktuellerBlock) { - emp = e; - currentEmployee = e; - break; + if (b.EmployeeOid == e.EmployeeOid) + { + emp = e; + currentEmployee = e; + break; + } } + if (emp.EmployeeOid != null) + break; } - if (emp.EmployeeOid != null) - break; } + - if (i % 2 == 0 && i != 0) - { - res.RosterReportRows[res.RosterReportRows.Count - 1 - 1].Title = currentEmployee.LastNameFirstName; - currentEmployee = new EmployeeDC(); - } + row.Employee = currentEmployee; + + if (i == 0) + row.Title = currentEmployee.LastNameFirstName; DienstInfoDC dienst = null; foreach (var b in aktuellerBlock) @@ -248,17 +266,29 @@ namespace BeWo.Report.ReportObjects { foreach (var block in alleVertretungenSortiert) { + int lastRowIndex = 0; + foreach (var item in block) + { + if (item.Zeile > lastRowIndex) + lastRowIndex = item.Zeile; + } + RosterReportRow row = null; double[] sum = new double[6]; - List[] vertretungenNachZeilen = new List[3]; - vertretungenNachZeilen[0] = new List(); - vertretungenNachZeilen[1] = new List(); - vertretungenNachZeilen[2] = new List(); + List[] vertretungenNachZeilen = new List[lastRowIndex + 1]; + for (int i = 0; i <= lastRowIndex; i++) + vertretungenNachZeilen[i] = new List(); foreach (var b in block) vertretungenNachZeilen[b.Zeile].Add(b); EmployeeDC currentEmployee = new EmployeeDC(); + foreach (var zeile in vertretungenNachZeilen) + { + if (zeile.Count > 0) + currentEmployee = employee.First(e => e.EmployeeOid == zeile[0].EmployeeOid); + } + double monthlyHours = 0; for (int i = 0; i < vertretungenNachZeilen.Length; i++) { @@ -287,12 +317,9 @@ namespace BeWo.Report.ReportObjects break; } - if (i % 2 == 0 && i != 0) - { - res.RosterReportRows[res.RosterReportRows.Count - 1 - 1].Title = currentEmployee.LastNameFirstName; - currentEmployee = new EmployeeDC(); - } - //row.Title = i == 0 ? emp.LastNameFirstName : null; + row.Employee = currentEmployee; + if (i == 0) + row.Title = currentEmployee.LastNameFirstName; DienstInfoDC dienst = null; foreach (var b in aktuellerBlock) @@ -320,6 +347,8 @@ namespace BeWo.Report.ReportObjects } + res.RosterReportRows = res.RosterReportRows.OrderBy(r => r.Employee.LastNameFirstName).ThenBy(r => r.Pos).ToList(); + return res; } } @@ -333,6 +362,8 @@ namespace BeWo.Report.ReportObjects public int Pos { get; set; } + public EmployeeDC Employee { get; set; } + public double[] WeekSum { get; set; } public double? MonthSum { get; set; } diff --git a/Service/ServiceImplementations/ValueListServiceImp.cs b/Service/ServiceImplementations/ValueListServiceImp.cs index 6861b57b2..484132666 100644 --- a/Service/ServiceImplementations/ValueListServiceImp.cs +++ b/Service/ServiceImplementations/ValueListServiceImp.cs @@ -142,7 +142,7 @@ namespace BeWo.Service.ServiceImplementations try { var lEntity = MapperFactory.ValueListEntryDC_ValueListEntry.MapToNewEntity(pEntry); - DAOFactory.GenericDAO.Insert(lEntity); + DAOFactory.GenericDAO.Insert(lEntity); // Hier Fehler bei Komponente E return MapperFactory.ValueListEntryDC_ValueListEntry.MapToNewDC(lEntity); } catch (Exception e)