diff --git a/BeWo/Scheduler/View/NewSchedulerView.xaml.cs b/BeWo/Scheduler/View/NewSchedulerView.xaml.cs index 8eb0d05c0..669c43cc9 100644 --- a/BeWo/Scheduler/View/NewSchedulerView.xaml.cs +++ b/BeWo/Scheduler/View/NewSchedulerView.xaml.cs @@ -432,54 +432,8 @@ namespace BeWo.Scheduler.View ConstructObject(); } - // ToDo: In den Cache verschieben private static void GetCacheObjects(Action, List, Dictionary>> callback) { - //Cache.GetInstance().GetAllActiveEmployeesCompact(allEmployees => - //{ - // this.Dispatch(() => - // { - // Cache.GetInstance().GetAllActiveCustomersCompact(allCustomers => - // { - // this.Dispatch(() => - // { - // Cache.GetInstance().GetCategories2ResourcesDictionary(resourceDictionary => - // { - // this.Dispatch(() => - // { - // if(!BeWoApp.LoggedOnUser.HasRight(UserRightType.KalenderMitarbeitertermineAnsehen)) - // { - // allEmployees = new List {BeWoApp.CompactLoggedOnEmployee}; - // } - - // var darfKlientenAnsichtSehen = BeWoApp.LoggedOnUser.HasRight(UserRightType.Customer_ViewMyTeams) || BeWoApp.LoggedOnUser.HasRight(UserRightType.Customer_ViewMyCustomers) || BeWoApp.LoggedOnUser.HasRight(UserRightType.CustomerView_View); - // var darfTermineAllerKlientenSehen = BeWoApp.LoggedOnUser.HasRight(UserRightType.KalenderKliententermineAlleAnsehen); - - // if(darfKlientenAnsichtSehen) - // { - // if(!darfTermineAllerKlientenSehen || !BeWoApp.LoggedOnUser.HasRight(UserRightType.CustomerView_View)) - // { - // allCustomers = allCustomers.Where(w => w.IsRelatedToEmployee).ToList(); - // } - // } - // else - // { - // allCustomers.Clear(); - // } - - // if(!BeWoApp.LoggedOnUser.HasRight(UserRightType.KalenderRessourcentermineAnsehen)) - // { - // resourceDictionary.Clear(); - // } - - // callback(allCustomers, allEmployees, resourceDictionary); - // }); - // }); - // }); - // }); - // }); - //}); - Cache.GetInstance().GetSchedulerObjects(callback); } diff --git a/BeWo/View/Detail/CustomerView.xaml b/BeWo/View/Detail/CustomerView.xaml index fe25b9069..775b4b0c6 100644 --- a/BeWo/View/Detail/CustomerView.xaml +++ b/BeWo/View/Detail/CustomerView.xaml @@ -679,7 +679,7 @@ - + diff --git a/BeWoPlanerMobil/BeWoPlanerMobil.csproj b/BeWoPlanerMobil/BeWoPlanerMobil.csproj index cb3036a75..25635f6a3 100644 --- a/BeWoPlanerMobil/BeWoPlanerMobil.csproj +++ b/BeWoPlanerMobil/BeWoPlanerMobil.csproj @@ -4387,6 +4387,11 @@ + + + + + @@ -5036,6 +5041,13 @@ + + + + + + + 10.0 $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) diff --git a/BeWoPlanerMobil/Controllers/CustomerController.cs b/BeWoPlanerMobil/Controllers/CustomerController.cs index e1297ecb5..4e5bad7cd 100644 --- a/BeWoPlanerMobil/Controllers/CustomerController.cs +++ b/BeWoPlanerMobil/Controllers/CustomerController.cs @@ -110,7 +110,11 @@ namespace BeWoPlanerMobil.Controllers if (customerOid > 0 && Model.Customers.Any(customer => customer.CustomerOid.Equals(customerOid.Value))) { Model.SelectedCustomerOid = customerOid; - Model.SelectedCustomer = CustomerService.LoadCustomer(customerOid.Value); + + Model.FolderTree = OperationsService.GetFolderTree(TableID.Customer, customerOid.Value); + var customer = CustomerService.LoadCustomer(customerOid.Value); + Model.ICD10Diagnosen = OperationsService.GetDiagiosisStringsForICD10Codes(customer.ICD10DiagnosisCodes); + Model.SelectedCustomer = customer; } return RedirectToActionPermanent("Customer"); @@ -136,7 +140,14 @@ namespace BeWoPlanerMobil.Controllers { Model.FolderTree = OperationsService.GetFolderTree(TableID.Customer, selectedCustomerOid); Model.SelectedCustomerOid = selectedCustomerOid == -1 ? (long?)null : selectedCustomerOid; - Model.SelectedCustomer = selectedCustomerOid != -1 ? CustomerService.LoadCustomer(selectedCustomerOid) : null; + var customer = selectedCustomerOid != -1 ? CustomerService.LoadCustomer(selectedCustomerOid) : null; + + if(!(customer is null)) + { + Model.ICD10Diagnosen = OperationsService.GetDiagiosisStringsForICD10Codes(customer.ICD10DiagnosisCodes); + } + + Model.SelectedCustomer = customer; } } diff --git a/BeWoPlanerMobil/Controllers/MainController.cs b/BeWoPlanerMobil/Controllers/MainController.cs index aa6658451..a5a0bed1d 100644 --- a/BeWoPlanerMobil/Controllers/MainController.cs +++ b/BeWoPlanerMobil/Controllers/MainController.cs @@ -910,11 +910,11 @@ namespace BeWoPlanerMobil.Controllers } var distanz = collection[FormCollectionConstants.DistanceKey]; - var distanceInMeters = 0; + decimal? distanceInMeters = null; if(!string.IsNullOrEmpty(distanz)) { - if(int.TryParse(distanz, out var parsedDistance)) + if(decimal.TryParse(distanz, out var parsedDistance)) { distanceInMeters = parsedDistance; } @@ -991,7 +991,7 @@ namespace BeWoPlanerMobil.Controllers Model.NewServiceRecord.Start = zeitenFeld[0]; Model.NewServiceRecord.End = zeitenFeld[1]; - Model.NewServiceRecord.DistanceInMeter = distanceInMeters; + Model.NewServiceRecord.DistanceInMeterDecimal = distanceInMeters; if(Model.Employee.EmployeeOid.HasValue) { @@ -1338,7 +1338,7 @@ namespace BeWoPlanerMobil.Controllers item.End = Model.NewServiceRecord.End; item.Start = Model.NewServiceRecord.Start; item.RoundedDuration = roundedDuration; - item.DistanceInMeter = Model.NewServiceRecord.DistanceInMeter; + item.DistanceInMeterDecimal = Model.NewServiceRecord.DistanceInMeterDecimal; item.ServiceDescription = Model.NewServiceRecord.ServiceDescription; item.ServiceRecordFormat = Model.NewServiceRecord.ServiceRecordFormat; @@ -2948,11 +2948,11 @@ namespace BeWoPlanerMobil.Controllers } var distanz = formCollection[FormCollectionConstants.DistanceKey]; - var distanceInMeters = 0; + decimal? distanceInMeters = null; if(!string.IsNullOrEmpty(distanz)) { - if(int.TryParse(distanz, out var parsedDistance)) + if(decimal.TryParse(distanz, out var parsedDistance)) { distanceInMeters = parsedDistance; } @@ -3024,7 +3024,7 @@ namespace BeWoPlanerMobil.Controllers Model.NewServiceRecord.Start = zeitenFeld[0]; Model.NewServiceRecord.End = zeitenFeld[1]; - Model.NewServiceRecord.DistanceInMeter = distanceInMeters; + Model.NewServiceRecord.DistanceInMeterDecimal = distanceInMeters; if(Model.Employee.EmployeeOid.HasValue) { @@ -3420,11 +3420,11 @@ namespace BeWoPlanerMobil.Controllers } var distanz = formCollection[FormCollectionConstants.DistanceKey]; - var distanceInMeters = 0; + decimal? distanceInMeters = null; if(!string.IsNullOrEmpty(distanz)) { - if(int.TryParse(distanz, out var parsedDistance)) + if(decimal.TryParse(distanz, out var parsedDistance)) { distanceInMeters = parsedDistance; } @@ -3509,7 +3509,7 @@ namespace BeWoPlanerMobil.Controllers IP = Request.UserHostAddress, Start = zeitenFeld[0], End = zeitenFeld[1], - DistanceInMeter = distanceInMeters, + DistanceInMeterDecimal = distanceInMeters, RoundedDuration = roundedDuration, SupportConcept = sc2cbRel.SupportConcept, CostBearer2SupportConceptOid = sc2cbRel.CostBearer2SupportConceptOid, diff --git a/BeWoPlanerMobil/Controllers/ReportViewerController.cs b/BeWoPlanerMobil/Controllers/ReportViewerController.cs index a399a9e20..5493e76a2 100644 --- a/BeWoPlanerMobil/Controllers/ReportViewerController.cs +++ b/BeWoPlanerMobil/Controllers/ReportViewerController.cs @@ -47,8 +47,6 @@ namespace BeWoPlanerMobil.Controllers public ActionResult ReportViewer() { - TempData["ErrorTest"] = "Das ist nur ein Test."; - Model.Report = null; var month = DateTime.Today.Month; @@ -66,8 +64,6 @@ namespace BeWoPlanerMobil.Controllers // Hat man weder das Recht "HasRightMitarbeiterstundenkontoViewAll" noch "HasRightMitarbeiterstundenkontoViewTeams", sieht man die Teams gar nicht. // Hat man das Recht "HasRightMitarbeiterstundenkontoViewTeams", aber nicht das Recht "HasRightMitarbeiterstundenkontoViewAll", sieht man nur die Teams, deren Teamleiter man ist. - var test = EmployeeService.FindLeadingCompactTeamsOfEmployee(MobileSessionFacade.LoggedInCompactEmployee.EmployeeOid); - Model.AllTeams = AbstractModel.HasRightMitarbeiterstundenkontoViewAll ? EmployeeService.GetAllActiveCompactTeamsForEmployee(MobileSessionFacade.LoggedInEmployee.EmployeeOid) : EmployeeService.FindLeadingCompactTeamsOfEmployee(MobileSessionFacade.LoggedInCompactEmployee.EmployeeOid); @@ -77,12 +73,6 @@ namespace BeWoPlanerMobil.Controllers Model.SelectedEmployeeOid = MobileSessionFacade.LoggedInCompactEmployee.EmployeeOid; } - // ToDo: Hat man das Recht "Nur Team" nicht, kann man nur die Teams sehen, bei denen man auch Leiter ist. - if(!AbstractModel.HasRightMitarbeiterstundenkontoViewTeams) - { - - } - Model.ReportTypes = new List(); if(AbstractModel.HasRightToViewReports) @@ -217,8 +207,6 @@ namespace BeWoPlanerMobil.Controllers [Authorize] public ActionResult LoadMitarbeiterstundenkonto(string parameters) { - TempData["PartialViewErrorTest"] = "Das ist nur ein Test."; - if(Model?.Employee?.EmployeeOid is null) { return Logout(); diff --git a/BeWoPlanerMobil/Models/AbstractModel.cs b/BeWoPlanerMobil/Models/AbstractModel.cs index b1b0f4655..3d3df04ee 100644 --- a/BeWoPlanerMobil/Models/AbstractModel.cs +++ b/BeWoPlanerMobil/Models/AbstractModel.cs @@ -162,5 +162,7 @@ namespace BeWoPlanerMobil.Models return MobileSessionFacade.Tenant != "3010479871" && CheckForAtLeastOneRight(new[] { UserRightType.Mitarbeiterstundenkonto_ViewAll, UserRightType.Mitarbeiterstundenkonto_ViewTeams, UserRightType.Mitarbeiterstundenkonto_ViewSelf }); } } + + public static bool HasRightToViewDiagnosen => CheckRight(UserRightType.Customer_ViewDiagnosis); } } \ No newline at end of file diff --git a/BeWoPlanerMobil/Models/CustomerModel.cs b/BeWoPlanerMobil/Models/CustomerModel.cs index d0585735a..bd5a76d6f 100644 --- a/BeWoPlanerMobil/Models/CustomerModel.cs +++ b/BeWoPlanerMobil/Models/CustomerModel.cs @@ -33,7 +33,9 @@ namespace BeWoPlanerMobil.Models } } - public JsonCustomer SelectedJsonCustomer => SelectedCustomer != null ? new JsonCustomer(SelectedCustomer, FolderTree) : null; + public Dictionary ICD10Diagnosen { get; set; } + + public JsonCustomer SelectedJsonCustomer => SelectedCustomer != null ? new JsonCustomer(SelectedCustomer, FolderTree, ICD10Diagnosen) : null; [Display(Name = "Filter")] public CustomerFilterEnum SelectedCustomerFilter { get; set; } diff --git a/BeWoPlanerMobil/Util/JsonCustomer.cs b/BeWoPlanerMobil/Util/JsonCustomer.cs index 4d58b1b91..54379f990 100644 --- a/BeWoPlanerMobil/Util/JsonCustomer.cs +++ b/BeWoPlanerMobil/Util/JsonCustomer.cs @@ -53,8 +53,11 @@ namespace BeWoPlanerMobil.Util public Sex? CustomerSex { get; set; } - public JsonCustomer(CustomerDC customer, List folderTree) + public Dictionary ICD10Diagnosen { get; set; } = new Dictionary(); + + public JsonCustomer(CustomerDC customer, List folderTree, Dictionary icd10Diagnosen) { + ICD10Diagnosen = icd10Diagnosen; Vorname = customer.FirstName; Nachname = customer.LastName; Geburtstag = customer.DateOfBirth?.ToShortDateString() ?? string.Empty; diff --git a/BeWoPlanerMobil/Util/MobileUtils.cs b/BeWoPlanerMobil/Util/MobileUtils.cs index c0c6b56b6..fea309e00 100644 --- a/BeWoPlanerMobil/Util/MobileUtils.cs +++ b/BeWoPlanerMobil/Util/MobileUtils.cs @@ -344,7 +344,8 @@ namespace BeWoPlanerMobil.Util IsCreatedInMobileClient = true, WohnheimbuchungsOid = m.WohnheimbuchungsOid, DurationInStunden = m.DurationInStunden, - ServiceRecordFormat = m.ServiceRecordFormat + ServiceRecordFormat = m.ServiceRecordFormat, + DistanceInMeterDecimal = m.DistanceInMeterDecimal }; return clone; diff --git a/BeWoPlanerMobil/Views/Customer/Customer.cshtml b/BeWoPlanerMobil/Views/Customer/Customer.cshtml index 80a4fd182..6e894b4cf 100644 --- a/BeWoPlanerMobil/Views/Customer/Customer.cshtml +++ b/BeWoPlanerMobil/Views/Customer/Customer.cshtml @@ -652,8 +652,8 @@ - - @if(Html.IsInDebugMode() && AbstractModel.IsAllowedToSeeMedikamentenliste && Html.IsInDebugMode()) + + @if(Html.IsInDebugMode() && AbstractModel.IsAllowedToSeeMedikamentenliste) {
@@ -673,7 +673,7 @@
-
+
@@ -691,7 +691,46 @@
} -
+ + @if(Html.IsInDebugMode() && AbstractModel.HasRightToViewDiagnosen) + { +
+
+
+
+ +
+
+ +
+
+
+
+
+
+ @foreach(var code2Text in Model.SelectedJsonCustomer.ICD10Diagnosen) + { +
+
+ @code2Text.Key +
+
+ @code2Text.Value +
+
+ } + + +
+
+
+
+
+
+ } +
} } \ No newline at end of file diff --git a/BeWoPlanerMobil/Views/Main/Main.cshtml b/BeWoPlanerMobil/Views/Main/Main.cshtml index c6dbda3fc..a7a64901d 100644 --- a/BeWoPlanerMobil/Views/Main/Main.cshtml +++ b/BeWoPlanerMobil/Views/Main/Main.cshtml @@ -367,7 +367,7 @@ } function setInputFilter(durationId, distanceId, hoursMinutesDropdownBtnId) { - $("#" + durationId + ", #" + distanceId).inputFilter(function(value) { + $("#" + durationId).inputFilter(function (value) { var result = /^\d*$/; var dropdownButton = $("#" + hoursMinutesDropdownBtnId); @@ -377,6 +377,10 @@ return result.test(value); }); + + $("#" + distanceId).inputFilter(function(value) { + return /^-?\d*[.,]?\d*$/.test(value); + }); } (function($) { diff --git a/BeWoPlanerMobil/Views/Main/SingleBookingPartial.cshtml b/BeWoPlanerMobil/Views/Main/SingleBookingPartial.cshtml index 62d719c1e..ce0953ac4 100644 --- a/BeWoPlanerMobil/Views/Main/SingleBookingPartial.cshtml +++ b/BeWoPlanerMobil/Views/Main/SingleBookingPartial.cshtml @@ -475,7 +475,6 @@ - var defaultStartDate = DateTime.Now.GetFirstOfMonth().ToShortDateString(); var defaultEndDate = DateTime.Today.ToShortDateString();
@@ -807,14 +806,14 @@ @durationStr
- @if(Model.ShowDistanceField && serviceRecord.DistanceInMeter != null && serviceRecord.DistanceInMeter.Value > 0) + @if(Model.ShowDistanceField && serviceRecord.DistanceInMeterDecimal != null && serviceRecord.DistanceInMeterDecimal.Value > 0) {
Gefahrene Kilometer:
- @serviceRecord.DistanceInMeter.ToString() + @string.Format("{0:0.##}", serviceRecord.DistanceInMeterDecimal)
} diff --git a/BeWoPlanerMobil/Views/ReportViewer/ReportViewer.cshtml b/BeWoPlanerMobil/Views/ReportViewer/ReportViewer.cshtml index 3f90114e2..4df97d389 100644 --- a/BeWoPlanerMobil/Views/ReportViewer/ReportViewer.cshtml +++ b/BeWoPlanerMobil/Views/ReportViewer/ReportViewer.cshtml @@ -1,12 +1,6 @@ @using BeWoPlanerMobil.Util @model BeWoPlanerMobil.Models.ReportViewerModel - -