From 529275418ce48747db42fa64e8fea41ad3296ed4 Mon Sep 17 00:00:00 2001 From: Lyndon Date: Fri, 27 Jun 2025 13:11:10 +0200 Subject: [PATCH] =?UTF-8?q?Das=20=C3=9Cbertragen=20eines=20Kalendertermins?= =?UTF-8?q?=20in=20die=20Zeiterfassung=20geht=20wieder=20und=20wird=20korr?= =?UTF-8?q?ekt=20im=20Kalender=20als=20=C3=BCbertragen=20angezeigt.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- BeWo/ViewModel/OrganisationVM.cs | 6 +- .../Controllers/AbstractBaseController.cs | 2 +- .../Controllers/DebuggingToolsController.cs | 23 +-- BeWoPlanerMobil/Controllers/MainController.cs | 109 +++++------ .../Controllers/SchedulerController.cs | 1 + BeWoPlanerMobil/Models/DebuggingToolsModel.cs | 49 ++++- BeWoPlanerMobil/Models/MainModel.cs | 107 ++++++++--- BeWoPlanerMobil/Models/MainSessionModel.cs | 12 +- .../Util/FormCollectionConstants.cs | 3 +- .../Views/Main/GroupBookingFormPartial.cshtml | 2 +- BeWoPlanerMobil/Views/Main/Main.cshtml | 179 +++++++++--------- .../Main/ServiceRecordListPartial.cshtml | 3 +- .../Views/Main/SingleBookingPartial.cshtml | 2 +- Data/Access/OrganisationDAO.cs | 5 - Data/Entities/Light/OrganisationLight.cs | 4 +- Data/Entities/Organisation.cs | 4 +- Data/Entities/Organisation2Person.cs | 2 - Data/Mappings/Organisation.hbm.xml | 2 +- Host/Host.csproj.user | 2 +- ...nisation Datenannahmestellen Addressen.txt | 6 +- .../OrganisationDC_Organisation.cs | 4 +- .../ClientPartials/Organisation2PersonDC.cs | 11 +- .../OrganisationPersonRelationDC.cs | 17 +- .../Light/OrganisationLightDC.cs | 7 +- Shared/DataContracts/Organisation2PersonDC.cs | 3 +- Shared/DataContracts/OrganisationDC.cs | 8 +- 26 files changed, 307 insertions(+), 266 deletions(-) diff --git a/BeWo/ViewModel/OrganisationVM.cs b/BeWo/ViewModel/OrganisationVM.cs index e2a6a9bdd..b2340d54e 100644 --- a/BeWo/ViewModel/OrganisationVM.cs +++ b/BeWo/ViewModel/OrganisationVM.cs @@ -1004,7 +1004,7 @@ namespace BeWo.ViewModel ? new AddressVM(dc2) : new AddressVM(); - GroßkundenanschriftDatenannahmestelle = pDataContract.GroßkundenanschriftDatenannahmestelle is AddressDC dc3 + GroßkundenanschriftDatenannahmestelle = pDataContract.GrosskundenanschriftDatenannahmestelle is AddressDC dc3 ? new AddressVM(dc3) : new AddressVM(); @@ -1109,9 +1109,9 @@ namespace BeWo.ViewModel pDataContract.PostfachanschriftDatenannahmestelle = null; if (GroßkundenanschriftDatenannahmestelle is object) - pDataContract.GroßkundenanschriftDatenannahmestelle = GroßkundenanschriftDatenannahmestelle.CommitToDataContract(); + pDataContract.GrosskundenanschriftDatenannahmestelle = GroßkundenanschriftDatenannahmestelle.CommitToDataContract(); else - pDataContract.GroßkundenanschriftDatenannahmestelle = null; + pDataContract.GrosskundenanschriftDatenannahmestelle = null; return pDataContract; } diff --git a/BeWoPlanerMobil/Controllers/AbstractBaseController.cs b/BeWoPlanerMobil/Controllers/AbstractBaseController.cs index 24d56dddc..2140ff168 100644 --- a/BeWoPlanerMobil/Controllers/AbstractBaseController.cs +++ b/BeWoPlanerMobil/Controllers/AbstractBaseController.cs @@ -40,7 +40,7 @@ namespace BeWoPlanerMobil.Controllers protected ActionResult Logout() { #if DEBUG - Debug.WriteLine($"+++>Logout aufrufende Methode: {(new StackTrace()).GetFrame(1).GetMethod().Name}"); + Debug.WriteLine($"+++>Logout aufrufende Methode: {new StackTrace().GetFrame(1).GetMethod().Name}"); #endif MobileSessionFacade.LogUserOut(); diff --git a/BeWoPlanerMobil/Controllers/DebuggingToolsController.cs b/BeWoPlanerMobil/Controllers/DebuggingToolsController.cs index b1aace0ee..21a68fb19 100644 --- a/BeWoPlanerMobil/Controllers/DebuggingToolsController.cs +++ b/BeWoPlanerMobil/Controllers/DebuggingToolsController.cs @@ -1,10 +1,6 @@ -using System.Collections.Generic; -using System.Linq; -using System.Web.Mvc; +using System.Web.Mvc; using BeWoPlanerMobil.Models; using BeWoPlanerMobil.Service; -using BeWoPlanerMobil.Util; -using BS.Shared.Core; namespace BeWoPlanerMobil.Controllers { @@ -21,23 +17,12 @@ namespace BeWoPlanerMobil.Controllers return null; } - if (_Model == null) + if(_Model is null) { _Model = new DebuggingToolsModel(); InitModel(_Model); } - //if (((DebuggingToolsModel)Session[ModelSessionConstants.DebuggingToolsModelKey])?.LoggedInEmployee is null) - //{ - // _Model = new DebuggingToolsModel(); - // InitModel(_Model); - // Session[ModelSessionConstants.DebuggingToolsModelKey] = _Model; - //} - //else - //{ - // _Model = (DebuggingToolsModel) Session[ModelSessionConstants.DebuggingToolsModelKey]; - //} - return _Model; } } @@ -50,14 +35,14 @@ namespace BeWoPlanerMobil.Controllers return RedirectToActionPermanent("Index", "Login"); } - Model.MandatorSettings = new MandatorSettings(MobileSessionFacade.Mandator.Settings); - return View(Model); } [Authorize] public ActionResult LoadSettingsPartial() { + Model.MandatorSettings = new MandatorSettings(MobileSessionFacade.Mandator.Settings); + return PartialView("DevToolsSettingsPartial", Model); } diff --git a/BeWoPlanerMobil/Controllers/MainController.cs b/BeWoPlanerMobil/Controllers/MainController.cs index 91b22c399..25c0613de 100644 --- a/BeWoPlanerMobil/Controllers/MainController.cs +++ b/BeWoPlanerMobil/Controllers/MainController.cs @@ -1,21 +1,12 @@ -using System; -using System.Collections.Generic; -using System.Drawing; -using System.Linq; -using System.Net; -using System.Net.Sockets; -using System.Text; -using System.Web.Mvc; -using System.Windows.Forms; +using BeWo.Data.Access; +using BeWo.Data.Entities; +using BeWo.Service.DCEntityMapper; using BeWo.Service.Plugins; using BeWo.Service.ServiceImplementations; using BeWo.View.Navigation.Filter; using BeWoPlanerMobil.Models; using BeWoPlanerMobil.Service; using BeWoPlanerMobil.Util; - -using static BeWoPlanerMobil.Util.MobileUtils; - using BS.Shared; using BS.Shared.Core; using BS.Shared.DataContracts; @@ -24,15 +15,23 @@ using BS.Shared.Extensions; using BS.Shared.Services; using DevExpress.XtraScheduler; using DevExpress.XtraScheduler.Compatibility; +using DevExpress.XtraScheduler.Native; using Newtonsoft.Json; +using System; +using System.Collections.Generic; +using System.Drawing; +using System.Linq; +using System.Net; +using System.Net.Sockets; +using System.Text; +using System.Web.Mvc; +using System.Windows.Forms; +using static BeWoPlanerMobil.Util.MobileUtils; using static BS.Shared.ServiceRecordValidationResult; using FormCollection = System.Web.Mvc.FormCollection; using GoalRating = BeWoPlanerMobil.Util.GoalRating; using Image = System.Drawing.Image; using ServiceRecordDC = BS.Shared.DataContracts.ServiceRecordDC; -using BeWo.Data.Access; -using BeWo.Service.DCEntityMapper; -using BeWo.Data.Entities; /* * ToDo: Bug, wenn man auf "bearbeiten" bei einem Eintrag klickt, wird die Leistung nicht geladen @@ -54,24 +53,13 @@ namespace BeWoPlanerMobil.Controllers return null; } - if (_Model == null) + if(_Model is null) { _Model = new MainModel(); InitModel(_Model); InitViewModel(); } - //if(((MainModel) Session[ModelSessionConstants.MainModelKey])?.LoggedInEmployee is null) - //{ - // _Model = new MainModel(); - // InitModel(_Model); - // Session[ModelSessionConstants.MainModelKey] = _Model; - //} - //else - //{ - // _Model = (MainModel) Session[ModelSessionConstants.MainModelKey]; - //} - return _Model; } } @@ -141,7 +129,6 @@ namespace BeWoPlanerMobil.Controllers Model.Employees = Model.Employees.OrderBy(e => e.LastName).ThenBy(e => e.FirstName).ToList(); - Model.SelectedConceptCostBearerRelations = new List(); Model.MultiBookingSelectedConceptCostBearerRelations = new List(); @@ -152,14 +139,9 @@ namespace BeWoPlanerMobil.Controllers private void SetSelectedObjects() { - if (Model.SelectedEmployeeOid.HasValue) - { - Model.SelectedEmployee = Model.AllEmployees.First(f => f.EmployeeOid.Equals(Model.SelectedEmployeeOid.Value)); - } - else - { - Model.SelectedEmployee = LoggedInUser.Employee; - } + Model.SelectedEmployee = Model.SelectedEmployeeOid.HasValue ? + Model.AllEmployees.First(f => f.EmployeeOid.Equals(Model.SelectedEmployeeOid.Value)) : + LoggedInUser.Employee; var isInList = Model.SelectedCostBearerSupportConceptOid.HasValue && Model.SupportConceptListObjects.Exists(s => s.CostBearer2SupportConceptOid == Model.SelectedCostBearerSupportConceptOid); @@ -379,7 +361,7 @@ namespace BeWoPlanerMobil.Controllers return Logout(); } - if (!Model.SessionInitialized) + if(!Model.SessionInitialized) { Model.SessionInitialized = true; var mokSessionTimeout = UserSettingsUtils.GetSettingValueAsInteger(Model.Mandator.Settings, SettingsKeys.MoKSessionTimeout, 20); @@ -407,10 +389,7 @@ namespace BeWoPlanerMobil.Controllers TempData[TempDataConstants.ShowPwChPopupKey] = tempDataValue; } } - - } - } catch(Exception e) { @@ -420,9 +399,6 @@ namespace BeWoPlanerMobil.Controllers return View(Model); } - - - [Authorize] private void UpdateSettings(string key, string value) { @@ -1063,9 +1039,9 @@ namespace BeWoPlanerMobil.Controllers // Falls ein Termin in die Zeiterfassung übernommen werden soll SchedulerAppointmentDC appointmentPrototype = null; - if(TempData[TempDataConstants.AppointmentOidKey] != null && Int64.TryParse(TempData[TempDataConstants.AppointmentOidKey].ToString(), out var appOid) && Model.LoggedInEmployee.EmployeeOid.HasValue) + if(Model.TransferringAppointmentOid.HasValue && Model.LoggedInEmployee.EmployeeOid.HasValue) { - var app = DAOFactory.GenericDAO.LoadByID(appOid); + var app = DAOFactory.GenericDAO.LoadByID(Model.TransferringAppointmentOid.Value); appointmentPrototype = MapperFactory.SchedulerAppointmentDCSchedulerAppointment.MapToNewDC(app); } @@ -1299,7 +1275,7 @@ namespace BeWoPlanerMobil.Controllers TempData[TempDataConstants.ShowSignatureSuggestionPopup] = true; } - if(!(appointmentPrototype is null)) + if(appointmentPrototype is object) { var isRecurring = !(appointmentPrototype.RecurrenceInfo is null); @@ -1329,7 +1305,7 @@ namespace BeWoPlanerMobil.Controllers } } - if(!(appointmentPrototype is null)) + if(appointmentPrototype is object) { var serviceRecord = OperationsService.GetServiceRecordById(Model.LastCreatedServiceRecordOid); @@ -1438,9 +1414,9 @@ namespace BeWoPlanerMobil.Controllers var serviceRecords = groupDC.ServiceRecordList; - if (TempData[TempDataConstants.AppointmentOidKey] != null && Int64.TryParse(TempData[TempDataConstants.AppointmentOidKey].ToString(), out var appOid) && Model.LoggedInEmployee.EmployeeOid.HasValue) + if(Model.TransferringAppointmentOid.HasValue && Model.LoggedInEmployee.EmployeeOid.HasValue) { - var app = DAOFactory.GenericDAO.LoadByID(appOid); + var app = DAOFactory.GenericDAO.LoadByID(Model.TransferringAppointmentOid.Value); var appointment = MapperFactory.SchedulerAppointmentDCSchedulerAppointment.MapToNewDC(app); appointment.ServiceRecordList.AddRange(serviceRecords); @@ -3112,8 +3088,8 @@ namespace BeWoPlanerMobil.Controllers return Logout(); } - TempData[TempDataConstants.IsInTransferModeKey] = null; - TempData[TempDataConstants.AppointmentOidKey] = null; + Model.TransferringAppointmentOid = null; + Model.IsInTransferMode = false; var bookingMode = "true,false" == pFormCollection[FormCollectionConstants.IsInGroupBookingModeKey] ? BookingMode.GroupBookingMode : BookingMode.SingleBookingMode; @@ -3289,6 +3265,9 @@ namespace BeWoPlanerMobil.Controllers ResetModel(); + Model.TransferringAppointmentOid = null; + Model.IsInTransferMode = false; + return RedirectToActionPermanent("Main"); } @@ -3302,6 +3281,9 @@ namespace BeWoPlanerMobil.Controllers return Logout(); } + Model.TransferringAppointmentOid = null; + Model.IsInTransferMode = false; + ResetModel(); return RedirectToScheduler(); @@ -3315,8 +3297,6 @@ namespace BeWoPlanerMobil.Controllers return; } - TempData[TempDataConstants.AppointmentOidKey] = null; - TempData[TempDataConstants.IsInTransferModeKey] = null; TempData[TempDataConstants.AfterValidationStateKey] = null; Model.NewServiceRecord = new ServiceRecordDC(); @@ -3840,16 +3820,12 @@ namespace BeWoPlanerMobil.Controllers Model.NewServiceRecord.InsUser = MobileSessionFacade.EmployeeFullname; Model.NewServiceRecord.IsCreatedInMobileClient = true; - - - - if(Model.SetStartTimeToEndTimeAfterSave) { var previousStartDate = Model.IsInEditingMode ? Model.SelectedServiceRecord?.Start : Model.NewServiceRecord?.Start; var previousEndDate = Model.IsInEditingMode ? Model.SelectedServiceRecord?.End : Model.NewServiceRecord?.End; - if(!(previousStartDate is null) && !(previousEndDate is null)) + if(previousStartDate.HasValue && previousEndDate.HasValue) { var duration = (previousEndDate - previousStartDate).Value.TotalMinutes; @@ -3889,7 +3865,7 @@ namespace BeWoPlanerMobil.Controllers /// /// Bereitet die Übernahme eines Termins in die Zeiterfassung vor. Wird im SchedulerController aufgerufen. /// - /// + /// Main.cshtml [Authorize] public ActionResult PrepareServiceRecordInsert() { @@ -3899,11 +3875,11 @@ namespace BeWoPlanerMobil.Controllers return Logout(); } - if (TempData[TempDataConstants.AppointmentOidKey] != null && Int64.TryParse(TempData[TempDataConstants.AppointmentOidKey].ToString(), out var appOid) && Model.LoggedInEmployee.EmployeeOid.HasValue) - { - TempData[TempDataConstants.IsInTransferModeKey] = true; + Model.TransferringAppointmentOid = TempData[TempDataConstants.AppointmentOidKey] as long?; - var app = DAOFactory.GenericDAO.LoadByID(appOid); + if(Model.TransferringAppointmentOid.HasValue && Model.LoggedInEmployee.EmployeeOid.HasValue) + { + var app = DAOFactory.GenericDAO.LoadByID(Model.TransferringAppointmentOid.Value); var appointment = MapperFactory.SchedulerAppointmentDCSchedulerAppointment.MapToNewDC(app); @@ -4043,7 +4019,8 @@ namespace BeWoPlanerMobil.Controllers Model.SelectedServiceRecordOid = Model.SelectedServiceRecord?.ServiceRecordOid; - TempData[TempDataConstants.AppointmentOidKey] = appointment?.SchedulerAppointmentOid; + Model.TransferringAppointmentOid = appointment.SchedulerAppointmentOid; + Model.IsInTransferMode = true; } return View("Main", Model); @@ -4297,8 +4274,8 @@ namespace BeWoPlanerMobil.Controllers return Logout(); } - TempData[TempDataConstants.IsInTransferModeKey] = null; - TempData[TempDataConstants.AppointmentOidKey] = null; + Model.IsInTransferMode = false; + Model.TransferringAppointmentOid = null; try { diff --git a/BeWoPlanerMobil/Controllers/SchedulerController.cs b/BeWoPlanerMobil/Controllers/SchedulerController.cs index 735d9dd9c..3fb1047c2 100644 --- a/BeWoPlanerMobil/Controllers/SchedulerController.cs +++ b/BeWoPlanerMobil/Controllers/SchedulerController.cs @@ -1437,6 +1437,7 @@ namespace BeWoPlanerMobil.Controllers TempData[TempDataConstants.AppointmentOidKey] = appointmentListItem.SchedulerAppointment?.SchedulerAppointmentOid; + return RedirectToActionPermanent("PrepareServiceRecordInsert", "Main"); } diff --git a/BeWoPlanerMobil/Models/DebuggingToolsModel.cs b/BeWoPlanerMobil/Models/DebuggingToolsModel.cs index 32ef0e2bf..1a8f49bc9 100644 --- a/BeWoPlanerMobil/Models/DebuggingToolsModel.cs +++ b/BeWoPlanerMobil/Models/DebuggingToolsModel.cs @@ -1,4 +1,5 @@ -using System.Collections.Generic; +using System; +using System.Collections.Generic; using BS.Shared; using BS.Shared.DataContracts; using BS.Shared.Extensions; @@ -39,14 +40,43 @@ namespace BeWoPlanerMobil.Models get => typeof(MandatorSettings).GetPropertyValue(propertyName); set { - var property = typeof(MandatorSettings).GetProperty(propertyName); + var propertyInfo = typeof(MandatorSettings).GetProperty(propertyName); - if(property is null) + if(propertyInfo is null) { return; } - typeof(MandatorSettings).SetPropertyValue(propertyName, value); + if(value is null) + { + typeof(MandatorSettings).SetPropertyValue(propertyName, value); + return; + } + + var propertyType = propertyInfo.PropertyType; + + var valueToReplace = value; + + if(propertyType == typeof(bool)) + { + typeof(MandatorSettings).SetPropertyValue(propertyName, value.ToString() == "1"); + } + else + { + try + { + valueToReplace = Convert.ChangeType(value, propertyType); + } + catch(Exception exception) + { + valueToReplace = value; + } + finally + { + typeof(MandatorSettings).SetPropertyValue(propertyName, valueToReplace); + var setValue = typeof(MandatorSettings).GetPropertyValue(propertyName); + } + } } } @@ -61,14 +91,20 @@ namespace BeWoPlanerMobil.Models public bool IsEndDateVisible { get; set; } public bool IsServiceRecordNoticeMandatory { get; set; } public bool IsZeiterfassDateNormal { get; set; } - public bool SetStartTimeToEndTimeAfterSave { get; set; } public bool ShowAdditionalService { get; set; } public bool ShowAnnualReport { get; set; } public bool ShowArbeitszeiten { get; set; } public bool ShowBetrag { get; set; } public bool ShowChat { get; set; } - public bool ShowCustomerDistanceFields { get; set; } + private bool _ShowCustomerDistanceFields; + + public bool ShowCustomerDistanceFields + { + get => _ShowCustomerDistanceFields; + + set => _ShowCustomerDistanceFields = value; + } public bool ShowDatevFields { get; set; } public bool ShowDienstplanung { get; set; } public bool ShowDistanceFields { get; set; } @@ -99,7 +135,6 @@ namespace BeWoPlanerMobil.Models public bool PrinterSettingsUseMargins { get; set; } public bool PrinterSettingsUsePaperKind { get; set; } public bool ShowResources { get; set; } - public int MaxDaysEditServiceRecordsAllowed { get; set; } public int ZeiterfassungsSchwellwert { get; set; } public int AnzTageZeiterfassErfolgt { get; set; } diff --git a/BeWoPlanerMobil/Models/MainModel.cs b/BeWoPlanerMobil/Models/MainModel.cs index ee0fbb059..28806fc11 100644 --- a/BeWoPlanerMobil/Models/MainModel.cs +++ b/BeWoPlanerMobil/Models/MainModel.cs @@ -5,7 +5,6 @@ using System.Diagnostics; using System.Linq; using System.Web.Mvc; using BeWo.View.Navigation.Filter; -using BeWoPlanerMobil.Service; using BeWoPlanerMobil.Util; using BS.Shared; using BS.Shared.DataContracts; @@ -29,23 +28,48 @@ namespace BeWoPlanerMobil.Models ErrorWert = 1; } - public MainSessionModel MainSessionModel + public MainSessionModel MainSessionModel => SessionModel as MainSessionModel; + + public bool SessionInitialized { - get - { - return SessionModel as MainSessionModel; - } + get => MainSessionModel.SessionInitialized; + set => MainSessionModel.SessionInitialized = value; } - public bool SessionInitialized { get { return MainSessionModel.SessionInitialized; } set { MainSessionModel.SessionInitialized = value; } } - [Display(Name = "Nur meine Klienten anzeigen")] - public bool ShowOnlyOwnSupportConcepts { get { return MainSessionModel.ShowOnlyOwnSupportConcepts; } set { MainSessionModel.ShowOnlyOwnSupportConcepts = value; } } + public bool ShowOnlyOwnSupportConcepts + { + get => MainSessionModel.ShowOnlyOwnSupportConcepts; + set => MainSessionModel.ShowOnlyOwnSupportConcepts = value; + } [Display(Name = "Nur Klienten meiner Teams anzeigen")] - public bool ShowOnlyMyTeamsSupportConcepts { get { return MainSessionModel.ShowOnlyMyTeamsSupportConcepts; } set { MainSessionModel.ShowOnlyMyTeamsSupportConcepts = value; } } + public bool ShowOnlyMyTeamsSupportConcepts + { + get => MainSessionModel.ShowOnlyMyTeamsSupportConcepts; + set => MainSessionModel.ShowOnlyMyTeamsSupportConcepts = value; + } - public CustomerFilterEnum SelectedSupportConceptFilter { get { return MainSessionModel.SelectedSupportConceptFilter; } set { MainSessionModel.SelectedSupportConceptFilter = value; } } + public CustomerFilterEnum SelectedSupportConceptFilter + { + get => MainSessionModel.SelectedSupportConceptFilter; + set => MainSessionModel.SelectedSupportConceptFilter = value; + } + + public long? TransferringAppointmentOid + { + get => MainSessionModel.TransferringAppointmentOid; + + set + { + var callingMethodName = new StackTrace().GetFrame(1).GetMethod().Name; + + Debug.WriteLine($">>>>{callingMethodName} ändert TransferringAppointment von {MainSessionModel.TransferringAppointmentOid} zu {value}"); + + MainSessionModel.TransferringAppointmentOid = value; + } + } + public bool IsInTransferMode { get; set; } public List SupportConceptFilter { @@ -113,14 +137,28 @@ namespace BeWoPlanerMobil.Models } [Display(Name = "Abgelaufene Hilfepläne anzeigen")] - public bool ShowExpiredSupportConcepts { get { return MainSessionModel.ShowExpiredSupportConcepts; } set { MainSessionModel.ShowExpiredSupportConcepts = value; } } + public bool ShowExpiredSupportConcepts + { + get => MainSessionModel.ShowExpiredSupportConcepts; + set => MainSessionModel.ShowExpiredSupportConcepts = value; + } [Display(Name = "Hilfeplan")] - public long? SelectedCostBearerSupportConceptOid { get { return MainSessionModel.SelectedCostBearerSupportConceptOid; } set { MainSessionModel.SelectedCostBearerSupportConceptOid = value; } } + public long? SelectedCostBearerSupportConceptOid + { + get => MainSessionModel.SelectedCostBearerSupportConceptOid; + set => MainSessionModel.SelectedCostBearerSupportConceptOid = value; + } - public long? SelectedServiceCategoryOid { get { return MainSessionModel.SelectedServiceCategoryOid; } set { MainSessionModel.SelectedServiceCategoryOid = value; } } + public long? SelectedServiceCategoryOid + { + get => MainSessionModel.SelectedServiceCategoryOid; + set => MainSessionModel.SelectedServiceCategoryOid = value; + } - public long? SelectedServiceDescriptionOid { get { return MainSessionModel.SelectedServiceDescriptionOid; } set { MainSessionModel.SelectedServiceDescriptionOid = value; } } + public long? SelectedServiceDescriptionOid { get => MainSessionModel.SelectedServiceDescriptionOid; + set => MainSessionModel.SelectedServiceDescriptionOid = value; + } public bool IsAllowedToDeleteServiceRecord(ServiceRecordDC serviceRecord) @@ -195,11 +233,19 @@ namespace BeWoPlanerMobil.Models return allowed; } - public long? SelectedServiceRecordOid { get { return MainSessionModel.SelectedServiceRecordOid; } set { MainSessionModel.SelectedServiceRecordOid = value; } } + public long? SelectedServiceRecordOid + { + get => MainSessionModel.SelectedServiceRecordOid; + set => MainSessionModel.SelectedServiceRecordOid = value; + } public ServiceRecordDC SelectedServiceRecord { get; set; } - public long? SelectedSupportConceptOid { get { return MainSessionModel.SelectedSupportConceptOid; } set { MainSessionModel.SelectedSupportConceptOid = value; } } + public long? SelectedSupportConceptOid + { + get => MainSessionModel.SelectedSupportConceptOid; + set => MainSessionModel.SelectedSupportConceptOid = value; + } public SupportConceptDC SelectedSupportConcept { get; set; } @@ -209,7 +255,9 @@ namespace BeWoPlanerMobil.Models public bool ShowSignature { get; set; } - public long LastCreatedServiceRecordOid { get { return MainSessionModel.LastCreatedServiceRecordOid; } set { MainSessionModel.LastCreatedServiceRecordOid = value; } } + public long LastCreatedServiceRecordOid { get => MainSessionModel.LastCreatedServiceRecordOid; + set => MainSessionModel.LastCreatedServiceRecordOid = value; + } public List SupportConcepts { get; set; } @@ -223,17 +271,22 @@ namespace BeWoPlanerMobil.Models { get { - if(_ServiceRecords == null) + if(_ServiceRecords is null) { return _ServiceRecords = new List(); } return _ServiceRecords.OrderByDescending(sr => sr.Start).ToList(); } + set => _ServiceRecords = value; } - public List SelectedGoalOids { get { return MainSessionModel.SelectedGoalOids; } set { MainSessionModel.SelectedGoalOids = value; } } + public List SelectedGoalOids + { + get => MainSessionModel.SelectedGoalOids; + set => MainSessionModel.SelectedGoalOids = value; + } private List _SelectedGoals; @@ -282,7 +335,7 @@ namespace BeWoPlanerMobil.Models public List SelectedConceptCostBearerRelationOids { get { return MainSessionModel.SelectedConceptCostBearerRelations; } set { MainSessionModel.SelectedConceptCostBearerRelations = value; } } - public List SelectedConceptCostBearerRelations { get; set; } + public List SelectedConceptCostBearerRelations { get; set; } = new List(); public GroupBookingSelectionObject GroupBookingSelectionObject => new GroupBookingSelectionObject(SelectedConceptCostBearerRelations, GroupBookingSelectedGroupOfPeopleOids); @@ -321,7 +374,11 @@ namespace BeWoPlanerMobil.Models public List AllEmployees { get; set; } [Display(Name = "Mitarbeiter")] - public long? SelectedEmployeeOid { get { return MainSessionModel.SelectedEmployeeOid; } set { MainSessionModel.SelectedEmployeeOid = value; } } + public long? SelectedEmployeeOid + { + get => MainSessionModel.SelectedEmployeeOid; + set => MainSessionModel.SelectedEmployeeOid = value; + } public CompactEmployeeDC SelectedEmployee { get; set; } @@ -352,7 +409,7 @@ namespace BeWoPlanerMobil.Models { var end = relation.ApprovedEndDate ?? relation.RequestedEndDate; - if(maxDate == null || end != null && end.Value > maxDate.Value) + if(maxDate is null || end != null && end.Value > maxDate.Value) { maxDate = end; } @@ -703,7 +760,7 @@ namespace BeWoPlanerMobil.Models public List MultiBookingSelectedGroupOfPeopleOids { get { return MainSessionModel.MultiBookingSelectedGroupOfPeopleOids; } set { MainSessionModel.MultiBookingSelectedGroupOfPeopleOids = value; } } - public List MultiBookingSelectedConceptCostBearerRelations { get; set; } + public List MultiBookingSelectedConceptCostBearerRelations { get; set; } = new List(); public GroupBookingSelectionObject MultiBookingSelectionObject => new GroupBookingSelectionObject(MultiBookingSelectedConceptCostBearerRelations, MultiBookingSelectedGroupOfPeopleOids); @@ -720,7 +777,7 @@ 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 CostBearer2SupportConceptRelListObject( $"{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}", diff --git a/BeWoPlanerMobil/Models/MainSessionModel.cs b/BeWoPlanerMobil/Models/MainSessionModel.cs index 79697ee9e..579237d43 100644 --- a/BeWoPlanerMobil/Models/MainSessionModel.cs +++ b/BeWoPlanerMobil/Models/MainSessionModel.cs @@ -1,16 +1,7 @@ using System; using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.Linq; -using System.Web.Mvc; using BeWo.View.Navigation.Filter; -using BeWoPlanerMobil.Controllers; -using BeWoPlanerMobil.Service; using BeWoPlanerMobil.Util; -using BS.Shared; -using BS.Shared.DataContracts; -using BS.Shared.DataContracts.Compact; -using DevExpress.XtraReports.UI; namespace BeWoPlanerMobil.Models { @@ -46,6 +37,7 @@ namespace BeWoPlanerMobil.Models public int CurrentPage { get; internal set; } public List SelectedGoalOids { get; internal set; } public long LastCreatedServiceRecordOid { get; internal set; } + public long? TransferringAppointmentOid { get; internal set; } public void ResetValues() { @@ -83,6 +75,8 @@ namespace BeWoPlanerMobil.Models CurrentPage = 0; LastCreatedServiceRecordOid = 0; + + TransferringAppointmentOid = null; } } } \ No newline at end of file diff --git a/BeWoPlanerMobil/Util/FormCollectionConstants.cs b/BeWoPlanerMobil/Util/FormCollectionConstants.cs index 285cb8ae7..382f80294 100644 --- a/BeWoPlanerMobil/Util/FormCollectionConstants.cs +++ b/BeWoPlanerMobil/Util/FormCollectionConstants.cs @@ -71,8 +71,6 @@ public class TempDataConstants { public static string ShowSignatureSuggestionPopup => "ShowSignatureSuggestionPopup"; - public static string AppointmentOidKey => "AppointmentOid"; - public static string IsInTransferModeKey => "IsInTransferMode"; public static string AfterValidationStateKey => "AfterValidation"; public static string PwChErrKey => "passwd-change-error"; public static string ShowPwChPopupKey => "show_pw_change_popup"; @@ -85,5 +83,6 @@ public static string ErrorAlertPopupMessage => "ErrorAlertPopupMessage"; public static string InfoMessageKey => "InfoMessage"; public static string ReportMessageKey => "ReportMessage"; + public static string AppointmentOidKey => "AppointmentOid"; } } \ No newline at end of file diff --git a/BeWoPlanerMobil/Views/Main/GroupBookingFormPartial.cshtml b/BeWoPlanerMobil/Views/Main/GroupBookingFormPartial.cshtml index 778f042be..028174d84 100644 --- a/BeWoPlanerMobil/Views/Main/GroupBookingFormPartial.cshtml +++ b/BeWoPlanerMobil/Views/Main/GroupBookingFormPartial.cshtml @@ -338,7 +338,7 @@ @* dient nur als Abstandshalter *@
- @if(TempData[TempDataConstants.IsInTransferModeKey] is bool isInTransferMode && isInTransferMode) + @if(Model.IsInTransferMode) { using(Html.BeginForm("ResetTransferMode", "Main", FormMethod.Post)) { diff --git a/BeWoPlanerMobil/Views/Main/Main.cshtml b/BeWoPlanerMobil/Views/Main/Main.cshtml index 8262935e9..c349ef35e 100644 --- a/BeWoPlanerMobil/Views/Main/Main.cshtml +++ b/BeWoPlanerMobil/Views/Main/Main.cshtml @@ -114,114 +114,121 @@ window.saveCollapsibleState($(this).attr("id"), "@Url.Action("SaveCollapsibleStatus")"); }); - @if(TempData[TempDataConstants.PwChErrKey] is string passwordChangeError) - { - - $("#password-change-error-alert").html("@passwordChangeError"); - $("#password-change-error-alert").removeClass("d-none"); - $("#password-changing-popup").modal("show"); + @if(TempData[TempDataConstants.PwChErrKey] is string passwordChangeError) + { + + $("#password-change-error-alert").html("@passwordChangeError"); + $("#password-change-error-alert").removeClass("d-none"); + $("#password-changing-popup").modal("show"); - $(".pw-prepend").ready(calcChPwPrepend); - - } + $(".pw-prepend").ready(calcChPwPrepend); + + } - const supportConceptOid = parseInt($("#CostBearer2SupportConceptOid").val()); + const supportConceptOid = parseInt($("#CostBearer2SupportConceptOid").val()); - const isSupportConceptSelected = supportConceptOid !== -1; + const isSupportConceptSelected = supportConceptOid !== -1; - $("#single-booking-employee-container").find(".dropdown-toggle").prop("disabled", (isSupportConceptSelected ? false : true)); + $("#single-booking-employee-container").find(".dropdown-toggle").prop("disabled", (isSupportConceptSelected ? false : true)); - $( + $( "#employeesDropDown, " + "#category-select, " + "#leistung-select, " + - "#sb-start-date-input, #sb-end-date-input, #sb-start-time-input, #sb-end-time-input, " + - "#sb-duration-input, #sb-hours-minutes-dropdown-btn, #sb-distance-input, " + + "#sb-start-date-input, #sb-end-date-input, #sb-start-time-input, #sb-end-time-input, " + + "#sb-duration-input, #sb-hours-minutes-dropdown-btn, #sb-distance-input, " + - "#gb-start-date-input, #gb-end-date-input, #gb-start-time-input, #gb-end-time-input, " + - "#gb-duration-input, #gb-hours-minutes-dropdown-btn, #gb-distance-input, " + + "#gb-start-date-input, #gb-end-date-input, #gb-start-time-input, #gb-end-time-input, " + + "#gb-duration-input, #gb-hours-minutes-dropdown-btn, #gb-distance-input, " + - "#mb-start-date-input, #mb-end-date-input, #mb-start-time-input, #mb-end-time-input, " + - "#mb-duration-input, #mb-hours-minutes-dropdown-btn, #mb-distance-input," + - ".sb-restore-btn, .gb-restore-btn, .mb-restore-btn" + + "#mb-start-date-input, #mb-end-date-input, #mb-start-time-input, #mb-end-time-input, " + + "#mb-duration-input, #mb-hours-minutes-dropdown-btn, #mb-distance-input," + + ".sb-restore-btn, .gb-restore-btn, .mb-restore-btn" + - "#textbausteine-button, " + - "#goals-button, " + - "textarea, " + - "#reset-button, " + - "#create-button, " + - "#statistics-button, " + - "#timeFrameSelect, " + - "#marker-cb, " + - "#betrag" + "#textbausteine-button, " + + "#goals-button, " + + "textarea, " + + "#reset-button, " + + "#create-button, " + + "#statistics-button, " + + "#timeFrameSelect, " + + "#marker-cb, " + + "#betrag" ).prop("disabled", (isSupportConceptSelected ? false : true)); - if("@Model.IsInGroupBookingMode".toLowerCase() === "true") { - const hasSelectedSupportConcepts = "@Model.SelectedConceptCostBearerRelations.Any()".toLowerCase() === "true"; + if("@Model.IsInGroupBookingMode".toLowerCase() === "true") { + const hasSelectedSupportConcepts = "@Model.SelectedConceptCostBearerRelations.Any()".toLowerCase() === "true"; - $( - "#employees-button, " + - "#category-select, " + - "#leistung-select, " + - "#gb-start-date-input, " + - "#gb-end-date-input, " + - "#gb-start-time-input, " + - "#gb-end-time-input, " + - "#gb-duration-input, " + - "#distance, " + - "textarea, " + - "#reset-button, " + - "#create-button, " + - "#textbausteine-button, " + - "#gb-hours-minutes-dropdown-btn, " + - "#marker-cb, " + - "#betrag," + - ".gb-restore-btn" - ).prop("disabled", (hasSelectedSupportConcepts ? false : true)); - } + $( + "#employees-button, " + + "#category-select, " + + "#leistung-select, " + + "#gb-start-date-input, " + + "#gb-end-date-input, " + + "#gb-start-time-input, " + + "#gb-end-time-input, " + + "#gb-duration-input, " + + "#distance, " + + "textarea, " + + "#reset-button, " + + "#create-button, " + + "#textbausteine-button, " + + "#gb-hours-minutes-dropdown-btn, " + + "#marker-cb, " + + "#betrag," + + ".gb-restore-btn" + ).prop("disabled", (hasSelectedSupportConcepts ? false : true)); + } - $("#fehlerdetail-textarea").prop("disabled", false); + $("#fehlerdetail-textarea").prop("disabled", false); - if ("@Model.IsInMultiBookingMode".toLowerCase() === "true") { - const isMultiBookingFormDisabled = "@Model.MultiBookingSelectedConceptCostBearerRelations.Any()".toLowerCase() === "false"; + if ("@Model.IsInMultiBookingMode".toLowerCase() === "true") { + const isMultiBookingFormDisabled = "@Model.MultiBookingSelectedConceptCostBearerRelations.Any()".toLowerCase() === "false"; - window.toggleMultiBookingForm(isMultiBookingFormDisabled); - } + window.toggleMultiBookingForm(isMultiBookingFormDisabled); + } - initializeSignatureImagePopup(); + initializeSignatureImagePopup(); - @if(TempData[TempDataConstants.ShowPwChPopupKey] is string passwordWarning && !string.IsNullOrEmpty(passwordWarning)) - { - - showMessagePopupWithHtml("Achtung!", "@Html.Raw(passwordWarning)"); - - } + @if(TempData[TempDataConstants.ShowPwChPopupKey] is string passwordWarning && !string.IsNullOrEmpty(passwordWarning)) + { + + showMessagePopupWithHtml("Achtung!", "@Html.Raw(passwordWarning)"); + + } - setInputFilter(); + setInputFilter(); - @if(Model.IsInGroupBookingMode) - { - - $("#create-button").prop("disabled", @Model.GroupBookingSelectedEmployees.Count === 0 ? true : false); - - } + @if(Model.IsInGroupBookingMode) + { + + $("#create-button").prop("disabled", @Model.GroupBookingSelectedEmployees.Count === 0 ? true : false); + + } - @{ - var shouldShowSignaturePopup = TempData[TempDataConstants.ShowSignatureSuggestionPopup]?.GetType() == typeof(bool) && (bool) TempData[TempDataConstants.ShowSignatureSuggestionPopup]; + @{ + var shouldShowSignaturePopup = TempData[TempDataConstants.ShowSignatureSuggestionPopup]?.GetType() == typeof(bool) && (bool) TempData[TempDataConstants.ShowSignatureSuggestionPopup]; - if(Model.LastCreatedServiceRecordOid > 0) - { - if(shouldShowSignaturePopup && Model.ShowSignature) - { - - showMessagePopupWithCallback("Erfolgreich gespeichert", "Möchten Sie den Eintrag unterschreiben lassen?", function() { - initializeSignature(@Model.LastCreatedServiceRecordOid); - }, false); - - } - } - } - } catch(error) { + if(Model.LastCreatedServiceRecordOid > 0) + { + if(shouldShowSignaturePopup && Model.ShowSignature) + { + + showMessagePopupWithCallback("Erfolgreich gespeichert", "Möchten Sie den Eintrag unterschreiben lassen?", function() { + initializeSignature(@Model.LastCreatedServiceRecordOid); + }, false); + + } + } + } + + @if(TempData[TempDataConstants.AppointmentOidKey] is long && false == Model.IsInGroupBookingMode && false == Model.IsInMultiBookingMode) + { + + loadServiceRecords(); + + } + } catch(error) { window.showErrorPopup(error); } }); @@ -715,7 +722,7 @@ } } - else if (TempData[TempDataConstants.IsInTransferModeKey] is bool isInTransferMode && isInTransferMode) + else if(Model.IsInTransferMode) { using(Html.BeginForm("ResetTransferMode", "Main", FormMethod.Post)) { diff --git a/BeWoPlanerMobil/Views/Main/ServiceRecordListPartial.cshtml b/BeWoPlanerMobil/Views/Main/ServiceRecordListPartial.cshtml index 936886588..e1d928f53 100644 --- a/BeWoPlanerMobil/Views/Main/ServiceRecordListPartial.cshtml +++ b/BeWoPlanerMobil/Views/Main/ServiceRecordListPartial.cshtml @@ -579,7 +579,8 @@ } @{ - var nextButtonsClass = Model.CurrentPage == Model.ServiceRecordPageCount || Model.ServiceRecordPageCount < 6 ? "disabled" : string.Empty; + //var nextButtonsClass = Model.CurrentPage == Model.ServiceRecordPageCount || Model.ServiceRecordPageCount < 6 ? "disabled" : string.Empty; + var nextButtonsClass = Model.CurrentPage == Model.ServiceRecordPageCount ? "disabled" : string.Empty; }
  • } } - else if(TempData[TempDataConstants.IsInTransferModeKey] is bool isInTransferMode && isInTransferMode) + else if(Model.IsInTransferMode) { using(Html.BeginForm("ResetTransferMode", "Main", FormMethod.Post)) { diff --git a/Data/Access/OrganisationDAO.cs b/Data/Access/OrganisationDAO.cs index 1fe9e6444..af4393ecd 100644 --- a/Data/Access/OrganisationDAO.cs +++ b/Data/Access/OrganisationDAO.cs @@ -1,12 +1,7 @@ using BeWo.Data.Entities; -using BeWo.Data.Entities.Light; -using BS.Shared.Core; using NHibernate.Criterion; -using System; using System.Collections.Generic; using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace BeWo.Data.Access { diff --git a/Data/Entities/Light/OrganisationLight.cs b/Data/Entities/Light/OrganisationLight.cs index a78d1f4ae..c4d40bc51 100644 --- a/Data/Entities/Light/OrganisationLight.cs +++ b/Data/Entities/Light/OrganisationLight.cs @@ -1,6 +1,4 @@ -using System.Collections.Generic; -using System.Diagnostics; -using BS.Shared; +using System.Diagnostics; using BS.Shared.Interface; namespace BeWo.Data.Entities.Light diff --git a/Data/Entities/Organisation.cs b/Data/Entities/Organisation.cs index a9927fe01..f0709a001 100644 --- a/Data/Entities/Organisation.cs +++ b/Data/Entities/Organisation.cs @@ -49,7 +49,7 @@ namespace BeWo.Data.Entities public virtual bool GkvAusblenden { get; set; } public virtual Address HausanschriftDatenannahmestelle { get; set; } public virtual Address PostfachanschriftDatenannahmestelle { get; set; } - public virtual Address GroßkundenanschriftDatenannahmestelle { get; set; } + public virtual Address GrosskundenanschriftDatenannahmestelle { get; set; } //public virtual Address GetDatenannahmestelleAddress() //{ @@ -57,7 +57,7 @@ namespace BeWo.Data.Entities // { // HausanschriftDatenannahmestelle, // PostfachanschriftDatenannahmestelle, - // GroßkundenanschriftDatenannahmestelle + // GrosskundenanschriftDatenannahmestelle // }; // foreach (var address in addresses) diff --git a/Data/Entities/Organisation2Person.cs b/Data/Entities/Organisation2Person.cs index 68d70bef8..664ebf0a3 100644 --- a/Data/Entities/Organisation2Person.cs +++ b/Data/Entities/Organisation2Person.cs @@ -1,7 +1,5 @@ using System.Collections.Generic; - using BS.Shared; -using BS.Shared.DataContracts; namespace BeWo.Data.Entities { diff --git a/Data/Mappings/Organisation.hbm.xml b/Data/Mappings/Organisation.hbm.xml index 18a800c5f..a9700b148 100644 --- a/Data/Mappings/Organisation.hbm.xml +++ b/Data/Mappings/Organisation.hbm.xml @@ -29,7 +29,7 @@ - + diff --git a/Host/Host.csproj.user b/Host/Host.csproj.user index 991b1f2ce..361b57e4b 100644 --- a/Host/Host.csproj.user +++ b/Host/Host.csproj.user @@ -3,7 +3,7 @@ BeWo2.0 true - Release|Any CPU + Debug|Any CPU false diff --git a/Model/Changes_2025_05_16 Organisation Datenannahmestellen Addressen.txt b/Model/Changes_2025_05_16 Organisation Datenannahmestellen Addressen.txt index 5bdc209ab..a4e48e420 100644 --- a/Model/Changes_2025_05_16 Organisation Datenannahmestellen Addressen.txt +++ b/Model/Changes_2025_05_16 Organisation Datenannahmestellen Addressen.txt @@ -1,10 +1,10 @@ ALTER TABLE `organisation` ADD COLUMN `HausanschriftAddressOid` BIGINT NULL DEFAULT NULL AFTER `CostBearerOid`, ADD COLUMN `PostfachanschriftAddressOid` BIGINT NULL DEFAULT NULL AFTER `HausanschriftAddressOid`, -ADD COLUMN `GroßkundenanschriftAddressOid` BIGINT NULL DEFAULT NULL AFTER `PostfachanschriftAddressOid`, +ADD COLUMN `GrosskundenanschriftAddressOid` BIGINT NULL DEFAULT NULL AFTER `PostfachanschriftAddressOid`, ADD INDEX `FK_ORGANISA_HAUSADD_idx` (`HausanschriftAddressOid` ASC) VISIBLE, ADD INDEX `FK_ORGANISA_POSTADD_idx` (`PostfachanschriftAddressOid` ASC) VISIBLE, -ADD INDEX `FK_ORGANISA_GROSADD_idx` (`GroßkundenanschriftAddressOid` ASC) VISIBLE; +ADD INDEX `FK_ORGANISA_GROSADD_idx` (`GrosskundenanschriftAddressOid` ASC) VISIBLE; ; ALTER TABLE `organisation` ADD CONSTRAINT `FK_ORGANISA_HAUSADD` @@ -18,7 +18,7 @@ ADD CONSTRAINT `FK_ORGANISA_POSTADD` ON DELETE CASCADE ON UPDATE CASCADE, ADD CONSTRAINT `FK_ORGANISA_GROSADD` - FOREIGN KEY (`GroßkundenanschriftAddressOid`) + FOREIGN KEY (`GrosskundenanschriftAddressOid`) REFERENCES `address` (`Oid`) ON DELETE CASCADE ON UPDATE CASCADE; \ No newline at end of file diff --git a/Service/DCEntityMapper/OrganisationDC_Organisation.cs b/Service/DCEntityMapper/OrganisationDC_Organisation.cs index f9f00639f..479a0f6ee 100644 --- a/Service/DCEntityMapper/OrganisationDC_Organisation.cs +++ b/Service/DCEntityMapper/OrganisationDC_Organisation.cs @@ -92,7 +92,7 @@ namespace BeWo.Service.DCEntityMapper pDataContract.HausanschriftDatenannahmestelle = MapperFactory.Address.CreateOrMapToNewDC(pEntity.HausanschriftDatenannahmestelle); pDataContract.PostfachanschriftDatenannahmestelle = MapperFactory.Address.CreateOrMapToNewDC(pEntity.PostfachanschriftDatenannahmestelle); - pDataContract.GroßkundenanschriftDatenannahmestelle = MapperFactory.Address.CreateOrMapToNewDC(pEntity.GroßkundenanschriftDatenannahmestelle); + pDataContract.GrosskundenanschriftDatenannahmestelle = MapperFactory.Address.CreateOrMapToNewDC(pEntity.GrosskundenanschriftDatenannahmestelle); pDataContract.ContactInformations = MapperFactory.ContactDC_Contact.MapToNewDCs(pEntity.Contacts); @@ -240,7 +240,7 @@ namespace BeWo.Service.DCEntityMapper pEntity.HausanschriftDatenannahmestelle = MapperFactory.Address.MergeOrCreateWithEntity(pDataContract.HausanschriftDatenannahmestelle, pEntity.HausanschriftDatenannahmestelle); pEntity.PostfachanschriftDatenannahmestelle = MapperFactory.Address.MergeOrCreateWithEntity(pDataContract.PostfachanschriftDatenannahmestelle, pEntity.PostfachanschriftDatenannahmestelle); - pEntity.GroßkundenanschriftDatenannahmestelle = MapperFactory.Address.MergeOrCreateWithEntity(pDataContract.GroßkundenanschriftDatenannahmestelle, pEntity.GroßkundenanschriftDatenannahmestelle); + pEntity.GrosskundenanschriftDatenannahmestelle = MapperFactory.Address.MergeOrCreateWithEntity(pDataContract.GrosskundenanschriftDatenannahmestelle, pEntity.GrosskundenanschriftDatenannahmestelle); return pEntity; } diff --git a/Shared/DataContracts/ClientPartials/Organisation2PersonDC.cs b/Shared/DataContracts/ClientPartials/Organisation2PersonDC.cs index 1fabbfc7d..555100652 100644 --- a/Shared/DataContracts/ClientPartials/Organisation2PersonDC.cs +++ b/Shared/DataContracts/ClientPartials/Organisation2PersonDC.cs @@ -4,17 +4,16 @@ { public override bool Equals(object obj) { - if (obj is Organisation2PersonDC) + if (obj is Organisation2PersonDC y) { - var y = (Organisation2PersonDC)obj; - if (this.Organisation2PersonOid == null && y.Organisation2PersonOid == null) + if(Organisation2PersonOid is null && y.Organisation2PersonOid is null) { return this.GetHashCode() == y.GetHashCode(); } - if (this.Organisation2PersonOid != null && y.Organisation2PersonOid != null) + if(Organisation2PersonOid != null && y.Organisation2PersonOid != null) { - return this.Organisation2PersonOid == y.Organisation2PersonOid; + return Organisation2PersonOid == y.Organisation2PersonOid; } } @@ -23,7 +22,7 @@ public override int GetHashCode() { - return this.Organisation2PersonOid.HasValue ? this.GetType().Name.GetHashCode() ^ this.Organisation2PersonOid.GetHashCode() : base.GetHashCode(); + return Organisation2PersonOid.HasValue ? GetType().Name.GetHashCode() ^ Organisation2PersonOid.GetHashCode() : base.GetHashCode(); } } } \ No newline at end of file diff --git a/Shared/DataContracts/ClientPartials/OrganisationPersonRelationDC.cs b/Shared/DataContracts/ClientPartials/OrganisationPersonRelationDC.cs index 0b5e51da5..d879cfa67 100644 --- a/Shared/DataContracts/ClientPartials/OrganisationPersonRelationDC.cs +++ b/Shared/DataContracts/ClientPartials/OrganisationPersonRelationDC.cs @@ -4,14 +4,17 @@ { public override bool Equals(object obj) { - if (obj is OrganisationPersonRelationDC) + if(obj is OrganisationPersonRelationDC y) { - var y = (OrganisationPersonRelationDC)obj; - if (Organisation2PersonOid == null && y.Organisation2PersonOid == null) + if(Organisation2PersonOid is null && y.Organisation2PersonOid is null) + { return GetHashCode() == y.GetHashCode(); + } - if (Organisation2PersonOid != null && y.Organisation2PersonOid != null) + if(Organisation2PersonOid != null && y.Organisation2PersonOid != null) + { return Organisation2PersonOid == y.Organisation2PersonOid; + } } return false; @@ -19,9 +22,9 @@ public override int GetHashCode() { - return this.Organisation2PersonOid.HasValue - ? GetType().Name.GetHashCode() ^ this.Organisation2PersonOid.GetHashCode() - : base.GetHashCode(); + return Organisation2PersonOid.HasValue + ? GetType().Name.GetHashCode() ^ Organisation2PersonOid.GetHashCode() + : base.GetHashCode(); } } } diff --git a/Shared/DataContracts/Light/OrganisationLightDC.cs b/Shared/DataContracts/Light/OrganisationLightDC.cs index 0adafa8be..b93f36ec9 100644 --- a/Shared/DataContracts/Light/OrganisationLightDC.cs +++ b/Shared/DataContracts/Light/OrganisationLightDC.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Runtime.Serialization; -using System.Text; -using System.Threading.Tasks; +using System.Runtime.Serialization; namespace BS.Shared.DataContracts.Light { diff --git a/Shared/DataContracts/Organisation2PersonDC.cs b/Shared/DataContracts/Organisation2PersonDC.cs index 00b2ee813..aeb4f0fcb 100644 --- a/Shared/DataContracts/Organisation2PersonDC.cs +++ b/Shared/DataContracts/Organisation2PersonDC.cs @@ -1,5 +1,4 @@ -using System.Collections.Generic; -using System.Runtime.Serialization; +using System.Runtime.Serialization; using BS.Shared.DataContracts.Compact; namespace BS.Shared.DataContracts diff --git a/Shared/DataContracts/OrganisationDC.cs b/Shared/DataContracts/OrganisationDC.cs index bea0518ff..423d00079 100644 --- a/Shared/DataContracts/OrganisationDC.cs +++ b/Shared/DataContracts/OrganisationDC.cs @@ -1,7 +1,5 @@ - -using BS.Shared.Core; +using BS.Shared.Core; using BS.Shared.Exceptions; -using System; using System.Collections.Generic; using System.Runtime.Serialization; @@ -53,7 +51,7 @@ namespace BS.Shared.DataContracts [DataMember] public List Feiertage { get; set; } [DataMember] public ValueListEntryDC Function { get; set; } [DataMember] public bool GkvAusblenden { get; set; } - [DataMember] public AddressDC GroßkundenanschriftDatenannahmestelle { get; set; } + [DataMember] public AddressDC GrosskundenanschriftDatenannahmestelle { get; set; } [DataMember] public AddressDC HausanschriftDatenannahmestelle { get; set; } [DataMember] public string IBAN { get; set; } [DataMember] public string IKDatenannahmestelle { get; set; } @@ -101,7 +99,7 @@ namespace BS.Shared.DataContracts var lst = new List() { HausanschriftDatenannahmestelle, PostfachanschriftDatenannahmestelle, - GroßkundenanschriftDatenannahmestelle}; + GrosskundenanschriftDatenannahmestelle}; foreach (var add in lst) {