diff --git a/BeWoPlanerMobil/BeWoPlanerMobil.csproj b/BeWoPlanerMobil/BeWoPlanerMobil.csproj index 29c302398..254d878ee 100644 --- a/BeWoPlanerMobil/BeWoPlanerMobil.csproj +++ b/BeWoPlanerMobil/BeWoPlanerMobil.csproj @@ -5090,6 +5090,9 @@ + + + 10.0 $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) diff --git a/BeWoPlanerMobil/Controllers/CustomerController.cs b/BeWoPlanerMobil/Controllers/CustomerController.cs index cf59e15be..9b7da5895 100644 --- a/BeWoPlanerMobil/Controllers/CustomerController.cs +++ b/BeWoPlanerMobil/Controllers/CustomerController.cs @@ -94,6 +94,8 @@ namespace BeWoPlanerMobil.Controllers { Model.ReportTypes = new List { CustomerReportType.Medikamentenliste, CustomerReportType.Bedarfsmedikation, CustomerReportType.Historie }; } + + Model.AllAbsenceReasons = AbstractModel.HasRightToViewCustomerAbsenceTimes ? CustomerService.GetAllAbsenceReasons() : new List(); } [Authorize] diff --git a/BeWoPlanerMobil/Controllers/ReportViewerController.cs b/BeWoPlanerMobil/Controllers/ReportViewerController.cs index cda5ebaea..706a24e96 100644 --- a/BeWoPlanerMobil/Controllers/ReportViewerController.cs +++ b/BeWoPlanerMobil/Controllers/ReportViewerController.cs @@ -8,6 +8,7 @@ using BeWoPlanerMobil.Models; using BeWoPlanerMobil.Service; using BeWoPlanerMobil.Util; using BS.Shared; +using BS.Shared.DataContracts; using BS.Shared.DataContracts.Compact; namespace BeWoPlanerMobil.Controllers @@ -99,7 +100,6 @@ namespace BeWoPlanerMobil.Controllers Model.Queries = QueryService.GetAllQueriesOfType(QueryType.Public); - return View(Model); } @@ -121,6 +121,8 @@ namespace BeWoPlanerMobil.Controllers var selectedQuery = Model.Queries.FirstOrDefault(query => query.Oid.Equals(reportOid.Value)); + var queryParameter = selectedQuery?.Parameter ?? new List(); + if (selectedQuery is null) { Model.Report = null; @@ -137,12 +139,13 @@ namespace BeWoPlanerMobil.Controllers } QueryService.PrepareQueryReport(test, dcid); - - Model.Report = Model.ReportCreator.CreateQueryReport(selectedQuery.Oid, dcid); + var queryReport = Model.ReportCreator.CreateQueryReport(selectedQuery.Oid, dcid); + Model.Report = queryReport; } catch (Exception e) { Log.Error(e); + TempData["ErrorMessage"] = e.Message; } return PartialView("DocumentWebViewerPartial", Model); diff --git a/BeWoPlanerMobil/Models/CustomerModel.cs b/BeWoPlanerMobil/Models/CustomerModel.cs index fd205c6be..33a2cb05c 100644 --- a/BeWoPlanerMobil/Models/CustomerModel.cs +++ b/BeWoPlanerMobil/Models/CustomerModel.cs @@ -133,5 +133,34 @@ namespace BeWoPlanerMobil.Models public string ReportName { get; set; } public List Bargeldkassen { get; set; } + + [Display(Name = "Kategorie")] + public long? SelectedAbsenceReason { get; set; } + + public List AllAbsenceReasons { get; set; } + + public List AbsenceReasonItems + { + get + { + var result = new List(); + + foreach(var absenceReason in AllAbsenceReasons) + { + if(absenceReason.AbsenceReasonOid is null) + { + continue; + } + + result.Add(new SelectListItem + { + Value = absenceReason.AbsenceReasonOid.Value.ToString(), + Text = absenceReason.Description + }); + } + + return result; + } + } } } \ No newline at end of file diff --git a/BeWoPlanerMobil/Views/Customer/Customer.cshtml b/BeWoPlanerMobil/Views/Customer/Customer.cshtml index d7a31bbc5..042f30fc2 100644 --- a/BeWoPlanerMobil/Views/Customer/Customer.cshtml +++ b/BeWoPlanerMobil/Views/Customer/Customer.cshtml @@ -977,7 +977,7 @@ @if(Html.IsInDebugMode() && AbstractModel.HasRightToViewCustomerAbsenceTimes) {
-
+
@@ -988,8 +988,11 @@
+
+ +
@Html.Partial("CustomerAbsenceTimePartial", Model)
@@ -1002,6 +1005,30 @@ }
+@if(Html.IsInDebugMode() && AbstractModel.HasRightToViewCustomerAbsenceTimes) +{ + + +} + @if(!(Model?.Report is null) && Html.IsInDebugMode()) {
- +
diff --git a/BeWoPlanerMobil/Views/ReportViewer/ReportViewer.cshtml b/BeWoPlanerMobil/Views/ReportViewer/ReportViewer.cshtml index e5302ae76..b9d7e40c0 100644 --- a/BeWoPlanerMobil/Views/ReportViewer/ReportViewer.cshtml +++ b/BeWoPlanerMobil/Views/ReportViewer/ReportViewer.cshtml @@ -1,5 +1,4 @@ -@using BeWoPlanerMobil.Util -@model BeWoPlanerMobil.Models.ReportViewerModel +@model BeWoPlanerMobil.Models.ReportViewerModel