diff --git a/BeWo/BeWoApp.xaml.cs b/BeWo/BeWoApp.xaml.cs index 73acc38ec..ebd0c6214 100644 --- a/BeWo/BeWoApp.xaml.cs +++ b/BeWo/BeWoApp.xaml.cs @@ -465,6 +465,9 @@ namespace BeWo val = UserSettingsUtils.GetSettingValue(_Mandator.Settings, SettingsKeys.AllowStorno); AppSettings.AllowStorno = val != null && val.Equals("1"); + val = UserSettingsUtils.GetSettingValue(_Mandator.Settings, SettingsKeys.UseDistanceApi); + AppSettings.UseDistanceApi = val != null && val.Equals("1"); + val = UserSettingsUtils.GetSettingValue(_Mandator.Settings, SettingsKeys.ShowHilfeplanStatistikReport); AppSettings.ShowHilfeplanStatistikReport = val != null && val.Equals("1"); diff --git a/BeWo/Core/Config/AppSettings.cs b/BeWo/Core/Config/AppSettings.cs index ef9534d43..4bc97806a 100644 --- a/BeWo/Core/Config/AppSettings.cs +++ b/BeWo/Core/Config/AppSettings.cs @@ -410,7 +410,9 @@ namespace BeWo.Core.Config public bool ShowInfoButtonInCalender{ get; set; } public bool AllowStorno { get; set; } - + + public bool UseDistanceApi { get; set; } + public bool ShowEmployeeSignature { get; set; } public bool SetStartTimeToEndTimeAfterSave { get; set; } diff --git a/BeWo/Core/Service/Cache.cs b/BeWo/Core/Service/Cache.cs index 9fe1669e2..03b91b21b 100644 --- a/BeWo/Core/Service/Cache.cs +++ b/BeWo/Core/Service/Cache.cs @@ -551,5 +551,44 @@ namespace BeWo.Core.Service return mAllCompactCustomers; } + + public void GetSchedulerObjects(Action, List, Dictionary>> callback) + { + GetAllActiveEmployeesCompact(allEmployees => + { + GetAllActiveCustomersCompact(allCustomers => + { + GetCategories2ResourcesDictionary(resourceDictionary => + { + if(!BeWoApp.LoggedOnUser.HasRight(UserRightType.KalenderMitarbeitertermineAnsehen)) + { + allEmployees = new List { BeWoApp.CompactLoggedOnEmployee }; + } + + var darfKlientenAnsichtSehen = BeWoApp.LoggedOnUser.HasRight(UserRightType.Customer_ViewMyTeams) || BeWoApp.LoggedOnUser.HasRight(UserRightType.Customer_ViewMyCustomers) || BeWoApp.LoggedOnUser.HasRight(UserRightType.CustomerView_View); + var darfTermineAllerKlientenSehen = BeWoApp.LoggedOnUser.HasRight(UserRightType.KalenderKliententermineAlleAnsehen); + + if(darfKlientenAnsichtSehen) + { + if(!darfTermineAllerKlientenSehen || !BeWoApp.LoggedOnUser.HasRight(UserRightType.CustomerView_View)) + { + allCustomers = allCustomers.Where(w => w.IsRelatedToEmployee).ToList(); + } + } + else + { + allCustomers.Clear(); + } + + if(!BeWoApp.LoggedOnUser.HasRight(UserRightType.KalenderRessourcentermineAnsehen)) + { + resourceDictionary.Clear(); + } + + callback(allCustomers, allEmployees, resourceDictionary); + }); + }); + }); + } } } \ No newline at end of file diff --git a/BeWo/Scheduler/View/NewSchedulerView.xaml.cs b/BeWo/Scheduler/View/NewSchedulerView.xaml.cs index 96706d8f3..8eb0d05c0 100644 --- a/BeWo/Scheduler/View/NewSchedulerView.xaml.cs +++ b/BeWo/Scheduler/View/NewSchedulerView.xaml.cs @@ -432,52 +432,55 @@ namespace BeWo.Scheduler.View ConstructObject(); } - private void GetCacheObjects(Action, List, Dictionary>> callback) + // ToDo: In den Cache verschieben + private static void GetCacheObjects(Action, List, Dictionary>> callback) { - Cache.GetInstance().GetAllActiveEmployeesCompact(allEmployees => - { - this.Dispatch(() => - { - Cache.GetInstance().GetAllActiveCustomersCompact(allCustomers => - { - this.Dispatch(() => - { - Cache.GetInstance().GetCategories2ResourcesDictionary(resourceDictionary => - { - this.Dispatch(() => - { - if(!BeWoApp.LoggedOnUser.HasRight(UserRightType.KalenderMitarbeitertermineAnsehen)) - { - allEmployees = new List {BeWoApp.CompactLoggedOnEmployee}; - } + //Cache.GetInstance().GetAllActiveEmployeesCompact(allEmployees => + //{ + // this.Dispatch(() => + // { + // Cache.GetInstance().GetAllActiveCustomersCompact(allCustomers => + // { + // this.Dispatch(() => + // { + // Cache.GetInstance().GetCategories2ResourcesDictionary(resourceDictionary => + // { + // this.Dispatch(() => + // { + // if(!BeWoApp.LoggedOnUser.HasRight(UserRightType.KalenderMitarbeitertermineAnsehen)) + // { + // allEmployees = new List {BeWoApp.CompactLoggedOnEmployee}; + // } - var darfKlientenAnsichtSehen = BeWoApp.LoggedOnUser.HasRight(UserRightType.Customer_ViewMyTeams) || BeWoApp.LoggedOnUser.HasRight(UserRightType.Customer_ViewMyCustomers) || BeWoApp.LoggedOnUser.HasRight(UserRightType.CustomerView_View); - var darfTermineAllerKlientenSehen = BeWoApp.LoggedOnUser.HasRight(UserRightType.KalenderKliententermineAlleAnsehen); + // var darfKlientenAnsichtSehen = BeWoApp.LoggedOnUser.HasRight(UserRightType.Customer_ViewMyTeams) || BeWoApp.LoggedOnUser.HasRight(UserRightType.Customer_ViewMyCustomers) || BeWoApp.LoggedOnUser.HasRight(UserRightType.CustomerView_View); + // var darfTermineAllerKlientenSehen = BeWoApp.LoggedOnUser.HasRight(UserRightType.KalenderKliententermineAlleAnsehen); - if(darfKlientenAnsichtSehen) - { - if(!darfTermineAllerKlientenSehen || !BeWoApp.LoggedOnUser.HasRight(UserRightType.CustomerView_View)) - { - allCustomers = allCustomers.Where(w => w.IsRelatedToEmployee).ToList(); - } - } - else - { - allCustomers.Clear(); - } + // if(darfKlientenAnsichtSehen) + // { + // if(!darfTermineAllerKlientenSehen || !BeWoApp.LoggedOnUser.HasRight(UserRightType.CustomerView_View)) + // { + // allCustomers = allCustomers.Where(w => w.IsRelatedToEmployee).ToList(); + // } + // } + // else + // { + // allCustomers.Clear(); + // } - if(!BeWoApp.LoggedOnUser.HasRight(UserRightType.KalenderRessourcentermineAnsehen)) - { - resourceDictionary.Clear(); - } + // if(!BeWoApp.LoggedOnUser.HasRight(UserRightType.KalenderRessourcentermineAnsehen)) + // { + // resourceDictionary.Clear(); + // } - callback(allCustomers, allEmployees, resourceDictionary); - }); - }); - }); - }); - }); - }); + // callback(allCustomers, allEmployees, resourceDictionary); + // }); + // }); + // }); + // }); + // }); + //}); + + Cache.GetInstance().GetSchedulerObjects(callback); } private void ConstructObject() @@ -1659,38 +1662,9 @@ namespace BeWo.Scheduler.View { var neueListe = new SchedulerAppointmentListVM(_Liste, AllCustomers, AllEmployees, Category2ResourcesDictionary); - var vm = neueListe; + var zuBestaetigen = InitAppointmentsToAnswer(neueListe); - var zuBestaetigen = vm.Appointments.Where(app => - { - var customFieldStorage = (CustomFieldStorage) app.CustomFields[nameof(CustomFieldStorage)]; - - var originator = customFieldStorage.Originator; - - if(customFieldStorage.EmployeeList == null || originator.EmployeeOid == BeWoApp.LoggedOnEmployee.EmployeeOid.Value) - { - return false; - } - - var empList = customFieldStorage.EmployeeList; - - return empList.Any(a => a.Employee.EmployeeOid.Equals(BeWoApp.LoggedOnEmployee.EmployeeOid) && a.ParticipationAnswer == ParticipationAnswer.Offen); - }).ToList(); - - var updates = vm.Appointments.Where(app => - { - var customFieldStorage = (CustomFieldStorage) app.CustomFields[nameof(CustomFieldStorage)]; - - if(customFieldStorage.Originator == null || customFieldStorage.EmployeeList == null) - { - return false; - } - - var empList = customFieldStorage.EmployeeList; - var or = customFieldStorage.Originator; - - return or.EmployeeOid.Equals(BeWoApp.LoggedOnEmployee.EmployeeOid) && empList.Any(a => a.IsPChanged && a.ParticipationAnswer != ParticipationAnswer.Offen && a.ParticipationAnswer != ParticipationAnswer.Verstrichen && !a.Employee.EmployeeOid.Equals(BeWoApp.LoggedOnEmployee.EmployeeOid)); - }).ToList(); + var updates = InitAppointmentStatusUpdates(neueListe); if(!zuBestaetigen.Any() && !updates.Any()) { @@ -1706,6 +1680,43 @@ namespace BeWo.Scheduler.View requestAnswerView.Show(); } + public static List InitAppointmentsToAnswer(SchedulerAppointmentListVM listVm) + { + return listVm.Appointments.Where(app => + { + var customFieldStorage = (CustomFieldStorage)app.CustomFields[nameof(CustomFieldStorage)]; + + var originator = customFieldStorage.Originator; + + if(customFieldStorage.EmployeeList is null || originator.EmployeeOid == BeWoApp.LoggedOnEmployee.EmployeeOid.Value) + { + return false; + } + + var empList = customFieldStorage.EmployeeList; + + return empList.Any(a => a.Employee.EmployeeOid.Equals(BeWoApp.LoggedOnEmployee.EmployeeOid) && a.ParticipationAnswer == ParticipationAnswer.Offen); + }).ToList(); + } + + public static List InitAppointmentStatusUpdates(SchedulerAppointmentListVM listVm) + { + return listVm.Appointments.Where(app => + { + var customFieldStorage = (CustomFieldStorage)app.CustomFields[nameof(CustomFieldStorage)]; + + if(customFieldStorage.Originator is null || customFieldStorage.EmployeeList is null) + { + return false; + } + + var empList = customFieldStorage.EmployeeList; + var or = customFieldStorage.Originator; + + return or.EmployeeOid.Equals(BeWoApp.LoggedOnEmployee.EmployeeOid) && empList.Any(a => a.IsPChanged && a.ParticipationAnswer != ParticipationAnswer.Offen && a.ParticipationAnswer != ParticipationAnswer.Verstrichen && !a.Employee.EmployeeOid.Equals(BeWoApp.LoggedOnEmployee.EmployeeOid)); + }).ToList(); + } + private void RequestAnswerViewClosedEvent(object sender, EventArgs e) { ReloadVM(true); diff --git a/BeWo/Scheduler/View/RequestAnswerView.xaml.cs b/BeWo/Scheduler/View/RequestAnswerView.xaml.cs index c4962c046..fb1a686c9 100644 --- a/BeWo/Scheduler/View/RequestAnswerView.xaml.cs +++ b/BeWo/Scheduler/View/RequestAnswerView.xaml.cs @@ -9,6 +9,7 @@ using System.Windows.Controls; using System.Windows.Data; using BeWo.Annotations; +using BeWo.Core.Service; using BeWo.Scheduler.ViewModel; using BeWo.ServiceProxy; @@ -62,30 +63,38 @@ namespace BeWo.Scheduler.View public RequestAnswerView(IEnumerable appointments, IEnumerable statusUpdates) { - var statusUpdatesAsAppointments = new List(); - - foreach(var beWoAppointment in statusUpdates) - { - var item = (SchedulerAppointmentVM) beWoAppointment; - foreach(var relation in item.EmployeeList.Where(emp => emp.IsPChanged && emp.ParticipationAnswer != ParticipationAnswer.Offen && emp.ParticipationAnswer != ParticipationAnswer.Verstrichen && !emp.Employee.EmployeeOid.Equals(BeWoApp.LoggedOnEmployee.EmployeeOid))) - { - if(statusUpdatesAsAppointments.All(a => a.LabelKey != relation.Employee2SchedulerAppointmentOid)) - { - if(relation.Employee2SchedulerAppointmentOid != null) - { - statusUpdatesAsAppointments.Add(BuildNewVMFromOldVM(item, relation.Employee2SchedulerAppointmentOid.Value)); - } - } - } - } - - OffeneTermine = appointments.ToObservableCollection(); - OffeneTermine.AddRange(new List(statusUpdatesAsAppointments)); + InitViewModel(appointments, statusUpdates); DataContext = this; InitializeComponent(); } - + + private void InitViewModel(IEnumerable appointments, IEnumerable statusUpdates) + { + var statusUpdatesAsAppointments = new List(); + + foreach(var beWoAppointment in statusUpdates) + { + var item = (SchedulerAppointmentVM) beWoAppointment; + foreach(var relation in item.EmployeeList.Where(emp => emp.IsPChanged && emp.ParticipationAnswer != ParticipationAnswer.Offen && emp.ParticipationAnswer != ParticipationAnswer.Verstrichen && !emp.Employee.EmployeeOid.Equals(BeWoApp.LoggedOnEmployee.EmployeeOid))) + { + if(statusUpdatesAsAppointments.Any(a => a.LabelKey == relation.Employee2SchedulerAppointmentOid)) + { + continue; + } + + if(relation.Employee2SchedulerAppointmentOid != null) + { + statusUpdatesAsAppointments.Add(BuildNewVMFromOldVM(item, relation.Employee2SchedulerAppointmentOid.Value)); + } + } + } + + OffeneTermine = appointments.ToObservableCollection(); + OffeneTermine.AddRange(new List(statusUpdatesAsAppointments)); + OnPropertyChanged(nameof(OffeneTermine)); + } + private static SchedulerAppointmentVM BuildNewVMFromOldVM(SchedulerAppointmentVM item, long emp2AppOid) { var customFieldStorage = (CustomFieldStorage) item.CustomFields[nameof(CustomFieldStorage)]; @@ -164,78 +173,45 @@ namespace BeWo.Scheduler.View private void UpdateView(List aktualisierteTermine) { - foreach (var dc in aktualisierteTermine) - { - foreach (var ivm in OffeneTermine) - { - var vm = ivm as SchedulerAppointmentVM; - if (vm == null || !vm.DataContract.Equals(dc)) - { - continue; - } + if(BeWoApp.LoggedOnEmployeeOid is null) + { + return; + } - var found = vm; - found.DataContract = dc; + ServiceFacade.DoResourceServiceAsync(s => s.GetAllOpenAppointmentsForEmployee(BeWoApp.LoggedOnEmployeeOid.Value), offeneTermine => + { + Cache.GetInstance().GetSchedulerObjects((customers, employees, categoriesToResources) => + { + this.Dispatch(() => + { + var listVm = new SchedulerAppointmentListVM(offeneTermine, customers, employees, categoriesToResources); - UpdateViewModel(dc, (SchedulerAppointmentVM) ivm); + var appointmentsToAnswer = NewSchedulerView.InitAppointmentsToAnswer(listVm); + var appointmentStatusUpdates = NewSchedulerView.InitAppointmentStatusUpdates(listVm); - vm.UpdateCustomFields(); - - if (vm.LabelKey is null) - { - this.Dispatch(() => - { - OffeneTermine = OffeneTermine.Where(w => !w.Equals(vm)).ToObservableCollection(); + InitViewModel(appointmentsToAnswer, appointmentStatusUpdates); - if (raiseChangeEvent) - { - OnPropertyChanged(nameof(OffeneTermine)); + RaiseParticipationChangedEventEvent(); - RaiseParticipationChangedEventEvent(); - } - }); - } - else - { - var test = (SchedulerAppointmentVM) OffeneTermine.FirstOrDefault(f => dc.EmployeeList.Any(a => a.Employee2SchedulerAppointmentOid.HasValue && a.Employee2SchedulerAppointmentOid.Value == f.LabelKey)); - this.Dispatch(() => + ToggleControls(); + + if(!raiseChangeEvent) { - OffeneTermine = OffeneTermine.Where(w => !w.Equals(test)).ToObservableCollection(); - if (raiseChangeEvent) - { - OnPropertyChanged(nameof(OffeneTermine)); + return; + } - RaiseParticipationChangedEventEvent(); - } - }); - } - } - } - - this.Dispatch(() => - { - RaiseParticipationChangedEventEvent(); - - ToggleControls(); - - if (!raiseChangeEvent) - { - //Close(); - } - else - { - if (OffeneTermine.Count == 0 && OTListView.Items.Count == 0) - { - Close(); - } - else - { - OTListView.SelectedIndex = 0; - } - } - - }); - } + if(OffeneTermine.Count == 0 && OTListView.Items.Count == 0) + { + Close(); + } + else + { + OTListView.SelectedIndex = 0; + } + }); + }); + }); + } private void OK_OnClick(object sender, RoutedEventArgs e) { @@ -280,16 +256,11 @@ namespace BeWo.Scheduler.View ServiceFacade.DoResourceServiceAsync(s => s.UpdateSchedulerAppointments(new List {((SchedulerAppointmentVM) SelektierterTermin).DataContract}), UpdateView); } - private static void UpdateViewModel(SchedulerAppointmentDC dc, SchedulerAppointmentVM vm) - { - vm.EmployeeList = new ObservableCollection(dc.EmployeeList); - } - private void ToggleControls() { - ZusagenStack.IsEnabled = !ZusagenStack.IsEnabled; - OkButton.IsEnabled = !OkButton.IsEnabled; - CloseBtn.IsEnabled = !CloseBtn.IsEnabled; + ZusagenStack.IsEnabled = !ZusagenStack.IsEnabled; + OkButton.IsEnabled = !OkButton.IsEnabled; + CloseBtn.IsEnabled = !CloseBtn.IsEnabled; AlleBestaetigen.IsEnabled = !AlleBestaetigen.IsEnabled; } diff --git a/BeWo/Scheduler/ViewModel/SchedulerAppointmentVM.cs b/BeWo/Scheduler/ViewModel/SchedulerAppointmentVM.cs index a9e3a59a3..9cb135def 100644 --- a/BeWo/Scheduler/ViewModel/SchedulerAppointmentVM.cs +++ b/BeWo/Scheduler/ViewModel/SchedulerAppointmentVM.cs @@ -813,6 +813,9 @@ namespace BeWo.Scheduler.ViewModel set => base.IsNew = value; } + /// + /// Wird im RequestAnswerView benutzt, um ein VM-Objekt pro Zusage/Absage/Vorbehalt zu erzeugen + /// public long? LabelKey { get; set; } public List ServiceRecordList diff --git a/BeWo/SchulbegleitenderDienst/SchulbegleitenderDienstCustomerView.xaml b/BeWo/SchulbegleitenderDienst/SchulbegleitenderDienstCustomerView.xaml index 76abc61b4..438d40057 100644 --- a/BeWo/SchulbegleitenderDienst/SchulbegleitenderDienstCustomerView.xaml +++ b/BeWo/SchulbegleitenderDienst/SchulbegleitenderDienstCustomerView.xaml @@ -22,9 +22,12 @@ - + + + + @@ -34,18 +37,28 @@ + + diff --git a/BeWo/SchulbegleitenderDienst/SchulbegleitenderDienstEmployeeView.xaml b/BeWo/SchulbegleitenderDienst/SchulbegleitenderDienstEmployeeView.xaml index a19f7dffb..794e62012 100644 --- a/BeWo/SchulbegleitenderDienst/SchulbegleitenderDienstEmployeeView.xaml +++ b/BeWo/SchulbegleitenderDienst/SchulbegleitenderDienstEmployeeView.xaml @@ -27,11 +27,13 @@ - + - + + + @@ -42,21 +44,24 @@ + @@ -86,7 +91,7 @@ - + diff --git a/BeWo/SchulbegleitenderDienst/TagesVertretung.cs b/BeWo/SchulbegleitenderDienst/TagesVertretung.cs index 48f871af6..d3affe83b 100644 --- a/BeWo/SchulbegleitenderDienst/TagesVertretung.cs +++ b/BeWo/SchulbegleitenderDienst/TagesVertretung.cs @@ -56,7 +56,9 @@ namespace BeWo.SchulbegleitenderDienst VertretungsStatus = vertretungsItem.VertretungsStatus, WochenansichtBemerkung = vertretungsItem.WochenansichtBemerkung, VertreterInfoString = vertretungsItem.VertreterInfoString, - ToolTip = vertretungsItem.ToolTip, + CustomerToolTip = vertretungsItem.CustomerToolTip, + EmployeeToolTip = vertretungsItem.EmployeeToolTip, + VertreterToolTip = vertretungsItem.VertreterToolTip, EmployeeAddressString = vertretungsItem.EmployeeAddressString, Id = vertretungsItem.Id, AssistanceTimeEntry = vertretungsItem.AssistanceTime diff --git a/BeWo/SchulbegleitenderDienst/TagesansichtVM.cs b/BeWo/SchulbegleitenderDienst/TagesansichtVM.cs index 17f67acbb..745f2a3a6 100644 --- a/BeWo/SchulbegleitenderDienst/TagesansichtVM.cs +++ b/BeWo/SchulbegleitenderDienst/TagesansichtVM.cs @@ -254,7 +254,11 @@ namespace BeWo.SchulbegleitenderDienst public new string VertreterInfoString { get; set; } - public string ToolTip { get; set; } + public string CustomerToolTip { get; set; } + + public string EmployeeToolTip { get; set; } + + public string VertreterToolTip { get; set; } public Guid Id { get; set; } diff --git a/BeWo/SchulbegleitenderDienst/VertretungsMainViewV2.xaml b/BeWo/SchulbegleitenderDienst/VertretungsMainViewV2.xaml index c83a01f67..eb6642e0f 100644 --- a/BeWo/SchulbegleitenderDienst/VertretungsMainViewV2.xaml +++ b/BeWo/SchulbegleitenderDienst/VertretungsMainViewV2.xaml @@ -15,34 +15,10 @@ xmlns:schulbegleitenderDienst="clr-namespace:BeWo.SchulbegleitenderDienst" Height="Auto" Width="Auto" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Focusable="True" x:Name="View"> - + - - - - - - - - - - - - - - - - - - - - - - @@ -371,7 +347,7 @@ - + - - - - - - - - + + @@ -701,13 +601,7 @@ - - - - - - - + @@ -753,7 +647,7 @@ - + @@ -784,32 +678,8 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - + + @@ -839,7 +709,7 @@ - + @@ -965,7 +835,7 @@ - + @@ -1143,36 +1013,8 @@ - - - - + + @@ -1301,37 +1143,8 @@ - - - - + + @@ -1349,11 +1162,7 @@ - - - - - + diff --git a/BeWo/SchulbegleitenderDienst/VertretungsMainViewV2.xaml.cs b/BeWo/SchulbegleitenderDienst/VertretungsMainViewV2.xaml.cs index ca6b41ba7..c1853317e 100644 --- a/BeWo/SchulbegleitenderDienst/VertretungsMainViewV2.xaml.cs +++ b/BeWo/SchulbegleitenderDienst/VertretungsMainViewV2.xaml.cs @@ -4,6 +4,7 @@ using System.Collections.ObjectModel; using System.Globalization; using System.Windows; using System.Windows.Controls; +using System.Windows.Controls.Primitives; using System.Windows.Documents; using System.Windows.Markup; using System.Windows.Navigation; @@ -1119,33 +1120,183 @@ namespace BeWo.SchulbegleitenderDienst } - private void TableView_MouseMove(object sender, System.Windows.Input.MouseEventArgs e) + private void TableView_MouseMove_Tagesansicht(object sender, System.Windows.Input.MouseEventArgs e) { var tv = sender as TableView; var hitInfo = tv.CalcHitInfo(e.OriginalSource as DependencyObject); var vm = tv.DataControl.GetRow(hitInfo.RowHandle) as TagesansichtVM; - if (vm != null && !String.IsNullOrEmpty(vm.ToolTip)) + //if (tooltipX > 0 && tooltipY > 0) + //{ + // //var p = e.GetPosition(this); + + // //if (Math.Abs(tooltipX - p.X) > 10 || Math.Abs(tooltipY - p.Y) > 10) + // //{ + // // PopupTooltip.IsOpen = false; + // // tooltipX = 0; + // // tooltipY = 0; + // //} + + //} + //else + if (vm != null && hitInfo.Column != null) { - var column = hitInfo.Column; - //SetTooltipXaml(vm.ToolTip); - PopupTooltip.IsOpen = true; + String tt = vm.CustomerToolTip; + String fn = hitInfo.Column.FieldName.ToLower(); + + if (fn.Contains("employee")) + { + tt = vm.EmployeeToolTip; + } + else if (fn.Contains("vertret")) + { + tt = vm.VertreterToolTip; + } + if (!String.IsNullOrEmpty(tt)) + { + Grid g = new Grid(); + + SetTooltipXaml(tt, g); + //ToolTip t = new ToolTip(); + //t.Content = g; + //if (tv.DataControl.ToolTip != null) + //{ + // var told = (ToolTip)tv.DataControl.ToolTip; + + // tv.DataControl.ToolTip = null; + + //} + + tv.DataControl.ToolTip = g; + //t.UpdateLayout(); + //tv.DataControl.ToolTip = g; + + } + else + { + + } + //var p = e.GetPosition(this); + //tooltipX = p.X; + //tooltipY = p.Y; + //var column = hitInfo.Column; + ////SetTooltipXaml(vm.ToolTip); + //var test = e.GetPosition(tv.DataControl); + //PopupTooltip.PlacementTarget = tv.DataControl; + //PopupTooltip.Placement = PlacementMode.Left; + //PopupTooltip.HorizontalOffset = 3; + //PopupTooltip.VerticalOffset = 3; + + + //PopupTooltip.PopupAnimation = PopupAnimation.Fade; + + ////PopupTooltip.IsOpen = true; + } - + } + private void TableView_MouseMove_Wochenansicht(object sender, System.Windows.Input.MouseEventArgs e) + { + var tv = sender as TableView; + var hitInfo = tv.CalcHitInfo(e.OriginalSource as DependencyObject); + var vm = tv.DataControl.GetRow(hitInfo.RowHandle) as WochenansichtVM; + + if (vm != null && hitInfo.Column != null) + { + String tt = ""; + + String fn = hitInfo.Column.FieldName.ToLower(); + + if (fn.Contains("itemmo") && vm.ItemMo != null) + { + tt = vm.ItemMo.VertreterToolTip; + } + else if (fn.Contains("itemdi") && vm.ItemDi != null) + { + tt = vm.ItemDi.VertreterToolTip; + } + else if (fn.Contains("itemmi") && vm.ItemMi != null) + { + tt = vm.ItemMi.VertreterToolTip; + } + else if (fn.Contains("itemdo") && vm.ItemDo != null) + { + tt = vm.ItemDo.VertreterToolTip; + } + else if (fn.Contains("itemfr") && vm.ItemFr != null) + { + tt = vm.ItemFr.VertreterToolTip; + } + else if (fn.Contains("itemsa") && vm.ItemSa != null) + { + tt = vm.ItemSa.VertreterToolTip; + } + else + { + TagesansichtVM tvm = null; + if (vm.ItemMo != null) + { + tvm = vm.ItemMo; + } + else if (vm.ItemDi != null) + { + tvm = vm.ItemDi; + } + else if (vm.ItemMi != null) + { + tvm = vm.ItemMi; + } + else if (vm.ItemDo != null) + { + tvm = vm.ItemDo; + } + else if (vm.ItemFr != null) + { + tvm = vm.ItemFr; + } + else if (vm.ItemSa != null) + { + tvm = vm.ItemSa; + } + if (tvm != null) + { + tt = tvm.CustomerToolTip; + if (fn.Contains("employee")) + { + tt = tvm.EmployeeToolTip; + } + else if (fn.Contains("vertret")) + { + tt = tvm.VertreterToolTip; + } + } + + } + if (!String.IsNullOrEmpty(tt)) + { + Grid g = new Grid(); + + SetTooltipXaml(tt, g); + + tv.DataControl.ToolTip = g; + } + + } + + } private void PopupTooltipGrid_MouseLeave(object sender, System.Windows.Input.MouseEventArgs e) { - PopupTooltip.IsOpen = false; + //PopupTooltip.IsOpen = false; } - public void SetTooltipXaml(string xamlCode) + public void SetTooltipXaml(string xamlCode, Grid parent) { try { if (XamlReader.Parse(xamlCode) is UIElement element) { - PopupTooltipGrid.Children.Add(element); + parent.Children.Add(element); } } catch (Exception e) diff --git a/BeWo/SchulbegleitenderDienst/VertretungsSearchView.xaml b/BeWo/SchulbegleitenderDienst/VertretungsSearchView.xaml index 928962005..1a5b69251 100644 --- a/BeWo/SchulbegleitenderDienst/VertretungsSearchView.xaml +++ b/BeWo/SchulbegleitenderDienst/VertretungsSearchView.xaml @@ -100,34 +100,42 @@ - + - - - + + - - - - + + + + - + + - - + + + + - +
@@ -324,40 +333,9 @@
-
-
-
-

Unterschrift

- -
-
-
- -
-
-
- -
-
-
-
- -
-
-
-
- - -
-
-
+
-
@@ -392,4 +370,64 @@
- \ No newline at end of file + + + + + \ No newline at end of file diff --git a/BeWoPlanerMobil/Views/Scheduler/OneDaySchedulerPartial.cshtml b/BeWoPlanerMobil/Views/Scheduler/OneDaySchedulerPartial.cshtml index 41c946f84..a0f629c5b 100644 --- a/BeWoPlanerMobil/Views/Scheduler/OneDaySchedulerPartial.cshtml +++ b/BeWoPlanerMobil/Views/Scheduler/OneDaySchedulerPartial.cshtml @@ -255,20 +255,20 @@ @if(Model.HasRightToEditAppointment(appointment.Identifier) && !appointment.IsTask && appointment.CanBeEdited) { -
+
- @if(appointment.Oid.HasValue) - { - using(Html.BeginForm("SelectAppointmentToEdit", "Scheduler", FormMethod.Post)) - { -
- - -
- } - } + @if(appointment.Oid.HasValue) + { + using(Html.BeginForm("SelectAppointmentToEdit", "Scheduler", FormMethod.Post)) + { +
+ + +
+ } + }
+

Lade ...

@@ -435,7 +455,7 @@
- +