From 5c1512828cf4bb87933809fc29063b49b83ec58a Mon Sep 17 00:00:00 2001 From: Lyndon Jetten Date: Thu, 21 Dec 2023 19:08:53 +0100 Subject: [PATCH] =?UTF-8?q?MoK:=20Alias=20der=20Klienten=20hinzugef=C3=BCg?= =?UTF-8?q?t?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- BeWoPlanerMobil/BeWoPlanerMobil.csproj | 2 +- BeWoPlanerMobil/Controllers/CustomerController.cs | 6 ++++-- BeWoPlanerMobil/Models/CustomerModel.cs | 2 +- BeWoPlanerMobil/Models/MainModel.cs | 9 ++++----- BeWoPlanerMobil/Util/AppointmentListItem.cs | 2 +- BeWoPlanerMobil/Util/JsonCustomer.cs | 3 +++ BeWoPlanerMobil/Views/Customer/Customer.cshtml | 12 ++++++++++++ .../Views/Customer/CustomerBargeldkassen.cshtml | 1 + .../CustomerFilteringModalContentPartial.cshtml | 6 +++++- .../Views/Scheduler/FiveDaySchedulerPartial.cshtml | 10 +++++----- 10 files changed, 37 insertions(+), 16 deletions(-) diff --git a/BeWoPlanerMobil/BeWoPlanerMobil.csproj b/BeWoPlanerMobil/BeWoPlanerMobil.csproj index c8a78fe58..ad17b02a3 100644 --- a/BeWoPlanerMobil/BeWoPlanerMobil.csproj +++ b/BeWoPlanerMobil/BeWoPlanerMobil.csproj @@ -5117,7 +5117,7 @@ - False + True False 8808 / diff --git a/BeWoPlanerMobil/Controllers/CustomerController.cs b/BeWoPlanerMobil/Controllers/CustomerController.cs index 914474f64..d6370538b 100644 --- a/BeWoPlanerMobil/Controllers/CustomerController.cs +++ b/BeWoPlanerMobil/Controllers/CustomerController.cs @@ -298,6 +298,7 @@ namespace BeWoPlanerMobil.Controllers var firstname = formCollection["vorname"]?.RemoveUppercaseEsszett(); var lastname = formCollection["nachname"]?.RemoveUppercaseEsszett(); + var alias = formCollection["alias"]?.RemoveUppercaseEsszett(); var geburtdatum = formCollection["geburtstag"]?.RemoveUppercaseEsszett(); var geschlecht = formCollection["geschlecht"]?.RemoveUppercaseEsszett(); @@ -325,8 +326,9 @@ namespace BeWoPlanerMobil.Controllers return RedirectToActionPermanent("Customer"); } - customer.FirstName = firstname; - customer.LastName = lastname; + customer.FirstName = firstname; + customer.LastName = lastname; + customer.CustomerAlias = alias; if(DateTime.TryParse(geburtdatum, out var dateOfBirth)) { diff --git a/BeWoPlanerMobil/Models/CustomerModel.cs b/BeWoPlanerMobil/Models/CustomerModel.cs index 039113d7b..5fe9ba836 100644 --- a/BeWoPlanerMobil/Models/CustomerModel.cs +++ b/BeWoPlanerMobil/Models/CustomerModel.cs @@ -28,7 +28,7 @@ namespace BeWoPlanerMobil.Models get { var result = new List { new SelectListItem { Value = "-1", Text = string.Empty } }; - result.AddRange(Customers.Select(item => new SelectListItem { Value = item.CustomerOid.ToString(), Text = string.Format("{1}, {0}", item.FirstName, item.LastName) }).ToList()); + result.AddRange(Customers.Select(item => new SelectListItem { Value = item.CustomerOid.ToString(), Text = item.SimpleDescription }).ToList()); return result; } diff --git a/BeWoPlanerMobil/Models/MainModel.cs b/BeWoPlanerMobil/Models/MainModel.cs index 9abb4e546..0d6e02be4 100644 --- a/BeWoPlanerMobil/Models/MainModel.cs +++ b/BeWoPlanerMobil/Models/MainModel.cs @@ -1,7 +1,6 @@ using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; -using System.Diagnostics; using System.Linq; using System.Web.Mvc; using BeWo.View.Navigation.Filter; @@ -248,7 +247,7 @@ namespace BeWoPlanerMobil.Models { allCostBearerRelations.AddRange(sc.CostBearerRelations.Where(w => ShowExpiredSupportConcepts || w.EndDate is null || w.EndDate.Value >= DateTime.Now.Date).Select( cb => new SupportConceptListObject( - $"{sc.Customer.LastNameFirstName} {(sc.Customer.DateOfBirth.HasValue ? "*" + sc.Customer.DateOfBirth.Value.ToString("dd.MM.yyyy") : string.Empty)}", + $"{sc.Customer.SimpleDescription} {(sc.Customer.DateOfBirth.HasValue ? "*" + sc.Customer.DateOfBirth.Value.ToString("dd.MM.yyyy") : string.Empty)}", $"{cb.AuswahlBezeichnung} {cb.StartDate?.ToShortDateString().Remove(6, 2) ?? string.Empty}-{cb.EndDate?.ToShortDateString().Remove(6, 2) ?? string.Empty} {cb.CostBearer.Name}{GetIsNotApproved(cb)}", cb.CostBearer2SupportConceptOid.ToString(), cb.SupportConcept.IsAboutToExpire, @@ -299,9 +298,9 @@ namespace BeWoPlanerMobil.Models foreach(var sc in SupportConcepts.OrderBy(sc => sc.Customer.LastName)) { - allCostbearerRelations.AddRange(sc.CostBearerRelations.Where(w => ShowExpiredSupportConcepts || w.EndDate == null || w.EndDate.Value >= DateTime.Now).Select( + allCostbearerRelations.AddRange(sc.CostBearerRelations.Where(w => ShowExpiredSupportConcepts || w.EndDate is null || w.EndDate.Value >= DateTime.Now).Select( cb => new SupportConceptListObject( - $"{sc.Customer.LastNameFirstName} {(sc.Customer.DateOfBirth.HasValue ? "*" + sc.Customer.DateOfBirth.Value.ToString("dd.MM.yyyy") : string.Empty)}", + $"{sc.Customer.SimpleDescription} {(sc.Customer.DateOfBirth.HasValue ? "*" + sc.Customer.DateOfBirth.Value.ToString("dd.MM.yyyy") : string.Empty)}", $"{cb.AuswahlBezeichnung} {cb.StartDate?.ToShortDateString().Remove(6, 2) ?? string.Empty}-{cb.EndDate?.ToShortDateString().Remove(6, 2) ?? string.Empty} {cb.CostBearer.Name}", cb.CostBearer2SupportConceptOid.ToString(), cb.SupportConcept.IsAboutToExpire, @@ -712,7 +711,7 @@ namespace BeWoPlanerMobil.Models { allCostbearerRelations.AddRange(sc.CostBearerRelations.Where(w => ShowExpiredSupportConcepts || w.EndDate == null || w.EndDate.Value >= DateTime.Now).Select( cb => new SupportConceptListObject( - $"{sc.Customer.LastNameFirstName} {(sc.Customer.DateOfBirth.HasValue ? "*" + sc.Customer.DateOfBirth.Value.ToString("dd.MM.yyyy") : string.Empty)}", + $"{sc.Customer.SimpleDescription} {(sc.Customer.DateOfBirth.HasValue ? "*" + sc.Customer.DateOfBirth.Value.ToString("dd.MM.yyyy") : string.Empty)}", $"{cb.AuswahlBezeichnung} {cb.StartDate?.ToShortDateString().Remove(6, 2) ?? string.Empty}-{cb.EndDate?.ToShortDateString().Remove(6, 2) ?? string.Empty} {cb.CostBearer.Name}", cb.CostBearer2SupportConceptOid.ToString(), cb.SupportConcept.IsAboutToExpire, diff --git a/BeWoPlanerMobil/Util/AppointmentListItem.cs b/BeWoPlanerMobil/Util/AppointmentListItem.cs index 697eda3f5..9ff894ceb 100644 --- a/BeWoPlanerMobil/Util/AppointmentListItem.cs +++ b/BeWoPlanerMobil/Util/AppointmentListItem.cs @@ -171,7 +171,7 @@ namespace BeWoPlanerMobil.Util schedulerAppointment.EmployeeList.DoForEach(employee2Appointment => { EmployeeListInfo += $"{employee2Appointment.Employee.LastName}, {employee2Appointment.Employee.FirstName}; "; }); EmployeeListInfo = EmployeeListInfo.Trim(' ').Trim(';'); - schedulerAppointment.CustomerList.DoForEach(customer2Appointment => { CustomerListInfo += $"{customer2Appointment.LastNameFirstName}; "; }); + schedulerAppointment.CustomerList.DoForEach(customer2Appointment => { CustomerListInfo += $"{customer2Appointment.SimpleDescription}; "; }); CustomerListInfo = CustomerListInfo.Trim(' ').Trim(';'); schedulerAppointment.ResourceList.DoForEach(resource => { ResourceListInfo += $"{resource.Name}; "; }); diff --git a/BeWoPlanerMobil/Util/JsonCustomer.cs b/BeWoPlanerMobil/Util/JsonCustomer.cs index cf0b4a386..742fb7d11 100644 --- a/BeWoPlanerMobil/Util/JsonCustomer.cs +++ b/BeWoPlanerMobil/Util/JsonCustomer.cs @@ -14,6 +14,8 @@ namespace BeWoPlanerMobil.Util { public string Vorname { get; set; } public string Nachname { get; set; } + + public string Alias { get; set; } public string Geburtstag { get; set; } public string Geschlecht { get; set; } @@ -117,6 +119,7 @@ namespace BeWoPlanerMobil.Util ICD10Diagnosen = icd10Diagnosen; Vorname = customer.FirstName; Nachname = customer.LastName; + Alias = customer.CustomerAlias; Geburtstag = customer.DateOfBirth?.ToShortDateString() ?? string.Empty; switch(customer.Sex) diff --git a/BeWoPlanerMobil/Views/Customer/Customer.cshtml b/BeWoPlanerMobil/Views/Customer/Customer.cshtml index f9555c7e6..116619e05 100644 --- a/BeWoPlanerMobil/Views/Customer/Customer.cshtml +++ b/BeWoPlanerMobil/Views/Customer/Customer.cshtml @@ -217,6 +217,18 @@ +
+
+
+
+
+ Alias +
+
+ +
+
+
diff --git a/BeWoPlanerMobil/Views/Customer/CustomerBargeldkassen.cshtml b/BeWoPlanerMobil/Views/Customer/CustomerBargeldkassen.cshtml index d1d04bc38..a587e8020 100644 --- a/BeWoPlanerMobil/Views/Customer/CustomerBargeldkassen.cshtml +++ b/BeWoPlanerMobil/Views/Customer/CustomerBargeldkassen.cshtml @@ -9,6 +9,7 @@ Label Anfangsbestand Datumsfeld Startdatum Datumsfeld Enddatum + Datumsfeld Stichtag Link Kassenbuch drucken (Button mit Druckerlogo) Tabelle "Ein- und Auszahlungen" diff --git a/BeWoPlanerMobil/Views/Scheduler/CustomerFilteringModalContentPartial.cshtml b/BeWoPlanerMobil/Views/Scheduler/CustomerFilteringModalContentPartial.cshtml index b1caea398..7e2fb970b 100644 --- a/BeWoPlanerMobil/Views/Scheduler/CustomerFilteringModalContentPartial.cshtml +++ b/BeWoPlanerMobil/Views/Scheduler/CustomerFilteringModalContentPartial.cshtml @@ -27,10 +27,14 @@ @foreach(var customer in Model.AllCustomers) { + var customerNameWithAlias = string.IsNullOrEmpty(customer.CustomerAlias) ? + customer.DetailDescription : + $"{customer.LastName}, {customer.FirstName} ({customer.CustomerAlias})"; + var checkedValue = Model.SelectedCustomersForFiltering.Contains(customer) ? "checked" : string.Empty;
- +
} \ No newline at end of file diff --git a/BeWoPlanerMobil/Views/Scheduler/FiveDaySchedulerPartial.cshtml b/BeWoPlanerMobil/Views/Scheduler/FiveDaySchedulerPartial.cshtml index 0af72f0f3..9eab4d094 100644 --- a/BeWoPlanerMobil/Views/Scheduler/FiveDaySchedulerPartial.cshtml +++ b/BeWoPlanerMobil/Views/Scheduler/FiveDaySchedulerPartial.cshtml @@ -72,7 +72,7 @@
} - @if (Model.HasRightToEditAppointment(appointment.Oid) && !appointment.IsTask && appointment.Oid.HasValue) + @if (Model.HasRightToEditAppointment(appointment.Identifier) && !appointment.IsTask && appointment.Oid.HasValue) { using (Html.BeginForm("SelectAppointmentToEdit", "Scheduler", FormMethod.Post)) { @@ -168,7 +168,7 @@
} - @if (Model.HasRightToEditAppointment(appointment.Oid) && !appointment.IsTask && appointment.Oid.HasValue) + @if (Model.HasRightToEditAppointment(appointment.Identifier) && !appointment.IsTask && appointment.Oid.HasValue) { using (Html.BeginForm("SelectAppointmentToEdit", "Scheduler", FormMethod.Post)) { @@ -264,7 +264,7 @@
} - @if (Model.HasRightToEditAppointment(appointment.Oid) && !appointment.IsTask && appointment.Oid.HasValue) + @if (Model.HasRightToEditAppointment(appointment.Identifier) && !appointment.IsTask && appointment.Oid.HasValue) { using (Html.BeginForm("SelectAppointmentToEdit", "Scheduler", FormMethod.Post)) { @@ -360,7 +360,7 @@
} - @if (Model.HasRightToEditAppointment(appointment.Oid) && !appointment.IsTask && appointment.Oid.HasValue) + @if (Model.HasRightToEditAppointment(appointment.Identifier) && !appointment.IsTask && appointment.Oid.HasValue) { using (Html.BeginForm("SelectAppointmentToEdit", "Scheduler", FormMethod.Post)) { @@ -456,7 +456,7 @@
} - @if (Model.HasRightToEditAppointment(appointment.Oid) && !appointment.IsTask && appointment.Oid.HasValue) + @if (Model.HasRightToEditAppointment(appointment.Identifier) && !appointment.IsTask && appointment.Oid.HasValue) { using (Html.BeginForm("SelectAppointmentToEdit", "Scheduler", FormMethod.Post)) {