From 5dc9e6c9a12f91c661534953e811eca7e99ae957 Mon Sep 17 00:00:00 2001 From: staccatomamba Date: Fri, 7 Apr 2017 13:50:07 +0200 Subject: [PATCH 1/4] SearchDAO Kalender --- Data/Access/SearchDAO.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/Data/Access/SearchDAO.cs b/Data/Access/SearchDAO.cs index d596b439f..eb5713868 100644 --- a/Data/Access/SearchDAO.cs +++ b/Data/Access/SearchDAO.cs @@ -1069,6 +1069,7 @@ namespace BeWo.Data.Access .Add(Restrictions.Eq(BeWoEntityBase.PropertyName_IsActive, ActivationTypeId.Active)) .CreateCriteria(SchedulerAppointment.PropertyName_EmployeeList) .Add(Restrictions.And(Restrictions.And(Restrictions.Eq(Employee2SchedulerAppointment.PropertyName_IsPChanged, true), Restrictions.Not(Restrictions.Eq(Employee2SchedulerAppointment.PropertyName_Employee + ".Oid", employeeOid))), Restrictions.Not(Restrictions.Eq(Employee2SchedulerAppointment.PropertyName_ParticipationAnswer, ParticipationAnswer.Offen)))) + .Add(Restrictions.Not(Restrictions.Eq(Employee2SchedulerAppointment.PropertyName_ParticipationAnswer, ParticipationAnswer.Verstrichen))) .Add(Restrictions.IsNull(Employee2SchedulerAppointment.PropertyName_IsPC_CheckedTs)); var result = c.List(); From 85bbabb4d860d1ecbbcd1ad2a17e1cd6616d3d49 Mon Sep 17 00:00:00 2001 From: staccatomamba Date: Wed, 12 Apr 2017 10:55:32 +0200 Subject: [PATCH 2/4] Bugs im Kalender --- .../inspectionProfiles/Project_Default.xml | 15 -- .../inspectionProfiles/profiles_settings.xml | 7 - Android/BewoMitarbeiterApp/.idea/vcs.xml | 6 - .../BewoMitarbeiterApp/BewoMitarbeiterApp.iml | 2 +- Android/BewoMitarbeiterApp/app/app.iml | 33 +--- Android/BewoMitarbeiterApp/build.gradle | 2 +- BeWo/Scheduler/View/NewSchedulerView.xaml | 6 +- BeWo/Scheduler/View/NewSchedulerView.xaml.cs | 75 ++++++--- BeWo/Scheduler/View/RequestAnswerView.xaml | 40 ++--- BeWo/Scheduler/View/RequestAnswerView.xaml.cs | 142 ++++++++++++------ .../View/SchedulerAppointmentEditForm.xaml | 4 +- .../View/SchedulerAppointmentEditForm.xaml.cs | 18 +-- .../ViewModel/NewSchedulerViewModel.cs | 20 +-- .../ViewModel/SchedulerAppointmentVM.cs | 17 ++- ...ultiSupportConceptSelectionControl.xaml.cs | 4 +- BeWo/View/Detail/ServiceRecordView2.xaml | 8 +- .../ResourceServiceImp.cs | 14 -- Shared/BeWoEntityEnums.cs | 9 +- 18 files changed, 221 insertions(+), 201 deletions(-) delete mode 100644 Android/BewoMitarbeiterApp/.idea/inspectionProfiles/Project_Default.xml delete mode 100644 Android/BewoMitarbeiterApp/.idea/inspectionProfiles/profiles_settings.xml delete mode 100644 Android/BewoMitarbeiterApp/.idea/vcs.xml diff --git a/Android/BewoMitarbeiterApp/.idea/inspectionProfiles/Project_Default.xml b/Android/BewoMitarbeiterApp/.idea/inspectionProfiles/Project_Default.xml deleted file mode 100644 index 382942f1d..000000000 --- a/Android/BewoMitarbeiterApp/.idea/inspectionProfiles/Project_Default.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - \ No newline at end of file diff --git a/Android/BewoMitarbeiterApp/.idea/inspectionProfiles/profiles_settings.xml b/Android/BewoMitarbeiterApp/.idea/inspectionProfiles/profiles_settings.xml deleted file mode 100644 index 3b312839b..000000000 --- a/Android/BewoMitarbeiterApp/.idea/inspectionProfiles/profiles_settings.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - \ No newline at end of file diff --git a/Android/BewoMitarbeiterApp/.idea/vcs.xml b/Android/BewoMitarbeiterApp/.idea/vcs.xml deleted file mode 100644 index b2bdec2d7..000000000 --- a/Android/BewoMitarbeiterApp/.idea/vcs.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/Android/BewoMitarbeiterApp/BewoMitarbeiterApp.iml b/Android/BewoMitarbeiterApp/BewoMitarbeiterApp.iml index fb3ed83ef..1e4a40047 100644 --- a/Android/BewoMitarbeiterApp/BewoMitarbeiterApp.iml +++ b/Android/BewoMitarbeiterApp/BewoMitarbeiterApp.iml @@ -13,7 +13,7 @@ - + \ No newline at end of file diff --git a/Android/BewoMitarbeiterApp/app/app.iml b/Android/BewoMitarbeiterApp/app/app.iml index 7ec9dbda5..96a41f48a 100644 --- a/Android/BewoMitarbeiterApp/app/app.iml +++ b/Android/BewoMitarbeiterApp/app/app.iml @@ -66,14 +66,6 @@ - - - - - - - - @@ -82,34 +74,25 @@ - + + + + + + + + - - - - - - - - - - - - - - - - diff --git a/Android/BewoMitarbeiterApp/build.gradle b/Android/BewoMitarbeiterApp/build.gradle index eb6bdaa34..0b3adfcc1 100644 --- a/Android/BewoMitarbeiterApp/build.gradle +++ b/Android/BewoMitarbeiterApp/build.gradle @@ -5,7 +5,7 @@ buildscript { jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:2.2.2' + classpath 'com.android.tools.build:gradle:2.2.3' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files } diff --git a/BeWo/Scheduler/View/NewSchedulerView.xaml b/BeWo/Scheduler/View/NewSchedulerView.xaml index 9ee721a31..41857b4b8 100644 --- a/BeWo/Scheduler/View/NewSchedulerView.xaml +++ b/BeWo/Scheduler/View/NewSchedulerView.xaml @@ -964,10 +964,10 @@ this.Dispatch(() => { - var erg = ((!BeWoApp.LoggedOnUser.HasRight(UserRightType.KalenderKliententermineAlleAnsehen)) ? liste.Where(c => c.IsRelatedToEmployee).ToList() : liste).Where(c => c.IsArchived == false).ToList(); + var erg = (!BeWoApp.LoggedOnUser.HasRight(UserRightType.KalenderKliententermineAlleAnsehen) ? liste.Where(c => c.IsRelatedToEmployee).ToList() : liste).Where(c => c.IsArchived == false).ToList(); AllCustomers = erg; CustomerList = AllCustomers; @@ -829,10 +829,41 @@ namespace BeWo.Scheduler.View private void UpdateRequestString() { ServiceFacade.DoResourceServiceSync(r => Liste = r.GetAllOpenAppointmentsForEmployee(BeWoApp.LoggedOnEmployee.EmployeeOid.Value)); - var summe = Liste.Count; - Enabled = Liste.Count > 0; - Requests = string.Format("{0} Benachrichtigung{1}", summe == 0 ? "keine" : summe.ToString(), summe == 1 ? "" : "en"); + var count = 0; + var oidList = new List(); + foreach (var termin in Liste) + { + if (termin.Originator.EmployeeOid == BeWoApp.LoggedOnEmployee.EmployeeOid.Value) + { + foreach (var status in termin.EmployeeList.Where(w => w.Employee.EmployeeOid != BeWoApp.LoggedOnEmployee.EmployeeOid.Value)) + { + if (status.IsPChanged && status.ParticipationAnswer != ParticipationAnswer.Offen && status.ParticipationAnswer != ParticipationAnswer.Verstrichen && !oidList.Contains(status.Employee2SchedulerAppointmentOid.Value)) + { + oidList.Add(status.Employee2SchedulerAppointmentOid.Value); + count++; + } + } + } + else + { + if (termin.EmployeeList.Any(a => a.Employee.EmployeeOid == BeWoApp.LoggedOnEmployee.EmployeeOid.Value)) + { + foreach (var status in termin.EmployeeList.Where(w => w.Employee.EmployeeOid == BeWoApp.LoggedOnEmployee.EmployeeOid.Value)) + { + if (!status.IsPChanged && status.ParticipationAnswer != ParticipationAnswer.Offen && status.ParticipationAnswer != ParticipationAnswer.Verstrichen && !oidList.Contains(status.Employee2SchedulerAppointmentOid.Value)) + { + oidList.Add(status.Employee2SchedulerAppointmentOid.Value); + count++; + } + } + } + } + } + + + Enabled = count > 0; + Requests = $"{(count == 0 ? "keine" : count.ToString())} Benachrichtigung{(count == 1 ? "" : "en")}"; } private List Liste = new List(); @@ -938,9 +969,9 @@ namespace BeWo.Scheduler.View //Synchronize(); } - private void scheduler_EditAppointmentFormShowing(object sender, EditAppointmentFormEventArgs e) + private void Scheduler_EditAppointmentFormShowing(object sender, EditAppointmentFormEventArgs e) { - var control = (DevExpress.Xpf.Scheduler.SchedulerControl) sender; + var control = (SchedulerControl) sender; if (istNeu) { @@ -967,7 +998,7 @@ namespace BeWo.Scheduler.View private void SchedulerControl_EditRecurrentAppointmentFormShowing(object sender, EditAppointmentFormEventArgs e) { } - private void scheduler_PopupMenuShowing(object sender, SchedulerMenuEventArgs e) + private void Scheduler_PopupMenuShowing(object sender, SchedulerMenuEventArgs e) { if (!BeWoApp.LoggedOnUser.HasRight(UserRightType.KalenderMitarbeitertermineAnsehen) || !BeWoApp.LoggedOnUser.HasRight(UserRightType.Mitarbeiterstundenkonto_ViewAll)) @@ -993,13 +1024,13 @@ namespace BeWo.Scheduler.View } private bool istNeu; - private void scheduler_InitNewAppointment(object sender, AppointmentEventArgs e) + private void Scheduler_InitNewAppointment(object sender, AppointmentEventArgs e) { istNeu = true; ViewModel.InitNewAppointment(e.Appointment); } - private void scheduler_AppointmentViewInfoCustomizing(object sender, DevExpress.Xpf.Scheduler.AppointmentViewInfoCustomizingEventArgs e) + private void Scheduler_AppointmentViewInfoCustomizing(object sender, DevExpress.Xpf.Scheduler.AppointmentViewInfoCustomizingEventArgs e) { e.ViewInfo.CustomViewInfo = e.ViewInfo.Appointment.CustomFields; } @@ -1008,14 +1039,12 @@ namespace BeWo.Scheduler.View { var darfTerminDetailsSehen = true; var appointment = e.Appointment; - var ersteller = (CompactEmployeeDC) appointment.CustomFields["Originator"]; + var ersteller = (CompactEmployeeDC) appointment.CustomFields["Originator"]; var mitarbeiterliste = (List)appointment.CustomFields["EmployeeList"]; var hatNurAndereMitarbeiter = mitarbeiterliste.Count > 0 && !(mitarbeiterliste.Count == 1 && mitarbeiterliste.ElementAt(0).Employee.EmployeeOid.Equals(BeWoApp.LoggedOnEmployee.EmployeeOid)); var hatKlienten = ((List) appointment.CustomFields["CustomerList"]).Count > 0; - bool istErsteller = ersteller.EmployeeOid.Equals(BeWoApp.LoggedOnEmployee.EmployeeOid); - - //var hatRessourcen = ((List) apt.CustomFields["ResourceList"]).Count > 0; + var istErsteller = ersteller.EmployeeOid.Equals(BeWoApp.LoggedOnEmployee.EmployeeOid); if (hatNurAndereMitarbeiter || !istErsteller) { @@ -1139,7 +1168,9 @@ namespace BeWo.Scheduler.View var zuBestaetigen = vm.Appointments.Where(app => { - if (!app.CustomFields.ContainsKey("EmployeeList")) + var originator = (CompactEmployeeDC) app.CustomFields["Originator"]; + + if (!app.CustomFields.ContainsKey("EmployeeList") || originator.EmployeeOid == BeWoApp.LoggedOnEmployee.EmployeeOid.Value) { return false; } @@ -1159,7 +1190,7 @@ namespace BeWo.Scheduler.View var empList = (List) app.CustomFields["EmployeeList"]; var or = (CompactEmployeeDC) app.CustomFields["Originator"]; - return or.EmployeeOid.Equals(BeWoApp.LoggedOnEmployee.EmployeeOid) && empList.Any(a => a.IsPChanged && a.ParticipationAnswer != ParticipationAnswer.Offen && !a.Employee.EmployeeOid.Equals(BeWoApp.LoggedOnEmployee.EmployeeOid)); + 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(); if (!zuBestaetigen.Any() && !updates.Any()) @@ -1167,13 +1198,13 @@ namespace BeWo.Scheduler.View return; } - var x = new RequestAnswerView(zuBestaetigen, updates); + var requestAnswerView = new RequestAnswerView(zuBestaetigen, updates); - x.Closed += RequestAnswerViewClosedEvent; - x.ParticipationChanged += UpdateRequestStringEvent; - x.ParticipationChanged += UpdateBeiParticipationChanged; - - x.Show(); + requestAnswerView.Closed += RequestAnswerViewClosedEvent; + requestAnswerView.ParticipationChanged += UpdateRequestStringEvent; + requestAnswerView.ParticipationChanged += UpdateBeiParticipationChanged; + + requestAnswerView.Show(); } private void RequestAnswerViewClosedEvent(object sender, EventArgs e) diff --git a/BeWo/Scheduler/View/RequestAnswerView.xaml b/BeWo/Scheduler/View/RequestAnswerView.xaml index 86c00a756..beec41c81 100644 --- a/BeWo/Scheduler/View/RequestAnswerView.xaml +++ b/BeWo/Scheduler/View/RequestAnswerView.xaml @@ -34,7 +34,7 @@ - +