diff --git a/BeWo/Scheduler/View/NewSchedulerView.xaml b/BeWo/Scheduler/View/NewSchedulerView.xaml index c68ec66c4..a48f1e3c2 100644 --- a/BeWo/Scheduler/View/NewSchedulerView.xaml +++ b/BeWo/Scheduler/View/NewSchedulerView.xaml @@ -145,9 +145,11 @@ - + - + @@ -188,7 +190,7 @@ + Visibility="{Binding ViewInfo.View.AppointmentToolTipVisibility, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource ToolTipVisibilityConverter}}"> + @@ -272,7 +275,11 @@ dxschint:VerticalAppointmentContentPanel.AlwaysOnNewRow="True" TextWrapping="Wrap" Margin="11,6,0,0" Foreground="{Binding Path=CustomViewInfo[CustomFieldStorage].ForegroundColor}" /> - + + @@ -284,6 +291,7 @@ + @@ -292,12 +300,15 @@ - + - + + diff --git a/BeWo/Scheduler/ViewModel/SchedulerAppointmentListVM.cs b/BeWo/Scheduler/ViewModel/SchedulerAppointmentListVM.cs index 4e1fbffb4..fb1c60f5f 100644 --- a/BeWo/Scheduler/ViewModel/SchedulerAppointmentListVM.cs +++ b/BeWo/Scheduler/ViewModel/SchedulerAppointmentListVM.cs @@ -343,6 +343,7 @@ namespace BeWo.Scheduler.ViewModel vm.TaskDescription = app.CF_TaskDescription(); vm.SupportConceptList = app.CF_SupportConceptList(); vm.HasServiceRecordEntry = app.CF_HasServiceRecordEntry(); + vm.ServiceRecordList = app.CF_ServiceRecordList(); if(vm.IsTask) { diff --git a/BeWo/View/HomeView.xaml.cs b/BeWo/View/HomeView.xaml.cs index 405b79987..1d15c4472 100644 --- a/BeWo/View/HomeView.xaml.cs +++ b/BeWo/View/HomeView.xaml.cs @@ -477,6 +477,8 @@ namespace BeWo.View Login _login = new Login(kundennummer, "kihqx-PiGka", "cb", "bewo", "0b50c09aff87f20d9ced75340e04e5ccaa11dd3e7bcf25e9c4f94dc20d3cbb97"); + _login = new Login("4368658436", "B7x0b-FhhJA", "jettenl", "n8-yR+3Q=6nX#", "0000"); + var x1 = _login.AnmeldevorgangDurchFuehren(); ServiceChatView = new ChatView(x1); diff --git a/BeWoPlanerMobil/Controllers/CustomerController.cs b/BeWoPlanerMobil/Controllers/CustomerController.cs index d893c7fc6..46c0be946 100644 --- a/BeWoPlanerMobil/Controllers/CustomerController.cs +++ b/BeWoPlanerMobil/Controllers/CustomerController.cs @@ -8,6 +8,7 @@ using BeWoPlanerMobil.Service; using BeWoPlanerMobil.Util; using BS.Shared; using BS.Shared.Core; +using BS.Shared.DataContracts; using BS.Shared.DataContracts.Compact; using DevExpress.XtraReports.UI; @@ -86,6 +87,8 @@ namespace BeWoPlanerMobil.Controllers Model.Customers = new List(); } + + // ReportTypes laden! Erstmal nur Medikamentenansicht if(AbstractModel.IsAllowedToSeeMedikamentenliste) { @@ -246,6 +249,108 @@ namespace BeWoPlanerMobil.Controllers } } } + + public ActionResult UpdateCustomer(FormCollection formCollection) + { + if(Model is null) + { + return Logout(); + } + + // ToDo: Stammdaten aus formCollection holen, validieren und Customer-Objekt aktualisieren. + + var firstname = formCollection["vorname"]; + var lastname = formCollection["nachname"]; + var geburtdatum = formCollection["geburtstag"]; + var geschlecht = formCollection["geschlecht"]; + + var adresszusatz = formCollection["adresszusatz"]; + var street = formCollection["strasse"]; + var postalCode = formCollection["plz"]; + var city = formCollection["ort"]; + + var nameInvoiceAddress = formCollection["name-rechnungsadresse"]; + var streetInvoiceAddress = formCollection["strasse-rechnungsadresse"]; + var postalCodeInvoiceAddress = formCollection["plz-rechnungsadresse"]; + var cityInvoiceAddress = formCollection["ort-rechnungsadresse"]; + + var mobile = formCollection["handy"]; + var phone = formCollection["telefon"]; + var fax = formCollection["fax"]; + var eMailAddress = formCollection["mail"]; + + var notice = formCollection["notiz"]; + + var customer = Model.SelectedCustomer; + + if(customer is null) + { + return RedirectToActionPermanent("Customer"); + } + + customer.FirstName = firstname; + customer.LastName = lastname; + + if(DateTime.TryParse(geburtdatum, out var dateOfBirth)) + { + customer.DateOfBirth = dateOfBirth; + } + + if(int.TryParse(geschlecht, out var sexIndex)) + { + var castSex = sexIndex >= 0 ? (Sex?)sexIndex : null; + + customer.Sex = castSex; + } + + customer.AddressLine1 = adresszusatz; + customer.Street = street; + customer.PostalCode = postalCode; + customer.Town = city; + + customer.InvoiceAddressLine1 = nameInvoiceAddress; + customer.InvoiceAddressStreet = streetInvoiceAddress; + customer.InvoiceAddressPostalCode = postalCodeInvoiceAddress; + customer.InvoiceAddressTown = cityInvoiceAddress; + + var mobileContactInfo = customer.ContactInformations.FirstOrDefault(contactInformation => contactInformation.ContactType == ContactType.business_MobilePhone) ?? new ContactDC { ContactType = ContactType.business_MobilePhone }; + mobileContactInfo.ContactValue = mobile; + + if(customer.ContactInformations.All(a => a.ContactType != ContactType.business_MobilePhone)) + { + customer.ContactInformations.Add(mobileContactInfo); + } + + var phoneContactInfo = customer.ContactInformations.FirstOrDefault(contactInformation => contactInformation.ContactType == ContactType.business_Phone) ?? new ContactDC { ContactType = ContactType.business_Phone }; + phoneContactInfo.ContactValue = phone; + + if(customer.ContactInformations.All(a => a.ContactType != ContactType.business_Phone)) + { + customer.ContactInformations.Add(phoneContactInfo); + } + + var faxContactInfo = customer.ContactInformations.FirstOrDefault(contactInformation => contactInformation.ContactType == ContactType.business_Fax) ?? new ContactDC { ContactType = ContactType.business_Fax }; + faxContactInfo.ContactValue = fax; + + if(customer.ContactInformations.All(a => a.ContactType != ContactType.business_Fax)) + { + customer.ContactInformations.Add(faxContactInfo); + } + + var eMailContactInfo = customer.ContactInformations.FirstOrDefault(contactInformation => contactInformation.ContactType == ContactType.business_Mail) ?? new ContactDC { ContactType = ContactType.business_Mail }; + eMailContactInfo.ContactValue = eMailAddress; + + if(customer.ContactInformations.All(a => a.ContactType != ContactType.business_Mail)) + { + customer.ContactInformations.Add(eMailContactInfo); + } + + customer.Notice = notice; + + CustomerService.UpdateCustomer(customer); + + return RedirectToActionPermanent("PreselectCustomer", new { customerOid = customer.CustomerOid }); + } } public enum CustomerReportType diff --git a/BeWoPlanerMobil/Util/JsonCustomer.cs b/BeWoPlanerMobil/Util/JsonCustomer.cs index a5cbabe9c..4d58b1b91 100644 --- a/BeWoPlanerMobil/Util/JsonCustomer.cs +++ b/BeWoPlanerMobil/Util/JsonCustomer.cs @@ -1,6 +1,8 @@ -using System.Collections.Generic; +using System; +using System.Collections.Generic; using System.Linq; using System.Web; +using System.Web.Mvc; using BS.Shared; using BS.Shared.DataContracts; using BS.Shared.Extensions; @@ -48,6 +50,8 @@ namespace BeWoPlanerMobil.Util public List AbsenceTimes { get; set; } = new List(); public List Organisations { get; set; } = new List(); + + public Sex? CustomerSex { get; set; } public JsonCustomer(CustomerDC customer, List folderTree) { @@ -71,6 +75,8 @@ namespace BeWoPlanerMobil.Util break; } + CustomerSex = customer.Sex; + Adresszusatz = customer.AddressLine1; Strasse = customer.Street; Postleitzahl = customer.PostalCode; diff --git a/BeWoPlanerMobil/Views/Customer/Customer.cshtml b/BeWoPlanerMobil/Views/Customer/Customer.cshtml index 251404490..112828600 100644 --- a/BeWoPlanerMobil/Views/Customer/Customer.cshtml +++ b/BeWoPlanerMobil/Views/Customer/Customer.cshtml @@ -1,11 +1,53 @@ @using BeWoPlanerMobil.Models; @using BeWoPlanerMobil.Util +@using BS.Shared @model CustomerModel @{ ViewBag.Title = "Klient"; } + + @if(AbstractModel.IsAllowedToSeeCustomerFilter) { @@ -36,514 +78,590 @@ @if(Model?.SelectedJsonCustomer != null) { - - - - - - Eigenschaften - - - - Vorname: - - - @Model.SelectedJsonCustomer.Vorname - - - - - Nachname: - - - @Model.SelectedJsonCustomer.Nachname - - - - - Geburtstag: - - - @Model.SelectedJsonCustomer.Geburtstag - - - - - Geschlecht: - - - @Model.SelectedJsonCustomer.Geschlecht - - - - - - - - - - Adresse - - - - Adresszusatz: - - - @Model.SelectedJsonCustomer.Adresszusatz - - - - - Straße: - - - @Model.SelectedJsonCustomer.Strasse - - - - - PLZ: - - - @Model.SelectedJsonCustomer.Postleitzahl - - - - - Ort: - - - @Model.SelectedJsonCustomer.Ort - - - - - - - - - - Rechnungsadresse - - - - Name: - - - @Model.SelectedJsonCustomer.RechnungsadresseName - - - - - Straße: - - - @Model.SelectedJsonCustomer.RechnungsadresseStrasse - - - - - PLZ: - - - @Model.SelectedJsonCustomer.RechnungsadressePostleitzahl - - - - - Ort: - - - @Model.SelectedJsonCustomer.RechnungsadresseOrt - - - - - - - - - - Kontakt - - - - Handy: - - - @Model.SelectedJsonCustomer.Handy - - - - - Telefon: - - - @Model.SelectedJsonCustomer.Telefon - - - - - Fax: - - - @Model.SelectedJsonCustomer.Fax - - - - - Mail: - - - @Model.SelectedJsonCustomer.EMail - - - - - - - - - @if (Model.SelectedJsonCustomer.Kommentar != null) - { - - - - - - - Kommentar - - - - - - - - @Model.SelectedJsonCustomer.Kommentar - - @Model.SelectedJsonCustomer.Kommentar - Abbrechen - Speichern - - - - - } - - - @if (Model.SelectedJsonCustomer.ReferenceNumbers.Any()) - { - - - - Aktenzeichen pro Kostenträger - - - - - - - - Kostenträger - - - Aktenzeichen - - - - - @foreach (var x in Model.SelectedJsonCustomer.ReferenceNumbers) - { - - - @x.Costbearer - - - @x.ReferenceNumber - - - } - - - - - - - } - - - @if (Model.SelectedJsonCustomer.Umfeldpersonen.Any()) - { - - - - Umfeld - - - - @foreach (var umfeldPerson in Model.SelectedJsonCustomer.Umfeldpersonen) - { - - - - - - - - @umfeldPerson.FormattedName - + using(Html.BeginForm("UpdateCustomer", "Customer", FormMethod.Post, new { id = "stammdaten-form" })) + { + + + + + + Eigenschaften + + + + + + + Vorname + + + - - - - - - Rolle: - - - @umfeldPerson.Rolle - + + + + + + + Nachname - - - Adresse: - - - @umfeldPerson.StrNameNr@umfeldPerson.PLZOrt - + + + + + + + + + + + Geburtstag - - - Tel.: - - - @umfeldPerson.TelNr - - - - - Mobil: - - - @umfeldPerson.Mobil - - - - - E-Mail: - - - @umfeldPerson.EMail - - - - - Fax: - - - @umfeldPerson.Fax - + + + + + - } - - - - - } + + + + + + Geschlecht + + + @{ + var selectedMale = Model.SelectedJsonCustomer.CustomerSex == Sex.Male ? "selected" : string.Empty; + var selectedFemale = Model.SelectedJsonCustomer.CustomerSex == Sex.Female ? "selected" : string.Empty; + var selectedDiverse = Model.SelectedJsonCustomer.CustomerSex == Sex.Divers ? "selected" : string.Empty; + var selectedNull = Model.SelectedJsonCustomer.CustomerSex is null ? "selected" : string.Empty; + } - - @if (Model.SelectedJsonCustomer.Organisations.Any()) - { - - - - Organisationen des Umfelds - - - - @foreach (var organisation in Model.SelectedJsonCustomer.Organisations) - { - - - - - - - - @organisation.Name - + + + Männlich + Weiblich + Divers + - - - - - - Ansprechpartner - - - @organisation.ContactPerson - + + + + + + + + + Adresse + + + + + + + Adresszusatz - - - Rolle - - - @organisation.Role - + + + + + + + + + + + Straße - - - Adresse - - - @organisation.StreetName - @if (!string.IsNullOrEmpty(organisation.StreetName) && !string.IsNullOrEmpty(organisation.ZipCode2Town)) - { - - } - @organisation.ZipCode2Town - + + + + + + + + + + + PLZ - - - Tel.: - - - @organisation.PhoneNumber - + + + + + + + + + + + Ort - - - Fax: - - - @organisation.FaxNumber - + + + + + + + + + + + + + Rechnungsadresse + + + + + + + Name - - - E-Mail: - - - @organisation.Email - + + + + + + + + + + + Straße - - - Internet: - - - @organisation.Website - + + + + + + + + + + + PLZ - - - Info - - - @organisation.Info - + + + + + + + + + + + Ort - - - Notiz - - - @organisation.Notice - + + + + + + + + + + + + + Kontakt + + + + + + + Handy + + + + + + - } - - - - - } - - - - - - Dokumente - - - - @Html.Partial("DocumentPartial", Model) - - - - - - - @if (Html.IsInDebugMode() && AbstractModel.IsAllowedToSeeMedikamentenliste && Html.IsInDebugMode()) - { - - - - Berichte - - - - @using (Html.BeginForm("SelectReport", "Customer", FormMethod.Post, new { })) - { - @Html.DropDownListFor(m => m.SelectedReportType, Model.ReportTypeItems, new { @class = "custom-select", name = "SelectedReportType" }) - - Bericht anzeigen - - - - - - - - - Medikamentenliste - - - - - - @Html.Partial("CustomerReportPartial", Model) + + + + + + Telefon + + + + + + + + - } + + + + + + Fax + + + + + + + + + + + + Mail + + + + + + + + + + + + + + @if(Model.SelectedJsonCustomer.Kommentar != null) + { + + + + + Kommentar + + + + + @Model.SelectedJsonCustomer.Kommentar + + + + + } + + + Speichern + + + + + + + + @if(Model.SelectedJsonCustomer.ReferenceNumbers.Any()) + { + + + + Aktenzeichen pro Kostenträger + + + + + + + + Kostenträger + + + Aktenzeichen + + + + + @foreach(var x in Model.SelectedJsonCustomer.ReferenceNumbers) + { + + + @x.Costbearer + + + @x.ReferenceNumber + + + } + + + + + + + } + + + @if(Model.SelectedJsonCustomer.Umfeldpersonen.Any()) + { + + + + Umfeld + + + + @foreach(var umfeldPerson in Model.SelectedJsonCustomer.Umfeldpersonen) + { + + + + + + + + @umfeldPerson.FormattedName + + + + + + + + + Rolle: + + + @umfeldPerson.Rolle + + + + + Adresse: + + + @umfeldPerson.StrNameNr@umfeldPerson.PLZOrt + + + + + Tel.: + + + @umfeldPerson.TelNr + + + + + Mobil: + + + @umfeldPerson.Mobil + + + + + E-Mail: + + + @umfeldPerson.EMail + + + + + Fax: + + + @umfeldPerson.Fax + + + + + + + } + + + + + } + + + @if(Model.SelectedJsonCustomer.Organisations.Any()) + { + + + + Organisationen des Umfelds + + + + @foreach(var organisation in Model.SelectedJsonCustomer.Organisations) + { + + + + + + + + @organisation.Name + + + + + + + + + Ansprechpartner + + + @organisation.ContactPerson + + + + + Rolle + + + @organisation.Role + + + + + Adresse + + + @organisation.StreetName + @if(!string.IsNullOrEmpty(organisation.StreetName) && !string.IsNullOrEmpty(organisation.ZipCode2Town)) + { + + } + @organisation.ZipCode2Town + + + + + Tel.: + + + @organisation.PhoneNumber + + + + + Fax: + + + @organisation.FaxNumber + + + + + E-Mail: + + + @organisation.Email + + + + + Internet: + + + @organisation.Website + + + + + Info + + + @organisation.Info + + + + + Notiz + + + @organisation.Notice + + + + + + + } + + + + + } + + + + + + Dokumente + + + + @Html.Partial("DocumentPartial", Model) + + + + + + + @if(Html.IsInDebugMode() && AbstractModel.IsAllowedToSeeMedikamentenliste && Html.IsInDebugMode()) + { + + + + Berichte + + + + @using(Html.BeginForm("SelectReport", "Customer", FormMethod.Post, new { })) + { + @Html.DropDownListFor(m => m.SelectedReportType, Model.ReportTypeItems, new { @class = "custom-select", name = "SelectedReportType" }) + + Bericht anzeigen + + + + + + + + + Medikamentenliste + + + + + + @Html.Partial("CustomerReportPartial", Model) + + + + } + + + + + } - - } - + } } \ No newline at end of file diff --git a/BeWoPlanerMobil/Views/Scheduler/OneDaySchedulerPartial.cshtml b/BeWoPlanerMobil/Views/Scheduler/OneDaySchedulerPartial.cshtml index 3606f5458..8ea0a417a 100644 --- a/BeWoPlanerMobil/Views/Scheduler/OneDaySchedulerPartial.cshtml +++ b/BeWoPlanerMobil/Views/Scheduler/OneDaySchedulerPartial.cshtml @@ -10,6 +10,14 @@ logError(error); } } + + function copyToServiceRecord(appointmentOid) { + try { + + } catch(error) { + logError(error); + } + } @* Ganztagestermine in eine Liste mit weniger Margin und Padding *@ @@ -41,7 +49,7 @@ @if(appointment.IsException) { - + @@ -134,7 +142,7 @@ @if(appointment.IsException) { - + @@ -194,6 +202,18 @@ + + + + + + + + + + + + } }