diff --git a/.gitignore b/.gitignore index 47e7a7b2a..ba03d13d0 100644 --- a/.gitignore +++ b/.gitignore @@ -626,6 +626,21 @@ obj /DakotaSender/obj /DakotaUnitTest/bin /DakotaUnitTest/obj +/WohneinheitUnitTest/bin +/WohneinheitUnitTest/obj /BeWoDatabaseTerminator/BeWoDatabaseTerminator/bin/Debug /BeWoDatabaseTerminator/BeWoDatabaseTerminator/bin/Release /ReportImp/TestLWV + +/TranslationUnitTest/bin +/ReportImp/demo_Sozio/Invoicing/CustomInvoiceFactory.cs +/ReportImp/demo_Sozio/Invoicing/SoziotherapieInvoiceCreation.cs +/ReportImp/demo_Sozio/LeistungsnachweisSoziotherapie.cs +/ReportImp/demo_Sozio/LeistungsnachweisSoziotherapie.designer.cs +/ReportImp/demo_Sozio/LeistungsnachweisSoziotherapie.resx +/ReportImp/demo_Sozio/Properties/AssemblyInfo.cs +/ReportImp/demo_Sozio/Properties/licenses.licx +/ReportImp/demo_Sozio/SoziotherapieRechnung.Designer.cs +/ReportImp/demo_Sozio/SoziotherapieRechnung.cs +/ReportImp/demo_Sozio/SoziotherapieRechnung.resx +/ReportImp/demo_Sozio/demo_Sozio.csproj \ No newline at end of file diff --git a/BeWo/BeWo.csproj b/BeWo/BeWo.csproj index 1da2cef25..b48e52c0f 100644 --- a/BeWo/BeWo.csproj +++ b/BeWo/BeWo.csproj @@ -16,7 +16,7 @@ true Internet true - false + true 8CA4066C36C87B745E4016FDA715A6DB16FCFFA9 @@ -39,16 +39,16 @@ false true false - https://app.ownsoft.de/test/ + https://app.ownsoft.de/ de-DE BeWoPlaner ownSoft GmbH - 2.0.1.247 + 2.0.1.249 true publish.htm false true - 248 + 250 2.0.1.%2a false true @@ -269,6 +269,10 @@ MSBuild:Compile Designer + + Designer + MSBuild:Compile + MSBuild:Compile Designer @@ -319,6 +323,62 @@ Designer MSBuild:Compile + + Designer + MSBuild:Compile + + + Designer + MSBuild:Compile + + + Designer + MSBuild:Compile + + + Designer + MSBuild:Compile + + + Designer + MSBuild:Compile + + + Designer + MSBuild:Compile + + + Designer + MSBuild:Compile + + + Designer + MSBuild:Compile + + + Designer + MSBuild:Compile + + + Designer + MSBuild:Compile + + + Designer + MSBuild:Compile + + + Designer + MSBuild:Compile + + + Designer + MSBuild:Compile + + + Designer + MSBuild:Compile + MSBuild:Compile Designer @@ -836,12 +896,15 @@ + + + @@ -850,12 +913,16 @@ + + + + @@ -868,6 +935,7 @@ + EnterTenantDialog.xaml @@ -1039,6 +1107,22 @@ + + + + + + + + + + + + + + + + @@ -1141,6 +1225,48 @@ + + CustomerVermittlungArbeitControl.xaml + + + CustomerWohnhilfeControl.xaml + + + CustomerVermittlungArbeitView.xaml + + + CustomerWohnhilfeView.xaml + + + WohneinheitBelegungEditPopup.xaml + + + WohneinheitBelegungSchedulerView.xaml + + + WohneinheitBelegungTableView.xaml + + + WohneinheitEditPopup.xaml + + + CustomerFalldatenView.xaml + + + WohneinheitBelegungEditControl.xaml + + + WohneinheitBelegungWindow.xaml + + + WohneinheitGrundrissModalPopup.xaml + + + WohneinheitVerwaltungViewV1.xaml + + + WohneinheitVerwaltungViewV2.xaml + HilfeplanImportView.xaml @@ -3213,6 +3339,7 @@ + diff --git a/BeWo/BeWo.csproj.user b/BeWo/BeWo.csproj.user index 5b9016668..3eff8c8d2 100644 --- a/BeWo/BeWo.csproj.user +++ b/BeWo/BeWo.csproj.user @@ -2,7 +2,7 @@ D:\Projects\beyondsoft\BeWoPlaner\Publish\|publish\|D:\Projects\beyondsoft\BeWoPlaner\PublishTest\|D:\Projects\beyondsoft\BeWoPlaner\PublishDev\|D:\Projects\beyondsoft\BeWoPlaner\Publish45\ - https://app.ownsoft.de/test/|https://app.ownsoft.de/|https://app.ownsoft.de/dev/|http://app.ownsoft.de/dev/|http://app.beyondsoft.de/dev/ + https://app.ownsoft.de/|https://app.ownsoft.de/test/|https://app.ownsoft.de/dev/|http://app.ownsoft.de/dev/|http://app.beyondsoft.de/dev/ https://app.ownsoft.de/|https://app.ownsoft.de/bewoplaner.application/ diff --git a/BeWo/BeWoApp.xaml b/BeWo/BeWoApp.xaml index b3f8d1735..918ea6043 100644 --- a/BeWo/BeWoApp.xaml +++ b/BeWo/BeWoApp.xaml @@ -47,6 +47,7 @@ + @@ -62,12 +63,28 @@ + + + + + + + + + + + + + + + + - - - - - - + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + - + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/BeWo/Styles/Office2007Silver.xaml b/BeWo/Styles/Office2007Silver.xaml index 25375866b..e072b77f6 100644 --- a/BeWo/Styles/Office2007Silver.xaml +++ b/BeWo/Styles/Office2007Silver.xaml @@ -1 +1,4 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/BeWo/Styles/OrangeBlack.xaml b/BeWo/Styles/OrangeBlack.xaml index a53795b28..65dfeeecb 100644 --- a/BeWo/Styles/OrangeBlack.xaml +++ b/BeWo/Styles/OrangeBlack.xaml @@ -1,125 +1,126 @@ - + - + - - - + + + - - - - - - - - - - + + + + + + + + + + - - + + - - - - - - - + + + + + + + - - - - - + + + + + - - - - - - - - - - - - + + + + + + + + + + + + - - - - - + + + + + - + - - - - + + + + - - - - + + + + - - - - - - + + + + + + - - - - - - + + + + + + - + - - - - - - - - - + + + + + + + - + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - M 0 0 L 3.5 4 L 7 0 Z - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + M 0 0 L 3.5 4 L 7 0 Z + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - + + + + + + + + + + + + + - - + + + + + + + + + + + + + + + + + - + + + + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + - - - - - - - - - + + + + + + + + + - + - - - - - - - - - - + + + + + + + + - - - - - - - - - - - - - - - - - + + + + - - - - - - - - - - - - + + + + + + + + + + - - - + + + - + - - - - - - - + + - - - - + + + + + + + + + - - - - - - - - + + + + + + + - - - - - - - - - - - - - - - - - - - - - - + - + + + + + + + - - - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - - - - - - - + + + - + - - - - - - - + + + - + - - - + + + - - - - - - - - - - - - - - + + + + + + + + + + + + + + - - - - - - - - - - - + + + + + + + + + - - - + - - - - + + + - + + + + + - + + - + + - - - - + + + + - + + + + + + + + + + - + - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + - + - - - + - + - + + + + + + + + + + + + + + + + + - + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + - - + + - - - - - - - - - + + + + + + + + + - - - - - - - - - + + + + + + + + + - - - - - - - - - - + + + + + + + + + + - - - - - - + + + + + - - - - - - - - - - - - - - - - - - - - - - - + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - + + + + + + + - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - - + - - + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - + + + - + + + - + - + \ No newline at end of file diff --git a/BeWo/Styles/PrototypeStyles.xaml b/BeWo/Styles/PrototypeStyles.xaml new file mode 100644 index 000000000..c88d016bb --- /dev/null +++ b/BeWo/Styles/PrototypeStyles.xaml @@ -0,0 +1,124 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/BeWo/View/Controls/BehinderungsartenSelectionControl.xaml b/BeWo/View/Controls/BehinderungsartenSelectionControl.xaml index 02467eb14..f4935274e 100644 --- a/BeWo/View/Controls/BehinderungsartenSelectionControl.xaml +++ b/BeWo/View/Controls/BehinderungsartenSelectionControl.xaml @@ -1,35 +1,58 @@ - + - - - - + + + + - - - - - - - - - - - + + + + + + + + + + + - - - - - - + + + + + + + + + + + + + + + + + + + diff --git a/BeWo/View/Detail/CustomerVermittlungArbeitView.xaml.cs b/BeWo/View/Detail/CustomerVermittlungArbeitView.xaml.cs new file mode 100644 index 000000000..6407adffc --- /dev/null +++ b/BeWo/View/Detail/CustomerVermittlungArbeitView.xaml.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; + +namespace BeWo.View.Detail +{ + /// + /// Interaktionslogik für CustomerVgAView.xaml + /// + public partial class CustomerVermittlungArbeitView : UserControl + { + public bool PermissionCustomerWohnhilfeCreate { get; } = BeWoApp.HasLoggedOnUserRight(BS.Shared.UserRightType.Customer_GemeinnutzigeArbeit_Create); + public bool PermissionCustomerWohnhilfeEdit { get; } = BeWoApp.HasLoggedOnUserRight(BS.Shared.UserRightType.Customer_GemeinnutzigeArbeit_Edit); + public bool PermissionCustomerWohnhilfeDelete { get; } = BeWoApp.HasLoggedOnUserRight(BS.Shared.UserRightType.Customer_GemeinnutzigeArbeit_Delete); + + public CustomerVermittlungArbeitView() + { + InitializeComponent(); + } + } +} diff --git a/BeWo/View/Detail/CustomerView.xaml b/BeWo/View/Detail/CustomerView.xaml index c40c4f076..175eeacf8 100644 --- a/BeWo/View/Detail/CustomerView.xaml +++ b/BeWo/View/Detail/CustomerView.xaml @@ -1,5 +1,6 @@  - - - - - - - - - - + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - - - - - - - - + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - + Übernehmen + + - - + + - - - + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + - - - + + + + + Groß + + + + + + + + + + + + + + + + + + + + + + diff --git a/BeWo/View/Detail/CustomerWohnhilfeView.xaml.cs b/BeWo/View/Detail/CustomerWohnhilfeView.xaml.cs new file mode 100644 index 000000000..77350cd0d --- /dev/null +++ b/BeWo/View/Detail/CustomerWohnhilfeView.xaml.cs @@ -0,0 +1,48 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; + +namespace BeWo.View.Detail +{ + /// + /// Interaktionslogik für CustomerWohnhilfeView.xaml + /// + public partial class CustomerWohnhilfeView : UserControl + { + public bool PermissionCustomerWohnhilfeCreate { get; } = BeWoApp.HasLoggedOnUserRight(BS.Shared.UserRightType.Customer_Wohnhilfe_Create); + public bool PermissionCustomerWohnhilfeEdit { get; } = BeWoApp.HasLoggedOnUserRight(BS.Shared.UserRightType.Customer_Wohnhilfe_Edit); + public bool PermissionCustomerWohnhilfeDelete { get; } = BeWoApp.HasLoggedOnUserRight(BS.Shared.UserRightType.Customer_Wohnhilfe_Delete); + + public CustomerWohnhilfeView() + { + InitializeComponent(); + } + + private void Wohnhilfe_Display_Edit_Button_Click(object sender, RoutedEventArgs e) + { + popup_Wohnhilfe_Displayname_Edit.IsOpen = true; + } + + private void popup_Wohnhilfe_Displayname_Edit_Opened(object sender, EventArgs e) + { + Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Input, new Action(Textbox_SelectAll)); + } + + private void Textbox_SelectAll() + { + txt_Wohnhilfe_Displayname_Edit.Focus(); + txt_Wohnhilfe_Displayname_Edit.SelectAll(); + } + } +} diff --git a/BeWo/View/Detail/MandatorView.xaml.cs b/BeWo/View/Detail/MandatorView.xaml.cs index 267593afd..605e14faa 100644 --- a/BeWo/View/Detail/MandatorView.xaml.cs +++ b/BeWo/View/Detail/MandatorView.xaml.cs @@ -61,9 +61,16 @@ namespace BeWo.View.Detail #if DEBUG - var url2 = ServiceFacade.DoOperationsServiceSync(s => s.GetOwnChatSettingsUrl()); - HyperlinkOwnChatSettings.NavigateUri = new Uri(url2); - GroupOwnChatSettings.Visibility = Visibility.Visible; + try + { + var url2 = ServiceFacade.DoOperationsServiceSync(s => s.GetOwnChatSettingsUrl()); + HyperlinkOwnChatSettings.NavigateUri = new Uri(url2); + GroupOwnChatSettings.Visibility = Visibility.Visible; + } + catch(Exception e) + { + + } #endif } diff --git a/BeWo/View/Detail/MassnahmenTreeViewView.xaml b/BeWo/View/Detail/MassnahmenTreeViewView.xaml index f13d7832b..4acc21489 100644 --- a/BeWo/View/Detail/MassnahmenTreeViewView.xaml +++ b/BeWo/View/Detail/MassnahmenTreeViewView.xaml @@ -82,10 +82,22 @@ + diff --git a/BeWo/View/Detail/MassnahmenTreeViewView.xaml.cs b/BeWo/View/Detail/MassnahmenTreeViewView.xaml.cs index 704f6ce8a..edafc87a9 100644 --- a/BeWo/View/Detail/MassnahmenTreeViewView.xaml.cs +++ b/BeWo/View/Detail/MassnahmenTreeViewView.xaml.cs @@ -341,10 +341,12 @@ namespace BeWo.View.Detail private void ToggleButton_Checked(object sender, RoutedEventArgs e) { Bearbeitungsmodus = true; + EditToggleButton.Content = "Bearbeiten deaktivieren"; } private void ToggleButton_Unchecked(object sender, RoutedEventArgs e) { Bearbeitungsmodus = false; + EditToggleButton.Content = "Bearbeiten aktivieren"; } private void StartCopyItem(SupportConceptGoalTreeItem _item, SupportConceptGoalTreeItem _copy) diff --git a/BeWo/View/Detail/Report/AbwesenheitsEmployeeHeader.xaml b/BeWo/View/Detail/Report/AbwesenheitsEmployeeHeader.xaml index 958286d2e..38a8dd400 100644 --- a/BeWo/View/Detail/Report/AbwesenheitsEmployeeHeader.xaml +++ b/BeWo/View/Detail/Report/AbwesenheitsEmployeeHeader.xaml @@ -1,17 +1,36 @@ - - + + - - - - + + + + diff --git a/BeWo/View/Detail/Report/AbwesenheitsView.xaml.cs b/BeWo/View/Detail/Report/AbwesenheitsView.xaml.cs index 1c81b6164..a0481658b 100644 --- a/BeWo/View/Detail/Report/AbwesenheitsView.xaml.cs +++ b/BeWo/View/Detail/Report/AbwesenheitsView.xaml.cs @@ -489,7 +489,6 @@ namespace BeWo.View.Detail.Report } } - linkPdfExport.NavigateUri = new Uri(url); } diff --git a/BeWo/View/Detail/ServiceCategoryView.xaml b/BeWo/View/Detail/ServiceCategoryView.xaml index 6b2153340..46c1eb10c 100644 --- a/BeWo/View/Detail/ServiceCategoryView.xaml +++ b/BeWo/View/Detail/ServiceCategoryView.xaml @@ -133,7 +133,7 @@ - + diff --git a/BeWo/View/Detail/ServiceDescriptionView.xaml b/BeWo/View/Detail/ServiceDescriptionView.xaml index e77962c57..936319620 100644 --- a/BeWo/View/Detail/ServiceDescriptionView.xaml +++ b/BeWo/View/Detail/ServiceDescriptionView.xaml @@ -16,8 +16,8 @@ - - + + @@ -26,9 +26,8 @@ - - + @@ -39,9 +38,9 @@ - + - + @@ -66,17 +65,17 @@ - @@ -112,7 +111,7 @@ - + @@ -140,7 +139,7 @@ - + diff --git a/BeWo/View/Detail/UrlaubskontoView.xaml.cs b/BeWo/View/Detail/UrlaubskontoView.xaml.cs index 4e4dfb56a..7c55c3a04 100755 --- a/BeWo/View/Detail/UrlaubskontoView.xaml.cs +++ b/BeWo/View/Detail/UrlaubskontoView.xaml.cs @@ -57,28 +57,31 @@ namespace BeWo.View.Detail } private void _YearPicker_EditValueChanged(object sender, EditValueChangedEventArgs e) { - if (_GridLeaveDays == null) + if (_YearPicker.SelectedItem != null) { - _GridLeaveDays = rootGrid.Resources["datagrid_leavedays"] as GridControl; - - WPFGridLeaveDays.Children.Add(_GridLeaveDays); - } - - var urlaubskonto = ServiceFacade.DoEmployeeServiceSync(s => s.ErstelleUrlaubskontoDarstellung(DataContract, (int)_YearPicker.SelectedItem)); - - if (urlaubskonto == null) - { - urlaubskonto = new List(); - urlaubskonto.Add(new UrlaubskontoDarstellungDC() + if (_GridLeaveDays == null) { - Erlaeuterung = "Es existiert kein Vertrag für ausgewähltes Jahr", - }); - button_openLeaveDayDialogue.Visibility = Visibility.Collapsed; - } - else - button_openLeaveDayDialogue.Visibility = Visibility.Visible; + _GridLeaveDays = rootGrid.Resources["datagrid_leavedays"] as GridControl; - _GridLeaveDays.ItemsSource = urlaubskonto; + WPFGridLeaveDays.Children.Add(_GridLeaveDays); + } + + var urlaubskonto = ServiceFacade.DoEmployeeServiceSync(s => s.ErstelleUrlaubskontoDarstellung(DataContract, (int)_YearPicker.SelectedItem)); + + if (urlaubskonto == null) + { + urlaubskonto = new List(); + urlaubskonto.Add(new UrlaubskontoDarstellungDC() + { + Erlaeuterung = "Es existiert kein Vertrag für ausgewähltes Jahr", + }); + button_openLeaveDayDialogue.Visibility = Visibility.Collapsed; + } + else + button_openLeaveDayDialogue.Visibility = Visibility.Visible; + + _GridLeaveDays.ItemsSource = urlaubskonto; + } } private void button_addLeaveDay_Click(object sender, RoutedEventArgs e) diff --git a/BeWo/View/Detail/Wohneinheit/WohneinheitBelegungEditControl.xaml b/BeWo/View/Detail/Wohneinheit/WohneinheitBelegungEditControl.xaml new file mode 100644 index 000000000..def9ae7d5 --- /dev/null +++ b/BeWo/View/Detail/Wohneinheit/WohneinheitBelegungEditControl.xaml @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/BeWo/View/Detail/Wohneinheit/WohneinheitBelegungEditControl.xaml.cs b/BeWo/View/Detail/Wohneinheit/WohneinheitBelegungEditControl.xaml.cs new file mode 100644 index 000000000..a1dda3700 --- /dev/null +++ b/BeWo/View/Detail/Wohneinheit/WohneinheitBelegungEditControl.xaml.cs @@ -0,0 +1,79 @@ +using BeWo.ViewModel; +using BS.Shared.Core; +using BS.Shared.DataContracts.Compact; +using DevExpress.Xpf.Scheduling; +using DevExpress.Xpf.Scheduling.VisualData; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; + +namespace BeWo.View.Detail.Wohneinheit +{ + /// + /// Interaktionslogik für WohneinheitBelegungControl.xaml + /// + public partial class WohneinheitBelegungEditControl : UserControl + { + public EventHandler EventHandler2 { get; set; } + + public WohnheimVM ViewModel => DataContext as WohnheimVM; + + public WohneinheitBelegungEditControl() + { + InitializeComponent(); + } + + private void Save_Button_Click(object sender, RoutedEventArgs e) + { + ViewModel.WohneinheitBelegungListVM.AddNewVMToList(); + + Window.GetWindow(this).Close(); + } + + private void Cancel_Button_Click(object sender, RoutedEventArgs e) + { + ViewModel.WohneinheitBelegungListVM.CloseNewVM(); + + Window.GetWindow(this).Close(); + } + + private void CustomerSelectionControl_ItemSelected(object sender, EventArgs e) + { + var customer = e.Data; + + ViewModel.WohneinheitBelegungListVM.CurrentVM.Customer = customer; + } + + private void root_DataContextChanged(object sender, DependencyPropertyChangedEventArgs e) + { + if (e.OldValue != null) + return; + + var avm = e.NewValue as AppointmentWindowViewModel; + + if(avm.Appointment.SourceObject is WohneinheitBelegungVM vm) + { + groupbox_newBelegung.Header = avm.IsNewAppointment ? "Belegung erstellen" : "Belegung bearbeiten"; + btn_save.Visibility = avm.IsNewAppointment ? Visibility.Visible : Visibility.Collapsed; + btn_cancel.Visibility = avm.IsNewAppointment ? Visibility.Visible : Visibility.Collapsed; + + if (vm.Customer is object) + { + customer_selection_control.SelectedItem = vm.Customer; + //customer_selection_control.SetSelectedCustomerOid(vm.Customer.CustomerOid); + } + } + } + } +} diff --git a/BeWo/View/Detail/Wohneinheit/WohneinheitBelegungEditPopup.xaml b/BeWo/View/Detail/Wohneinheit/WohneinheitBelegungEditPopup.xaml new file mode 100644 index 000000000..65ad5ac7c --- /dev/null +++ b/BeWo/View/Detail/Wohneinheit/WohneinheitBelegungEditPopup.xaml @@ -0,0 +1,63 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/BeWo/View/Detail/Wohneinheit/WohneinheitBelegungEditPopup.xaml.cs b/BeWo/View/Detail/Wohneinheit/WohneinheitBelegungEditPopup.xaml.cs new file mode 100644 index 000000000..12e9f31c4 --- /dev/null +++ b/BeWo/View/Detail/Wohneinheit/WohneinheitBelegungEditPopup.xaml.cs @@ -0,0 +1,115 @@ +using BeWo.ViewModel; +using BeWo.ViewModel.ListViewModel; +using BS.Shared.Core; +using BS.Shared.DataContracts.Compact; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Controls.Primitives; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; + +namespace BeWo.View.Detail.Wohneinheit +{ + /// + /// Interaktionslogik für WohneinheitBelegungEditPopup.xaml + /// + public partial class WohneinheitBelegungEditPopup : Popup + { + public static readonly DependencyProperty ViewModelProperty = + DependencyProperty.Register("ViewModel", typeof(WohnheimVM), typeof(WohneinheitBelegungEditPopup), new PropertyMetadata(null)); + + public WohnheimVM ViewModel + { + get { return DataContext as WohnheimVM; } + set { DataContext = value; } + } + + public bool AddMode { get; set; } + + public WohneinheitBelegungEditPopup() + { + InitializeComponent(); + } + + private void Save_Button_Click(object sender, RoutedEventArgs e) + { + ViewModel.WohneinheitBelegungListVM.AddNewVMToList(); + + IsOpen = false; + } + + private void Cancel_Button_Click(object sender, RoutedEventArgs e) + { + ViewModel.WohneinheitBelegungListVM.CloseNewVM(); + + IsOpen = false; + } + + private void Popup_Opened(object sender, EventArgs e) + { + var listvm = ViewModel.WohneinheitBelegungListVM; + + AddMode = listvm.EditVM is null; + + if (AddMode) + { + btn_cancel.Visibility = Visibility.Visible; + btn_save.Visibility = Visibility.Visible; + StaysOpen = true; + groupbox_newBelegung.Header = "Belegung erstellen"; + + customer_selection_control.SelectedItem = null; + } + else + { + btn_cancel.Visibility = Visibility.Collapsed; + btn_save.Visibility = Visibility.Collapsed; + StaysOpen = false; + groupbox_newBelegung.Header = "Belegung bearbeiten"; + + if (listvm.CurrentVM.Customer is object) + { + customer_selection_control.SetSelectedCustomerOid(listvm.CurrentVM.Customer.CustomerOid); + } + } + } + + private void CustomerSelectionControl_ItemSelected(object sender, EventArgs e) + { + var customer = e.Data; + + ViewModel.WohneinheitBelegungListVM.CurrentVM.Customer = customer; + } + + private void root_Popup_Closed(object sender, EventArgs e) + { + var vmlist = ViewModel.WohneinheitBelegungListVM; + var currentvm = vmlist.CurrentVM; + + root_Popup.Focus(); + + if (currentvm is object) + { + if (AddMode) + { + vmlist.CloseNewVM(); + } + else + { + vmlist.CloseEditVM(); + } + } + } + } +} diff --git a/BeWo/View/Detail/Wohneinheit/WohneinheitBelegungSchedulerView.xaml b/BeWo/View/Detail/Wohneinheit/WohneinheitBelegungSchedulerView.xaml new file mode 100644 index 000000000..56ac0bad5 --- /dev/null +++ b/BeWo/View/Detail/Wohneinheit/WohneinheitBelegungSchedulerView.xaml @@ -0,0 +1,200 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/BeWo/View/Detail/Wohneinheit/WohneinheitBelegungSchedulerView.xaml.cs b/BeWo/View/Detail/Wohneinheit/WohneinheitBelegungSchedulerView.xaml.cs new file mode 100644 index 000000000..e19377313 --- /dev/null +++ b/BeWo/View/Detail/Wohneinheit/WohneinheitBelegungSchedulerView.xaml.cs @@ -0,0 +1,283 @@ +using BeWo.ViewModel; +using BS.Shared.Translation; +using DevExpress.Mvvm; +using DevExpress.Xpf.Bars; +using DevExpress.Xpf.Core; +using DevExpress.Xpf.Scheduling; +using DevExpress.XtraScheduler.Native; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; +using ViewBase = DevExpress.Xpf.Scheduling.ViewBase; + +namespace BeWo.View.Detail.Wohneinheit +{ + /// + /// Interaktionslogik für WohneinheitBelegungSchedulerControl.xaml + /// + public partial class WohneinheitBelegungSchedulerView : UserControl + { + public WohnheimVM ViewModel => DataContext as WohnheimVM; + + private Window _BelegungPopupWindow; + + public WohneinheitBelegungSchedulerView() + { + InitializeComponent(); + + InitScheduler(); + } + + private void InitScheduler() + { + radioButtonYear.IsChecked = true; + + timelineViewYear.IsActive = true; + + timelineViewYear.TimeScales.Clear(); + timelineViewYear.TimeScales.AddRange(new List() { + new TimeScale(TimeScaleUnit.Year) { MinWidth = 0 }, + new TimeScale(TimeScaleUnit.Month) { MinWidth = 0 }, + new TimeScale(TimeScaleUnit.Day) { MinWidth = 0 } + }); + + timelineViewQuartal.TimeScales.Clear(); + timelineViewQuartal.TimeScales.AddRange(new List() { + new TimeScale(TimeScaleUnit.Year) { MinWidth = 0 }, + new TimeScale(TimeScaleUnit.Quarter) { MinWidth = 0 }, + new TimeScale(TimeScaleUnit.Month) { MinWidth = 0 }, + new TimeScale(TimeScaleUnit.Day) { MinWidth = 0} + }); + + timelineViewMonth.TimeScales.Clear(); + timelineViewMonth.TimeScales.AddRange(new List() { + new TimeScale(TimeScaleUnit.Year) { MinWidth = 0 }, + new TimeScale(TimeScaleUnit.Month) { MinWidth = 0 }, + new TimeScale(TimeScaleUnit.Day) { MinWidth = 0 } + }); + + timelineView4Week.TimeScales.Clear(); + timelineView4Week.TimeScales.AddRange(new List() { + new TimeScale(TimeScaleUnit.Year) { MinWidth = 0 }, + new TimeScale(TimeScaleUnit.Month) { MinWidth = 0 }, + new TimeScale(TimeScaleUnit.Week) { MinWidth = 0 }, + new TimeScale(TimeScaleUnit.Day) { MinWidth = 0 } + }); + + timelineViewWeek.TimeScales.Clear(); + timelineViewWeek.TimeScales.AddRange(new List() { + new TimeScale(TimeScaleUnit.Year) { MinWidth = 0 }, + new TimeScale(TimeScaleUnit.Month) { MinWidth = 0 }, + new TimeScale(TimeScaleUnit.Week) { MinWidth = 0 }, + new TimeScale(TimeScaleUnit.Day) { MinWidth = 0 } + }); + } + + void scheduler_ActiveViewChanged(object sender, ValueChangedEventArgs e) + { + if (e.NewValue == null) return; + var selectionStart = scheduler_buchungsplan.SelectedInterval.Start; + var dates = new List() { selectionStart.Date }; + if (!CoerceDateNavigatorSelectedDates(dates)) + { + return; + } + + try + { + UpdateSelectionView(); + } + catch (Exception) + { + UpdateSelectionView(); + } + + var min = dates.Min(); + scheduler_buchungsplan.Start = min; + var intervalDuration = dates.Max().AddDays(1) - min; + + var timeline = (TimelineView)e.NewValue; + timeline.IntervalDuration = intervalDuration; + timeline.ViewportStart = min; + timeline.Zoom = TimeSpan.MinValue; + timeline.Zoom = TimeSpan.MaxValue; + + scheduler_buchungsplan.SelectedInterval = new DateTimeRange(selectionStart, TimeSpan.Zero); + } + + private void UpdateSelectionView() + { + if (timelineViewWeek.IsActive) + { + dateNavigator.CalendarView = DevExpress.Xpf.Editors.DateNavigator.DateNavigatorCalendarView.Month; + dateNavigator.SelectionView = DevExpress.Xpf.Editors.DateNavigator.DateNavigatorCalendarView.Month; + } + else if (timelineView4Week.IsActive) + { + dateNavigator.CalendarView = DevExpress.Xpf.Editors.DateNavigator.DateNavigatorCalendarView.Month; + dateNavigator.SelectionView = DevExpress.Xpf.Editors.DateNavigator.DateNavigatorCalendarView.Month; + } + else if (timelineViewMonth.IsActive) + { + dateNavigator.CalendarView = DevExpress.Xpf.Editors.DateNavigator.DateNavigatorCalendarView.Month; + dateNavigator.SelectionView = DevExpress.Xpf.Editors.DateNavigator.DateNavigatorCalendarView.Month; + } + else if (timelineViewQuartal.IsActive) + { + dateNavigator.CalendarView = DevExpress.Xpf.Editors.DateNavigator.DateNavigatorCalendarView.Month; + dateNavigator.SelectionView = DevExpress.Xpf.Editors.DateNavigator.DateNavigatorCalendarView.Month; + } + else if (timelineViewYear.IsActive) + { + dateNavigator.CalendarView = DevExpress.Xpf.Editors.DateNavigator.DateNavigatorCalendarView.Years; + dateNavigator.SelectionView = DevExpress.Xpf.Editors.DateNavigator.DateNavigatorCalendarView.Years; + } + } + + void dateNavigatorSettings_CustomizeSelectedDates(object sender, CustomizeSelectedDatesEventArgs e) + { + e.Handled = CoerceDateNavigatorSelectedDates(e.Dates); + + if (scheduler_buchungsplan.ActiveView is TimelineView timeline) + { + var intervalDuration = e.Dates.Max().AddDays(1) - e.Dates.Min(); + + if (!ViewModel.IntervalChanging && timeline.IntervalDuration != intervalDuration) + { + ViewModel.IntervalChanging = true; + + timeline.IntervalDuration = intervalDuration; + timeline.Zoom = TimeSpan.MinValue; + timeline.Zoom = TimeSpan.MaxValue; + + ViewModel.IntervalChanging = false; + } + } + } + bool CoerceDateNavigatorSelectedDates(IList dates) + { + if (dates.Count == 0) return false; + var start = dates.Min(); + var end = dates.Max(); + if (timelineViewWeek.IsActive) + { + var actualStart = DateTimeHelper.GetStartOfWeekUI(start, scheduler_buchungsplan.FirstDayOfWeek); + var actualEnd = actualStart.AddDays(7); + dates.Clear(); + while (actualStart < actualEnd) + { + dates.Add(actualStart); + actualStart = actualStart.AddDays(1); + } + return true; + } + if (timelineView4Week.IsActive) + { + var actualStart = DateTimeHelper.GetStartOfWeekUI(start, scheduler_buchungsplan.FirstDayOfWeek); + var actualEnd = actualStart.AddDays(28); + dates.Clear(); + while (actualStart < actualEnd) + { + dates.Add(actualStart); + actualStart = actualStart.AddDays(1); + } + return true; + } + if (timelineViewMonth.IsActive) + { + var actualStart = new DateTime(start.Year, start.Month, 1); + var actualEnd = actualStart.AddMonths(1); + dates.Clear(); + while (actualStart < actualEnd) + { + dates.Add(actualStart); + actualStart = actualStart.AddDays(1); + } + return true; + } + if (timelineViewYear.IsActive) + { + var actualStart = new DateTime(start.Year, 1, 1); + var actualEnd = actualStart.AddYears(1); + dates.Clear(); + while (actualStart < actualEnd) + { + dates.Add(actualStart); + actualStart = actualStart.AddDays(1); + } + return true; + } + if (timelineViewQuartal.IsActive) + { + var actualStart = new DateTime(start.Year, start.Month, 1); + var actualEnd = actualStart.AddMonths(3); + dates.Clear(); + while (actualStart < actualEnd) + { + dates.Add(actualStart); + actualStart = actualStart.AddDays(1); + } + return true; + } + return false; + } + + private void scheduler_buchungsplan_PopupMenuShowing(object sender, DevExpress.Xpf.Scheduling.PopupMenuShowingEventArgs e) + { + var accept = new ContextMenuType[] { ContextMenuType.AppointmentContextMenu, ContextMenuType.CellContextMenu }; + + if (!accept.Contains(e.MenuType)) + { + e.Cancel = true; + return; + } + + PopupMenu menu = (PopupMenu)e.Menu; + foreach (var menuItem in menu.Items) + { + var barItem = menuItem as BarItem; + + if (barItem is null) + continue; + + barItem.Content = Translator.TranslateKey(barItem.Name, "???"); + } + } + + private void scheduler_buchungsplan_AppointmentWindowShowing(object sender, AppointmentWindowShowingEventArgs e) + { + if (_BelegungPopupWindow is object && _BelegungPopupWindow.IsVisible) + { + e.Handled = true; + e.Cancel = true; + return; + } + + var vm = e.Appointment.SourceObject as WohneinheitBelegungVM; + + bool success = vm.IsNew ? ViewModel.AddBelegung(e.Appointment.ResourceId, e.Appointment.Start.Date) : ViewModel.EditBelegung(vm); + + if (success) + { + _BelegungPopupWindow = e.Window; + + e.Window.DataContext = ViewModel; + } + else + { + e.Cancel = true; + } + } + } +} diff --git a/BeWo/View/Detail/Wohneinheit/WohneinheitBelegungTableView.xaml b/BeWo/View/Detail/Wohneinheit/WohneinheitBelegungTableView.xaml new file mode 100644 index 000000000..e35c8acdb --- /dev/null +++ b/BeWo/View/Detail/Wohneinheit/WohneinheitBelegungTableView.xaml @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/BeWo/View/Detail/Wohneinheit/WohneinheitEditPopup.xaml.cs b/BeWo/View/Detail/Wohneinheit/WohneinheitEditPopup.xaml.cs new file mode 100644 index 000000000..0278fffda --- /dev/null +++ b/BeWo/View/Detail/Wohneinheit/WohneinheitEditPopup.xaml.cs @@ -0,0 +1,141 @@ +using BeWo.ViewModel; +using BeWo.ViewModel.ListViewModel; +using BS.Shared.Extensions; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Controls.Primitives; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; + +namespace BeWo.View.Detail.Wohneinheit +{ + /// + /// Interaktionslogik für WohneinheitEditControl.xaml + /// + public partial class WohneinheitEditPopup : Popup + { + public static readonly DependencyProperty ViewModelProperty = DependencyProperty.Register( + "ViewModel", typeof(WohnheimVM), + typeof(WohneinheitEditPopup), + new PropertyMetadata(null) + ); + + public WohnheimVM ViewModel + { + get => (WohnheimVM)GetValue(ViewModelProperty); + set => SetValue(ViewModelProperty, value); + } + + public bool AddMode { get; set; } + + public WohneinheitEditPopup() + { + InitializeComponent(); + } + + private void Save_Button_Click(object sender, RoutedEventArgs e) + { + ViewModel.WohneinheitListVM.AddNewVMToList(); + + IsOpen = false; + } + + private void Cancel_Button_Click(object sender, RoutedEventArgs e) + { + ViewModel.WohneinheitListVM.ResetNewVM(); + + IsOpen = false; + } + + private void Popup_Opened(object sender, EventArgs e) + { + var vmlist = ViewModel.WohneinheitListVM; + + AddMode = vmlist.EditVM is null; + + if (AddMode) + { + btn_cancel.Visibility = Visibility.Visible; + btn_save.Visibility = Visibility.Visible; + StaysOpen = true; + groupbox_newWohneinheit.Header = "Wohneinheit erstellen"; + } + else + { + btn_cancel.Visibility = Visibility.Collapsed; + btn_save.Visibility = Visibility.Collapsed; + StaysOpen = false; + groupbox_newWohneinheit.Header = "Wohneinheit bearbeiten"; + + var current = vmlist.CurrentVM; + if (!string.IsNullOrEmpty(current.Wohnname) && combobox_wohnungsname.Items.Contains(current.Wohnname)) + { + combobox_wohnungsname.SelectedItem = current.Wohnname; + } + else + { + combobox_wohnungsname.SelectedItem = null; + } + } + } + + private void Popup_Closed(object sender, EventArgs e) + { + var vmlist = ViewModel.WohneinheitListVM; + var currentvm = vmlist.CurrentVM; + + if (currentvm is object) + { + if (AddMode) + { + vmlist.CurrentVM = null; + vmlist.NewVM = null; + } + else + { + vmlist.CloseEditVM(); + } + } + } + + private void SetValuesFromParent(WohneinheitVM vm, WohneinheitVM parent_vm) + { + if (vm is null || parent_vm is null) + return; + + if (vm.Stock.IsNullOrEmpty() && parent_vm.Stock.IsNotNullOrEmpty()) + { + vm.Stock = parent_vm.Stock; + } + + if (!vm.Baujahr.HasValue && parent_vm.Baujahr.HasValue) + { + vm.Baujahr = parent_vm.Baujahr; + } + } + + private void combobox_wohnungsname_DropDownClosed(object sender, EventArgs e) + { + var vm = ViewModel.WohneinheitListVM.CurrentVM; + + if (vm is null) + return; + + var selected_item = combobox_wohnungsname.SelectedItem as string; + + var selected_vm = ViewModel.WohneinheitListVM.VMList.FirstOrDefault(x => x.Wohnname == selected_item); + + SetValuesFromParent(vm, selected_vm); + } + } +} diff --git a/BeWo/View/Detail/Wohneinheit/WohneinheitGrundrissModalPopup.xaml b/BeWo/View/Detail/Wohneinheit/WohneinheitGrundrissModalPopup.xaml new file mode 100644 index 000000000..94381ecfb --- /dev/null +++ b/BeWo/View/Detail/Wohneinheit/WohneinheitGrundrissModalPopup.xaml @@ -0,0 +1,73 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/BeWo/View/Detail/Wohneinheit/WohneinheitGrundrissModalPopup.xaml.cs b/BeWo/View/Detail/Wohneinheit/WohneinheitGrundrissModalPopup.xaml.cs new file mode 100644 index 000000000..5fb24859d --- /dev/null +++ b/BeWo/View/Detail/Wohneinheit/WohneinheitGrundrissModalPopup.xaml.cs @@ -0,0 +1,99 @@ +using BeWo.Core; +using BeWo.ViewModel; +using BeWo.ViewModel.ListViewModel; +using BS.Shared.DataContracts; +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; + +namespace BeWo.View.Detail.Wohneinheit +{ + /// + /// Interaktionslogik für WohneinheitGrundrissControl.xaml + /// + public partial class WohneinheitGrundrissModalPopup : BeWoView + { + public ImageListVM Images { get; set; } + + public WohneinheitGrundrissModalPopup(ImageListVM images) + { + InitializeComponent(); + + this.CommandBindings.Add(new CommandBinding(ApplicationCommands.Close, + (s, e) => + { + BeWoApp.MainControl.CloseCurrentPopUp(); + })); + + Images = images; + + DataContext = Images.VMList; + } + + private void MenuItem_Add_Click(object sender, RoutedEventArgs e) + { + var dialog = new Microsoft.Win32.OpenFileDialog(); + dialog.Title = "Wähle einen Grundriss aus"; + dialog.Filter = "ALL supported Graphics| *.jpeg; *.jpg;*.png;"; + + // Show open file dialog box + bool? result = dialog.ShowDialog(); + + if (result != true) + return; + + var info = new FileInfo(dialog.FileName); + + if (!info.Exists) + return; + + var vm = new ImageVM(); + + vm.Filename = info.Name; + vm.Fullname = info.FullName; + vm.Original = File.ReadAllBytes(info.FullName); + + Images.VMList.Add(vm); + } + + private void MenuItem_Del_Click(object sender, RoutedEventArgs e) + { + var t = PhotosListBox.SelectedItem as ImageVM; + + if (t is null) + return; + + Images.VMList.Remove(t); + } + + private void StackPanel_MouseDown(object sender, MouseButtonEventArgs e) + { + var stackpanel = sender as StackPanel; + + var image = stackpanel?.Children?[0] as Image; + + var image_source = image?.Source; + + if (image_source is object) + { + if(e.ClickCount >= 2) + { + BeWoUtils.ShowImageForm(image_source); + } + } + } + } +} diff --git a/BeWo/View/Detail/Wohneinheit/WohneinheitVerwaltungViewV1.xaml b/BeWo/View/Detail/Wohneinheit/WohneinheitVerwaltungViewV1.xaml new file mode 100644 index 000000000..89cf58dfe --- /dev/null +++ b/BeWo/View/Detail/Wohneinheit/WohneinheitVerwaltungViewV1.xaml @@ -0,0 +1,75 @@ + + + + + + + + + + + + + + + + +
diff --git a/BeWoPlanerMobil/Views/Main/Main.cshtml b/BeWoPlanerMobil/Views/Main/Main.cshtml index abd390151..8cf7c4643 100644 --- a/BeWoPlanerMobil/Views/Main/Main.cshtml +++ b/BeWoPlanerMobil/Views/Main/Main.cshtml @@ -70,113 +70,7 @@ return "@Model.EinheitZeiterfassung" === "0"; } - function textModuleOnClick(textModuleOid) { - var focusedDokuFeld; - - var dokufeldId = "#dokufeld"; - var dokuTextareaId = "#doku-textarea-"; - var textareaContainerId = "#doku_"; - - if("@Model.IsInMultiBookingMode".toLocaleLowerCase() === "true") { - dokufeldId = "#mb-dokufeld"; - dokuTextareaId = "#mb-doku-textarea-"; - textareaContainerId = "#mb-doku_"; - } - - $.get(getLoadCompleteTextbausteinByOidUrl(), { pTextbausteinOid: textModuleOid }).done(function(textModuleText) { - if ($(dokufeldId).length > 0) { - focusedDokuFeld = $(dokufeldId); - } else { - var numberOfDokutypes = getNumberOfDokutypes(); - - for (var i = 0; i < numberOfDokutypes; i++) { - var currentElement = $("#doku_" + i); - - if (currentElement.css("display") !== "none") { - focusedDokuFeld = $(dokuTextareaId + i); - break; - } - } - } - - var cursorPosition = focusedDokuFeld.prop("selectionStart"); - var v = focusedDokuFeld.val(); - var textBefore = v.substring(0, cursorPosition); - var textAfter = v.substring(cursorPosition, v.length); - - focusedDokuFeld.val(textBefore + textModuleText + textAfter); - - $("#textbausteine-popup").modal("hide"); - }); - } - - function loadServiceDescriptions(categorySelectId, leistungSelectId, textmoduleContainerId, treeId) { - showSpinner(); - var selectedCategoryOid = $(`#${categorySelectId}`).find(":selected").val(); - - if (selectedCategoryOid === null || selectedCategoryOid === undefined) { - hideSpinner(); - return; - } - - $.get("@Url.Action("LoadServiceCategories")", { pServiceCategoryOid: selectedCategoryOid }) - .done(function (data) { - if(false === checkJson(data)) { - logWarning("loadServiceDescriptions: Der zurückgegebene Wert ist kein gültiges JSON!"); - hideSpinner(); - return; - } - - var serviceDescriptions = parseJason(data); - var serviceDescriptionsSelect = $(`#${leistungSelectId}`); - - serviceDescriptionsSelect.empty(); - serviceDescriptionsSelect.val(""); - - $.each(serviceDescriptions, function (index, serviceDescription) { - serviceDescriptionsSelect.append(``); - }); - - var serviceDescriptionToEdit = 0; - - if(@Model.SelectedServiceRecordsServiceDescriptionOid > 0) { - serviceDescriptionToEdit = parseFloat("@Model.SelectedServiceRecordsServiceDescriptionOid"); - } else if ("@Model.SelectedServiceDescriptionOid.HasValue.ToString().ToLower()" === "true") { - serviceDescriptionToEdit = parseFloat("@Model.SelectedServiceDescriptionOid"); - } - - var selectedOid = 0; - - if(serviceDescriptionToEdit > 0) { - $(`#${leistungSelectId} > option`).each(function() { - var val = $(this).val(); - - if(serviceDescriptionToEdit == val) { - serviceDescriptionsSelect.val(val); - selectedOid = val; - } - }); - } else { - if(serviceDescriptions[0] !== undefined) { - var servDescrOid = serviceDescriptions[0].ServiceDescriptionOid; - logInfo(`ServiceDescriptionOid: ${servDescrOid}`); - serviceDescriptionsSelect.val(servDescrOid); - selectedOid = servDescrOid; - } - } - - if(selectedOid > 0) { - $.get(getSetServiceDescriptionUrl(), { pServiceDescriptionOid: selectedOid }).done(function() { - hideSpinner(); - }); - } - - $("#" + textmoduleContainerId).show(); - $("#" + treeId).load('@Url.Action("LoadUpToDateTextModules")', null, function () { - hideSpinner(); - }); - }); - } + $(function() { $("#start-date-picker").datetimepicker({ @@ -282,9 +176,9 @@ leistungSelectId = "mb-leistung-select"; }*@ - if("@Model.IsInGroupBookingMode".toLowerCase() === "false") { + @*if("@Model.IsInGroupBookingMode".toLowerCase() === "false") { loadServiceDescriptions("category-select", "leistung-select", 'textmodule-container', 'tree'); - } + }*@ initializeTimeInputs(); @@ -491,18 +385,10 @@ return "@Url.Action("SetServiceRecordEmployee")"; } - function getLoadServiceCategoriesUrl() { - return "@Url.Action("LoadServiceCategories")"; - } - function getSetServiceDescriptionUrl() { return "@Url.Action("SetServiceDescription")"; } - function getLoadCompleteTextbausteinByOidUrl() { - return "@Url.Action("LoadCompleteTextbausteinByOid")"; - } - function getNumberOfDokutypes() { return @Model.NumberOfDokuTypes; } @@ -539,10 +425,6 @@ return @Html.Raw(Json.Encode(Model.SelectedGoals.Select(s => s.ValueListEntryOid.Value).ToArray())); } - function getUpdateGoalsUrl() { - return "@Url.Action("UpdateGoals")"; - } - function getIsInEditingMode() { var boolString = "@Model.IsInEditingMode"; @@ -969,7 +851,7 @@ @*----- Ziele/Maßnahmen-Popup ----- *@