From 0206362bd5564dab8d3a05833a15bd804f550e99 Mon Sep 17 00:00:00 2001 From: Lyndon Jetten Date: Wed, 14 Jul 2021 13:45:43 +0200 Subject: [PATCH] =?UTF-8?q?-=20Im=20MoK=20werden=20jetzt=20die=20Klienten?= =?UTF-8?q?=20so=20angezeigt=20wie=20auch=20im=20BeWoPlaner=20-=20Der=20ow?= =?UTF-8?q?nChat=20l=C3=A4dt=20jetzt=20asynchron=20Nachrichten,=20Kontakte?= =?UTF-8?q?,=20etc.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- BeWo/BeWoApp.xaml.cs | 3 ++ BeWo/View/Detail/SupportConceptView.xaml | 4 +- BeWo/View/Detail/TextbausteinView.xaml | 5 +- BeWo/View/Detail/TextbausteinView.xaml.cs | 9 +++- BeWo/ownChat/ChatView.xaml.cs | 49 ------------------- BeWoPlanerMobil/BeWoPlanerMobil.csproj | 3 ++ BeWoPlanerMobil/Controllers/MainController.cs | 2 +- BeWoPlanerMobil/Models/CustomerModel.cs | 2 +- Data/Access/SearchDAO.cs | 2 +- Shared/Core/Utils.cs | 14 +++--- 10 files changed, 30 insertions(+), 63 deletions(-) diff --git a/BeWo/BeWoApp.xaml.cs b/BeWo/BeWoApp.xaml.cs index 3ab22f738..c3f64e944 100644 --- a/BeWo/BeWoApp.xaml.cs +++ b/BeWo/BeWoApp.xaml.cs @@ -1046,6 +1046,9 @@ namespace BeWo { callback(serverUrl); } + }, errorMessage => + { + MessageBox.Show(errorMessage, "Fehler", MessageBoxButton.OK, MessageBoxImage.Error); }); } else diff --git a/BeWo/View/Detail/SupportConceptView.xaml b/BeWo/View/Detail/SupportConceptView.xaml index d5bc6796b..335dfabb4 100644 --- a/BeWo/View/Detail/SupportConceptView.xaml +++ b/BeWo/View/Detail/SupportConceptView.xaml @@ -838,7 +838,9 @@ - + diff --git a/BeWo/View/Detail/TextbausteinView.xaml b/BeWo/View/Detail/TextbausteinView.xaml index a98a1d52e..8abe9136e 100644 --- a/BeWo/View/Detail/TextbausteinView.xaml +++ b/BeWo/View/Detail/TextbausteinView.xaml @@ -164,9 +164,10 @@ + diff --git a/BeWo/View/Detail/TextbausteinView.xaml.cs b/BeWo/View/Detail/TextbausteinView.xaml.cs index 92a4146f8..f0c740109 100644 --- a/BeWo/View/Detail/TextbausteinView.xaml.cs +++ b/BeWo/View/Detail/TextbausteinView.xaml.cs @@ -261,12 +261,19 @@ namespace BeWo.View.Detail } } + // TODO: wird das gebraucht? Was tut es? private void PART_Editor_OnEditValueChanged(object sender, EditValueChangedEventArgs e) { var comboBoxEdit = (ComboBoxEdit) sender; var selectedTextModule = (TextModuleVM) comboBoxEdit.Tag; - selectedTextModule.Parent = (TextModuleVM) e.NewValue; + var oldValue = e.OldValue; + var newValue = e.NewValue; + + if(e.NewValue != null) + { + selectedTextModule.Parent = (TextModuleVM) e.NewValue; + } } private void FrameworkElement_OnLoaded(object sender, RoutedEventArgs e) diff --git a/BeWo/ownChat/ChatView.xaml.cs b/BeWo/ownChat/ChatView.xaml.cs index f6bfb5afd..b31191752 100644 --- a/BeWo/ownChat/ChatView.xaml.cs +++ b/BeWo/ownChat/ChatView.xaml.cs @@ -6,10 +6,8 @@ using System.Text; using System.Windows; using System.Windows.Forms; using System.Windows.Input; -using System.Windows.Threading; using BeWo.Core.Service; using BeWo.ServiceProxy; -using BeWo.View; using BeWo.ViewModel; using BS.Shared.DataContracts.Compact; using BS.Shared.Extensions; @@ -18,7 +16,6 @@ using ChatController.ChatKlassen; using ChatController.LoginKlassen; using Button = System.Windows.Controls.Button; using MessageBox = System.Windows.MessageBox; -using Panel = System.Windows.Controls.Panel; namespace BeWo.ownChat { @@ -99,7 +96,6 @@ namespace BeWo.ownChat // TODO: Für Mitarbeiter implementieren private void ChatMainControl_OnClickContextMenuItem(string menuItem) { - var selectedContact = ChatMainControl.GetCurrentContactWithUserIdManage(); if (selectedContact != null) @@ -140,8 +136,6 @@ namespace BeWo.ownChat { MessageBox.Show("Es können nur Nachrichten von KlientInnen dokumentiert werden.", "Dokumentieren nicht möglich", MessageBoxButton.OK, MessageBoxImage.Exclamation); } - - } private void OpenServiceRecordEditView(List messages, CompactCustomerDC compactCustomer) @@ -218,7 +212,6 @@ namespace BeWo.ownChat } - #region Fenstergrößenverstellung internal void Normal() { WindowState = (WindowState) FormWindowState.Normal; @@ -233,10 +226,6 @@ namespace BeWo.ownChat { WindowState = (WindowState)FormWindowState.Minimized; } - - #endregion - - #region Speichere/Lade MessageSync In DB private void SpeichereMessageInfosInDatenBank() { @@ -273,44 +262,6 @@ namespace BeWo.ownChat } } - #endregion - - #region Waitlayer - private WaitLayer2 _WaitLayer; - - public void StartWaiting() - { - Dispatcher.BeginInvoke(DispatcherPriority.Background, (Action)StartWaitingImmediately); - } - - public void StartWaitingImmediately() - { - if (_WaitLayer == null) - { - _WaitLayer = new WaitLayer2(); - - ChatViewGrid.Children.Add(_WaitLayer); - Panel.SetZIndex(_WaitLayer, int.MaxValue); - _WaitLayer.RefreshChatUI(); - } - } - - public void EndWaiting() - { - Dispatcher.BeginInvoke( - DispatcherPriority.Background, - (Action)delegate - { - if (_WaitLayer != null) - { - ChatViewGrid.Children.Remove(_WaitLayer); - _WaitLayer = null; - } - }); - } - - #endregion - private void ChatView_OnClosing(object sender, CancelEventArgs e) { HideWindowsAndSaveMessageInfo(); diff --git a/BeWoPlanerMobil/BeWoPlanerMobil.csproj b/BeWoPlanerMobil/BeWoPlanerMobil.csproj index 590e73c4f..6de27ef73 100644 --- a/BeWoPlanerMobil/BeWoPlanerMobil.csproj +++ b/BeWoPlanerMobil/BeWoPlanerMobil.csproj @@ -55,6 +55,9 @@ ..\packages\Antlr.3.5.0.2\lib\Antlr3.Runtime.dll + + False + False diff --git a/BeWoPlanerMobil/Controllers/MainController.cs b/BeWoPlanerMobil/Controllers/MainController.cs index 11000d407..5de7f0392 100644 --- a/BeWoPlanerMobil/Controllers/MainController.cs +++ b/BeWoPlanerMobil/Controllers/MainController.cs @@ -731,7 +731,7 @@ namespace BeWoPlanerMobil.Controllers } // Damit sind die allgemeinen gemeint! var textbausteine = OperationsService.GetAllTextModules(); - foreach (var tm in textbausteine) + foreach (var tm in textbausteine.Where(textModule => textModule.IsParent == false)) { if (string.IsNullOrWhiteSpace(tm.Text)) { diff --git a/BeWoPlanerMobil/Models/CustomerModel.cs b/BeWoPlanerMobil/Models/CustomerModel.cs index 8a583eafe..9916c63c0 100644 --- a/BeWoPlanerMobil/Models/CustomerModel.cs +++ b/BeWoPlanerMobil/Models/CustomerModel.cs @@ -54,7 +54,7 @@ namespace BeWoPlanerMobil.Models if(user != null) { - if(user.CheckForRight(UserRightType.ViewAll)) + if(user.CheckForAtLeastOneRight(new List { UserRightType.ViewAll, UserRightType.CustomerView_View})) { result.Add(new SelectListItem { Text = allCustomers, Value = allCustomersValue }); result.Add(new SelectListItem { Text = myCustomersOnly, Value = myCustomersValue }); diff --git a/Data/Access/SearchDAO.cs b/Data/Access/SearchDAO.cs index d9e216785..1d9490edb 100644 --- a/Data/Access/SearchDAO.cs +++ b/Data/Access/SearchDAO.cs @@ -4400,7 +4400,7 @@ namespace BeWo.Data.Access var lCriteria = CreateCriteriaIsActive(); // Der ApplicationUser darf alles sehen - if(user.CheckForRight(UserRightType.ViewAll) && customerFilter == CustomerFilterEnum.All) + if(user.CheckForAtLeastOneRight(new List { UserRightType.ViewAll, UserRightType.CustomerView_View }) && customerFilter == CustomerFilterEnum.All) { return lCriteria.List().ToList(); } diff --git a/Shared/Core/Utils.cs b/Shared/Core/Utils.cs index 506c7accb..e2692e1f1 100644 --- a/Shared/Core/Utils.cs +++ b/Shared/Core/Utils.cs @@ -525,8 +525,8 @@ namespace BS.Shared.Core { Bitmap originalBitmap = new Bitmap(image); - Point min = new Point(Int32.MaxValue, Int32.MaxValue); - Point max = new Point(Int32.MinValue, Int32.MinValue); + var min = new Point(Int32.MaxValue, Int32.MaxValue); + var max = new Point(Int32.MinValue, Int32.MinValue); for (int x = 0; x < originalBitmap.Width; ++x) { @@ -546,15 +546,15 @@ namespace BS.Shared.Core } // Create a new bitmap from the crop rectangleig - if (min.X < Int32.MaxValue && min.Y < Int32.MaxValue && max.X > Int32.MinValue && max.Y > Int32.MinValue) + if (min.X < int.MaxValue && min.Y < int.MaxValue && max.X > int.MinValue && max.Y > int.MinValue) { - Rectangle cropRectangle = new Rectangle(min.X, min.Y, max.X - min.X, max.Y - min.Y); + var cropRectangle = new Rectangle(min.X, min.Y, max.X - min.X, max.Y - min.Y); if (cropRectangle.Width > 0 && cropRectangle.Height > 0) { - Bitmap newBitmap = new Bitmap(cropRectangle.Width, cropRectangle.Height); - using (Graphics g = Graphics.FromImage(newBitmap)) + var newBitmap = new Bitmap(cropRectangle.Width, cropRectangle.Height); + using (var graphics = Graphics.FromImage(newBitmap)) { - g.DrawImage(originalBitmap, 0, 0, cropRectangle, GraphicsUnit.Pixel); + graphics.DrawImage(originalBitmap, 0, 0, cropRectangle, GraphicsUnit.Pixel); } return newBitmap;