Eddie Van Halen's got long hair.

This commit is contained in:
Lyndon
2017-12-12 17:20:23 -04:00
parent 8316409d81
commit 0237699c4a
15 changed files with 1696 additions and 1688 deletions

View File

@@ -2003,6 +2003,10 @@
<Project>{D5E53B0F-BF5A-41E8-93E2-0F32845FC729}</Project>
<Name>Controls</Name>
</ProjectReference>
<ProjectReference Include="..\Data\Data.csproj">
<Project>{B0D73E3D-4AE7-4024-93A6-DB1F46D7CCEE}</Project>
<Name>Data</Name>
</ProjectReference>
<ProjectReference Include="..\Shared\Shared.csproj">
<Project>{2F50B83D-A3F0-4EC4-979A-3F9B7E3D8ED4}</Project>
<Name>Shared</Name>

View File

@@ -888,7 +888,7 @@ namespace BeWo
BeWoApp.MainControl.HomeView.ServiceChatView.ChatMainControl.newThread != null)
{
BeWoApp.MainControl.HomeView.ServiceChatView.ChatMainControl.newThread = null;
BeWoApp.MainControl.HomeView.ServiceChatView.ChatMainControl.disableKontaktNachrichtenThread = true;
//BeWoApp.MainControl.HomeView.ServiceChatView.ChatMainControl.disableKontaktNachrichtenThread = true;
}
if (BeWoApp.MainControl.HomeView.ServiceChatView.ServiceChat._emojiView != null)

View File

@@ -85,7 +85,7 @@ namespace BeWo
BeWoApp.MainControl.HomeView.ServiceChatView.ChatMainControl.newThread != null)
{
BeWoApp.MainControl.HomeView.ServiceChatView.ChatMainControl.newThread = null;
BeWoApp.MainControl.HomeView.ServiceChatView.ChatMainControl.disableKontaktNachrichtenThread = true;
//BeWoApp.MainControl.HomeView.ServiceChatView.ChatMainControl.disableKontaktNachrichtenThread = true;
}
if (BeWoApp.MainControl.HomeView.ServiceChatView.ServiceChat._emojiView != null) {

View File

@@ -996,12 +996,11 @@
<dxsch:SchedulerControl.MonthView>
<dxsch:MonthView AppointmentToolTipContentTemplate="{StaticResource {dxscht:SchedulerViewThemeKey ResourceKey=AppointmentToolTipContentTemplate}}" />
</dxsch:SchedulerControl.MonthView>
<dxsch:SchedulerControl.TimelineView>
<dxsch:TimelineView AppointmentToolTipContentTemplate="{StaticResource {dxscht:SchedulerViewThemeKey ResourceKey=AppointmentToolTipContentTemplate}}" />
</dxsch:SchedulerControl.TimelineView>
<dxsch:SchedulerControl.Storage>
<dxsch:SchedulerStorage AppointmentsChanged="NewSchedulerStorage_AppointmentsChanged"
FilterAppointment="NewSchedulerControl_FilterAppointments"
<dxsch:SchedulerControl.TimelineView>
<dxsch:TimelineView AppointmentToolTipContentTemplate="{StaticResource {dxscht:SchedulerViewThemeKey ResourceKey=AppointmentToolTipContentTemplate}}" />
</dxsch:SchedulerControl.TimelineView>
<dxsch:SchedulerControl.Storage>
<dxsch:SchedulerStorage AppointmentsChanged="NewSchedulerStorage_AppointmentsChanged"
AppointmentDeleting="NewSchedulerStorage_AppointmentDeleting"
AppointmentsInserted="NewSchedulerStorage_AppointmentsInserted"
FetchAppointments="SchedulerStorage_OnFetchAppointments">

View File

@@ -739,8 +739,7 @@ namespace BeWo.Scheduler.View
private void ListItemCheckedEvent(object sender, RoutedEventArgs e)
{
Scheduler.ActiveView.LayoutChanged();
WriteToDebugLog("Scheduler layout change triggered");
UpdateVM(true);
}
private void BtnRemoveElement_Click(object sender, RoutedEventArgs e)
@@ -1195,7 +1194,7 @@ namespace BeWo.Scheduler.View
private void ShowPrivateAppointmentsCheckBox_OnClick(object sender, RoutedEventArgs e)
{
Scheduler.ActiveView.LayoutChanged();
UpdateVM(true);
}
private void LeftExpanderClick(object sender, RoutedEventArgs e)
@@ -1533,37 +1532,36 @@ namespace BeWo.Scheduler.View
var start = range.Start;
var end = range.End;
if (start > _lastFetchedInterval.Start && end < _lastFetchedInterval.End && !realoadBtnPressed)
{
WriteToDebugLog("Aborting");
return;
}
_lastFetchedInterval = new TimeInterval(start - FetchPadding, end + FetchPadding);
ViewModel.UpdateAppointmentViewModel(start, end);
ViewModel.UpdateAppointmentViewModel(start, end, SelectedEmployees.Select(s => s.EmployeeOid).ToList(), SelectedCustomers.Select(s => s.CustomerOid).ToList(), SelectedResources.Select(s => s.ResourceOid.Value).ToList(), MitarbeiterEbenenCheckBox.IsChecked.Value, KlientenEbenenCheckBox.IsChecked.Value, RessourcenEbenenCheckBox.IsChecked.Value, ShowPrivateAppointmentsCheckBox.IsChecked.Value, ZeigeNurMeineTermine, AbwesenheitenEinAusCheckBox.IsChecked.Value,
() =>
{
this.Dispatch(() =>
{
GefilterteMitarbeiter = ViewModel.ActiveAppointmentViewModel.AllEmployees;
AllEmployees = ViewModel.ActiveAppointmentViewModel.AllEmployees;
GefilterteKlienten = ViewModel.ActiveAppointmentViewModel.AllCustomers;
AllCustomers = ViewModel.ActiveAppointmentViewModel.AllCustomers;
GefilterteMitarbeiter = ViewModel.ActiveAppointmentViewModel.AllEmployees;
AllEmployees = ViewModel.ActiveAppointmentViewModel.AllEmployees;
GefilterteKlienten = ViewModel.ActiveAppointmentViewModel.AllCustomers;
AllCustomers = ViewModel.ActiveAppointmentViewModel.AllCustomers;
Category2ResourcesDictionary = ViewModel.ActiveAppointmentViewModel.Categories2Resources;
Category2ResourcesDictionary = ViewModel.ActiveAppointmentViewModel.Categories2Resources;
SelectedEmployees = AllEmployees.Where(w => SelectedEmployees.Any(a => a.EmployeeOid.Equals(w.EmployeeOid))).ToList();
SelectedCustomers = AllCustomers.Where(w => SelectedCustomers.Any(a => a.CustomerOid.Equals(w.CustomerOid))).ToList();
SelectedResources = AllResources.Where(w => SelectedResources.Any(a => a.ResourceOid.Equals(w.ResourceOid))).ToList();
SelectedEmployees = AllEmployees.Where(w => SelectedEmployees.Any(a => a.EmployeeOid.Equals(w.EmployeeOid))).ToList();
SelectedCustomers = AllCustomers.Where(w => SelectedCustomers.Any(a => a.CustomerOid.Equals(w.CustomerOid))).ToList();
SelectedResources = AllResources.Where(w => SelectedResources.Any(a => a.ResourceOid.Equals(w.ResourceOid))).ToList();
var items = SelectedItems;
var items = SelectedItems;
var testtesttest = ViewModel.ActiveAppointmentViewModel;
var testtesttest = ViewModel.ActiveAppointmentViewModel;
//OnPropertyChanged(nameof(AllResources));
//OnPropertyChanged(nameof(SelectedEmployees));
//OnPropertyChanged(nameof(SelectedItems));
//OnPropertyChanged(nameof(ViewModel));
OnPropertyChanged(nameof(AllResources));
OnPropertyChanged(nameof(SelectedEmployees));
OnPropertyChanged(nameof(SelectedItems));
OnPropertyChanged(nameof(ViewModel));
WriteToDebugLog("Done");
WriteToDebugLog("Done");
});
});
}
//private void ExportAsiCal(object sender, RoutedEventArgs e)

View File

@@ -37,52 +37,55 @@ namespace BeWo.Scheduler.ViewModel
private List<CompactEmployeeDC> _allEmployees = new List<CompactEmployeeDC>();
public void UpdateAppointmentViewModel(DateTime pIntervalStart, DateTime pIntervalEnd)
{
if(!BeWoApp.LoggedOnEmployee.EmployeeOid.HasValue)
{
return;
}
public void UpdateAppointmentViewModel(DateTime pIntervalStart, DateTime pIntervalEnd, List<long> pSelectedEmployees, List<long> pSelectedCustomer, List<long> pSelectedResources, bool pEmployeesOnly, bool pCustomersOnly, bool pResourcesOnly, bool pPrivateAppointmentsOnly, bool pOnlyMyAppointments, bool pShouldShowAbsenceTimes, Action callBack)
{
if (!BeWoApp.LoggedOnEmployee.EmployeeOid.HasValue)
{
return;
}
var appointments = new List<SchedulerAppointmentDC>();
var allCustomers = new List<CompactCustomerDC>();
var start = pIntervalStart - NewSchedulerView.FetchPadding;
var end = pIntervalEnd + NewSchedulerView.FetchPadding;
var abwesenheiten = new List<AbsenceTimeDC>();
Cache.GetInstance().GetAllActiveEmployeesCompact(allEmployees =>
{
ServiceFacade.DoResourceServiceAsync(s => s.GetAllCategories2ResourcesInDictionary(), cats2Res =>
{
ServiceFacade.DoResourceServiceAsync(s2 => s2.LoadFilteredAppointments(BeWoApp.HasLoggedOnUserRight(new[] { UserRightType.KalenderMitarbeitertermineAnsehen }), BeWoApp.LoggedOnEmployee.EmployeeOid.Value, start, end, pSelectedEmployees, pSelectedCustomer, pSelectedResources, pEmployeesOnly, pCustomersOnly, pResourcesOnly, pPrivateAppointmentsOnly, pOnlyMyAppointments),
appointments =>
{
Cache.GetInstance().GetAllActiveCustomersCompact(customers =>
{
if(BeWoApp.LoggedOnUser.HasRight(UserRightType.Customer_ViewMyCustomers) && !BeWoApp.LoggedOnUser.HasRight(UserRightType.CustomerView_View))
{
customers = customers.Where(c => BeWoApp.LoggedOnEmployee.RelatedCustomers.Any(a => a.Customer.Equals(c))).ToList();
}
_allEmployees = Cache.GetInstance().GetAllActiveEmployeesCompactSync();
ServiceFacade.DoResourceServiceAsync(s3 => s3.GetAllActiveAbsenceTimesInInterval(start, end, BeWoApp.LoggedOnEmployee.EmployeeOid.Value, BeWoApp.LoggedOnUser.HasRight(UserRightType.KalenderMitarbeitertermineAnsehen)),
absenceTimes =>
{
var prefilteredAppointments = appointments.Where(w => (w.EmployeeList.Count == 0 && w.Originator.EmployeeOid.Equals(BeWoApp.LoggedOnEmployee.EmployeeOid) ||
w.EmployeeList.Count > 0 && w.EmployeeList.Any(a => a.Employee.EmployeeOid.Equals(BeWoApp.LoggedOnEmployee.EmployeeOid)) ||
BeWoApp.LoggedOnUser.HasRight(UserRightType.KalenderMitarbeitertermineAnsehen)) && (!w.EmployeeList.TrueForAll(e2a => e2a.ParticipationAnswer == ParticipationAnswer.Absage) || (w.EmployeeList == null || w.EmployeeList.Count == 0))).ToList();
if(!BeWoApp.LoggedOnUser.HasRight(UserRightType.KalenderMitarbeitertermineAnsehen))
{
ServiceFacade.DoEmployeeServiceSync(es => _allEmployees = new List<CompactEmployeeDC> { es.LoadCompactEmployee(BeWoApp.LoggedOnEmployee.EmployeeOid.Value) });
}
var vm = new SchedulerAppointmentListVM(prefilteredAppointments, customers, allEmployees, cats2Res);
if(pShouldShowAbsenceTimes)
{
vm.Appointments.AddRange(ConvertAbsenceTimesToAppointments(absenceTimes, end));
}
// TODO: add absence times!
ServiceFacade.DoResourceServiceSync(s => _allCats2ResInDic = s.GetAllCategories2ResourcesInDictionary());
ActiveAppointmentViewModel = vm;
var start = pIntervalStart - NewSchedulerView.FetchPadding;
var end = pIntervalEnd + NewSchedulerView.FetchPadding;
SchedulerSettings = GetActiveSettings();
SchedulerSettings.StartDate = pIntervalEnd;
ServiceFacade.DoResourceServiceSync(rs => appointments = rs.GetAllActiveAppointmentsForEmployeeInInterval2(start, end, BeWoApp.LoggedOnEmployee.EmployeeOid.Value, BeWoApp.LoggedOnUser.HasRight(UserRightType.KalenderMitarbeitertermineAnsehen)));
ServiceFacade.DoResourceServiceSync(rs => abwesenheiten = rs.GetAllActiveAbsenceTimesInInterval(start, end, BeWoApp.LoggedOnEmployee.EmployeeOid.Value, BeWoApp.LoggedOnUser.HasRight(UserRightType.KalenderMitarbeitertermineAnsehen)));
allCustomers = Cache.GetInstance().GetAllActiveCustomersCompactSync();
if(BeWoApp.LoggedOnUser.HasRight(UserRightType.Customer_ViewMyCustomers) && !BeWoApp.LoggedOnUser.HasRight(UserRightType.CustomerView_View))
{
allCustomers = allCustomers.Where(c => BeWoApp.LoggedOnEmployee.RelatedCustomers.Any(a => a.Customer.Equals(c))).ToList();
}
var prefilteredAppointments = appointments.Where(w => (w.EmployeeList.Count == 0 && w.Originator.EmployeeOid.Equals(BeWoApp.LoggedOnEmployee.EmployeeOid) ||
w.EmployeeList.Count > 0 && w.EmployeeList.Any(a => a.Employee.EmployeeOid.Equals(BeWoApp.LoggedOnEmployee.EmployeeOid)) ||
BeWoApp.LoggedOnUser.HasRight(UserRightType.KalenderMitarbeitertermineAnsehen)) && (!w.EmployeeList.TrueForAll(e2a => e2a.ParticipationAnswer == ParticipationAnswer.Absage) || (w.EmployeeList == null || w.EmployeeList.Count == 0)));
var vm = new SchedulerAppointmentListVM(prefilteredAppointments.ToList(), allCustomers, _allEmployees, _allCats2ResInDic);
vm.VMList.AddRange(ConvertAbsenceTimesToAppointments(abwesenheiten, end));
ActiveAppointmentViewModel = vm;
SchedulerSettings = GetActiveSettings();
SchedulerSettings.StartDate = pIntervalStart;
callBack.Invoke();
});
});
});
});
});
}
public AbstractAppointmentEditForm GetEditAppointmentForm(DevExpress.Xpf.Scheduler.SchedulerControl control, Appointment appointment)

View File

@@ -46,9 +46,12 @@ namespace BeWo.Scheduler.ViewModel
{
get
{
if (_appointmentList != null) return _appointmentList;
if (_appointmentList != null)
{
return _appointmentList;
}
_appointmentList = new BindingList<IBeWoAppointment>();
_appointmentList = new BindingList<IBeWoAppointment>();
_appointmentList.AddingNew += AppointmentListAddingNew;
foreach (var item in VMList)

File diff suppressed because it is too large Load Diff

View File

@@ -2,126 +2,85 @@
using System.Linq;
using System.Windows;
using System.Windows.Input;
using System.Windows.Media;
using BeWo.ServiceProxy;
using BeWo.ViewModel;
using BS.Shared.Extensions;
using System.Windows.Controls;
using System.Net.Sockets;
using System.Threading;
using System.Windows.Threading;
using System.Collections;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.ComponentModel;
using System.IO;
using System.Text;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Media.Imaging;
using BeWo.Core.Service;
using BeWo.View;
using BeWo.View.Detail;
using BeWo.ViewModel.ListViewModel;
using BS.Shared;
using BS.Shared.DataContracts;
using BS.Shared.DataContracts.Compact;
using ChatController.ChatKlassen;
using DevExpress.Xpf.Core;
using DevExpress.XtraPrinting.Native;
using DevExpress.XtraPrinting.XamlExport;
using Microsoft.Office.Interop.Word;
using Color = System.Drawing.Color;
namespace BeWo.ownChat
{
public partial class ChatDokumentationsView
{
//protected List<KontaktMessageBuilder> listarray;
//protected long? loggedOnMitarbeiter;
private ServiceRecordVM serviceRecord;
//Konstruktor für Chat
public ChatDokumentationsView(List<ChatMessage> _listarray, long? _loggedOnMitarbeiter,CompactCustomerDC _compactCustomer)
public ChatDokumentationsView(List<KontaktMessageBuilder> _listarray, long? _loggedOnMitarbeiter,CompactCustomerDC _compactCustomer)
{
InitializeComponent();
StartWaiting();
Show();
object[] parameter = new object[3];
var parameter = new object[3];
parameter[0] = _listarray;
parameter[1] = _loggedOnMitarbeiter;
parameter[2] = _compactCustomer;
Thread newThread = new Thread(LoadDokumentation);
newThread.IsBackground = true;
var newThread = new Thread(LoadDokumentation) {IsBackground = true};
newThread.Start(parameter);
}
private void LoadDokumentation(object o)
{
var x = (object[])o;
List<ChatMessage> _listarray = (List<ChatMessage>)x[0];
var _listarray = (List<KontaktMessageBuilder>)x[0];
long? _loggedOnMitarbeiter = (long?)x[1];
var _loggedOnMitarbeiter = (long?)x[1];
CompactCustomerDC _compactCustomer = (CompactCustomerDC)x[2];
var _compactCustomer = (CompactCustomerDC)x[2];
List<ChatMessage> listarray = _listarray;
long? loggedOnMitarbeiter = _loggedOnMitarbeiter;
var listarray = _listarray;
var loggedOnMitarbeiter = _loggedOnMitarbeiter;
string message = "";
listarray.Sort((a, b) => a.SendTime.CompareTo(b.SendTime));
var message = listarray.Aggregate("", (current, ita) => current + (ita.SendTime + " - " + ita.Username + ": " + ita.UserMessage + "\n"));
listarray.Sort((a, b) => a.SendTime.CompareTo(b.SendTime));
foreach (var ita in listarray)
{
//if (ita.ImageSources != null)
//{
// message += ita.SendTime + " - " + ita.Username + ": " + "Datei " + ita.OriginalImageName +
// " aus ownChat übernommen und in Dokumenten abgelegt" + "\n";
//}
//else
//{
message += ita.SendTime + " - " + ita.Username + ": " + ita.UserMessage + "\n";
//}
}
//message to ascii Weil Utf 8 Code Kann die datenbank nicht handeln
System.Text.Encoding utf8 = System.Text.Encoding.UTF8;
Byte[] encodedBytes = utf8.GetBytes(message);
Byte[] convertedBytes =
Encoding.Convert(Encoding.UTF8, Encoding.ASCII, encodedBytes);
System.Text.Encoding ascii = System.Text.Encoding.ASCII;
string finalString = ascii.GetString(convertedBytes);
var utf8 = Encoding.UTF8;
var encodedBytes = utf8.GetBytes(message);
var convertedBytes = Encoding.Convert(Encoding.UTF8, Encoding.ASCII, encodedBytes);
var ascii = Encoding.ASCII;
var finalString = ascii.GetString(convertedBytes);
message = finalString;
var firstTime = listarray.Min(r =>
{
var dt = r.SendTime;//DateTime.Parse(r.InternalSendTime);
var dt = DateTime.Parse(r.SendTime);//DateTime.Parse(r.InternalSendTime);
dt = new DateTime(dt.Year, dt.Month, dt.Day, dt.Hour, dt.Minute, 0);
return dt;
});
var lastTime = listarray.Max(r =>
{
var dt = r.SendTime;//DateTime.Parse(r.SendTime);
var dt = DateTime.Parse(r.SendTime);//DateTime.Parse(r.SendTime);
dt = new DateTime(dt.Year, dt.Month, dt.Day, dt.Hour, dt.Minute, 0);
return dt;
});
CompactCustomerDC customerCompact = _compactCustomer;
Cache.GetInstance().GetActiveSupportConceptCostbearer(scList =>
@@ -130,13 +89,10 @@ namespace BeWo.ownChat
vm => this.Dispatch(
delegate
{
ServiceRecordEditView newView = new ServiceRecordEditView();
var newView = new ServiceRecordEditView();
vm.DispatcherObject = this;
var dc = ErstelleServiceRecordDC(firstTime, lastTime, customerCompact, scList);
if (vm.PrototypeVM.SortedCategories != null && vm.PrototypeVM.SortedCategories.Count > 0)
@@ -145,10 +101,11 @@ namespace BeWo.ownChat
dc.ServiceDescription = vm.PrototypeVM.Category2Services[cat1][0];
}
serviceRecord = new ServiceRecordVM(dc, vm.PrototypeVM.Category2Services, vm.PrototypeVM.AllGoalCategories, vm.PrototypeVM.AllGoals);
serviceRecord.Notice = message;
//bool hideCustomerCombo = serviceRecord.SupportConcept == null;
serviceRecord = new ServiceRecordVM(dc, vm.PrototypeVM.Category2Services, vm.PrototypeVM.AllGoalCategories, vm.PrototypeVM.AllGoals)
{
Notice = message
};
if (serviceRecord.SupportConcept == null)
{
@@ -160,30 +117,18 @@ namespace BeWo.ownChat
newView.InitView(vm, serviceRecord, false);
if (customerCompact != null)
{
newView.SetSearchText(customerCompact.LastName);
}
else
{
newView.SetSearchText("");
}
newView.SetSearchText(customerCompact != null ? customerCompact.LastName : "");
CommandBindingsCloseSave(newView);
Popup_Content(newView);
EndWaiting();
})));
}
//Konstruktor für Kalender
public ChatDokumentationsView( string notice, CompactCustomerDC _compactCustomer, DateTime firstTime, DateTime lastTime)
public ChatDokumentationsView(string notice, CompactCustomerDC _compactCustomer, DateTime firstTime, DateTime lastTime)
{
InitializeComponent();
@@ -234,9 +179,8 @@ namespace BeWo.ownChat
public ChatDokumentationsView(string notice, DateTime firstTime,DateTime lastTime ,List<CompactCustomerDC> _compactCustomer, List<CompactEmployeeDC> _compactEmployee)
{
InitializeComponent();
CompactCustomerDC customerCompact = _compactCustomer[0];
var customerCompact = _compactCustomer[0];
Cache.GetInstance().GetActiveSupportConceptCostbearer(scList =>
VMFactory.CreateServiceRecordVMAsync(

View File

@@ -1,41 +1,23 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Forms;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using System.Windows.Threading;
using BeWo.Core.Config;
using BeWo.ServiceProxy;
using BeWo.View;
using BS.Shared.DataContracts.Compact;
using BS.Shared.Extensions;
using ChatController;
using ChatController.ChatKlassen;
using ChatController.Klassen;
using DevExpress.Xpf.Core;
using Button = System.Windows.Controls.Button;
using MessageBox = System.Windows.MessageBox;
using Panel = System.Windows.Controls.Panel;
namespace BeWo.ownChat
{
/// <summary>
/// Interaktionslogik für ChatService.xaml
/// </summary>
public partial class ChatView : Window
public partial class ChatView
{
public ChatEmojiView _emojiView;
public ChatView(ChatDatenUebergabe chatDaten)
@@ -47,11 +29,6 @@ namespace BeWo.ownChat
ChatMainControl.AddContextMenu("In Dokumentation übernehmen", ChatMainControl_OnClickContextMenuItem);
LadeMessageInfoAusDatenBank();
//Thread newThread = new Thread(ChatMainControl.DoSynchroForBewoplaner);
//newThread.IsBackground = true;
//newThread.Start();
}
private void RootGroupBox_OnMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
@@ -68,7 +45,6 @@ namespace BeWo.ownChat
CommandBindings.Add(new CommandBinding(ApplicationCommands.Close, (s, e) =>
{
HideWindowsAndSaveMessageInfo();
}));
}
@@ -76,12 +52,7 @@ namespace BeWo.ownChat
{
Visibility = Visibility.Hidden;
if (_emojiView != null)
{
_emojiView.Close(); // hidden
}
_emojiView?.Close();
SpeichereMessageInfosInDatenBank();
}
@@ -93,39 +64,30 @@ namespace BeWo.ownChat
_emojiView = new ChatEmojiView(ChatMainControl);
var x = emojiButton.PointToScreen(new Point(0, 0));
PresentationSource source = PresentationSource.FromVisual(emojiButton);
var source = PresentationSource.FromVisual(emojiButton);
_emojiView.Top = (x.Y / source.CompositionTarget.TransformToDevice.M22) - _emojiView.Height - 5;
_emojiView.Top = x.Y / source.CompositionTarget.TransformToDevice.M22 - _emojiView.Height - 5;
_emojiView.Left = x.X / source.CompositionTarget.TransformToDevice.M11;
_emojiView.Show();
}
else
{
_emojiView.Close();
_emojiView = null;
//if (_emojiView.Visibility == Visibility.Visible)
//{
// _emojiView.Visibility = Visibility.Hidden; // hidden
//}
//else
//{
_emojiView.Close();
_emojiView = null;
_emojiView = new ChatEmojiView(ChatMainControl);
var x = emojiButton.PointToScreen(new Point(0, 0));
var source = PresentationSource.FromVisual(emojiButton);
_emojiView = new ChatEmojiView(ChatMainControl);
var x = emojiButton.PointToScreen(new Point(0, 0));
PresentationSource source = PresentationSource.FromVisual(emojiButton);
_emojiView.Top = x.Y / source.CompositionTarget.TransformToDevice.M22 - _emojiView.Height - 5;
_emojiView.Left = x.X / source.CompositionTarget.TransformToDevice.M11;
_emojiView.Top = (x.Y / source.CompositionTarget.TransformToDevice.M22) - _emojiView.Height - 5;
_emojiView.Left = x.X / source.CompositionTarget.TransformToDevice.M11;
_emojiView.Show();
//}
_emojiView.Show();
}
}
private void ChatMainControl_OnClickContextMenuItem(String menuItem)
private void ChatMainControl_OnClickContextMenuItem(string menuItem)
{
var aktuellerKontakt = ChatMainControl.GetAktuellenKontakt();
@@ -135,50 +97,20 @@ namespace BeWo.ownChat
if (itemListe != null)
{
List<long> sdf = new List<long>();
//hier die Customer Oid hinzufügen
sdf.Add(aktuellerKontakt.CustomerPersonOid.Value);
var sdf = new List<long> {aktuellerKontakt.CustomerPersonOid.Value};
var compactCustomerlist = ServiceFacade.DoCustomerServiceSync(s => s.GetCompactCustomersById(sdf));
if (compactCustomerlist != null)
{
CompactCustomerDC compactCustomer = null;
foreach (var cc in compactCustomerlist)
{
compactCustomer = cc;
}
//bool hasImage = false;
//foreach (var item in itemListe)
//{
// if (item.ImageSources != null)
// {
// hasImage = true;
// }
//}
//if (hasImage)
//{
// if (MessageBox.Show("Dateien können nicht in die Zeiterfassung übernommen werden."+
// "\nMöchten Sie dieses Dokument stattdessen in den Dokumenten des Klienten speichern?","Dokumentieren", MessageBoxButton.YesNo, MessageBoxImage.Question) == MessageBoxResult.Yes)
// {
// //lege Imagesource in KLlient Dokumente ab
// ChatDokumentationsView newView = new ChatDokumentationsView(itemListe,
// BeWoApp.LoggedOnUser.Employee.PersonOid, compactCustomer);
// }
//}
//else {
ChatDokumentationsView newView = new ChatDokumentationsView(itemListe,
BeWoApp.LoggedOnUser.Employee.PersonOid, compactCustomer);
//}
//newView.ShowDialog();
var newView = new ChatDokumentationsView(itemListe, BeWoApp.LoggedOnUser.Employee.PersonOid, compactCustomer);
}
else
{
@@ -187,7 +119,7 @@ namespace BeWo.ownChat
}
else
{
MessageBox.Show("Bitte Nachricht auswählen", "Nachricht auswählen", MessageBoxButton.OK, MessageBoxImage.Information);
MessageBox.Show("Bitte Nachricht auswählen.", "Nachricht auswählen", MessageBoxButton.OK, MessageBoxImage.Information);
}
}
else
@@ -196,33 +128,6 @@ namespace BeWo.ownChat
}
}
//private void LoadDokumentation(object o)
//{
// var x = (object[])o;
// List<KontaktMessageBuilder> liste = (List<KontaktMessageBuilder>) x[0];
// long? oid = (long?) x[1];
// CompactCustomerDC dc = (CompactCustomerDC) x[2];
// this.Dispatcher.BeginInvoke(
// DispatcherPriority.Background,
// (Action)delegate
// {
// ChatDokumentationsView newView = new ChatDokumentationsView(liste,oid, dc);
// EndWaiting();
// newView.ShowDialog();
// });
//}
#region Fenster Größen verstellung
internal void Normal()
{
@@ -327,7 +232,6 @@ namespace BeWo.ownChat
#endregion
private void ChatView_OnClosing(object sender, CancelEventArgs e)
{
HideWindowsAndSaveMessageInfo();

View File

@@ -15,15 +15,15 @@
NHibernate.Driver.MySqlDataDriver
</property>
<property name="connection.connection_string">
<!--<property name="connection.connection_string">
Server=localhost;Password=root;User ID=root;Initial Catalog=bewodemo
</property>
</property>-->
<!--<property name="connection.connection_string">
Server=localhost;Password=root;User ID=root;Initial Catalog=1234567890
</property>-->
<property name="connection.connection_string">
Server=localhost;Password=root;User ID=root;Initial Catalog=betreuwo
</property>
<property name="dialect">
<property name="dialect">
NHibernate.Dialect.MySQLDialect
</property>
<property name="proxyfactory.factory_class">

View File

@@ -1296,11 +1296,9 @@ namespace BeWo.Data.Access
Restrictions.Not(Restrictions.Eq(Employee2SchedulerAppointment.PropertyName_ParticipationAnswer, ParticipationAnswer.Absage))));
detachedCriteria.SetProjection(Projections.Property(Employee2SchedulerAppointment.PropertyName_SchedulerAppointment));
var recurrenceBetween = String.Format("'{0} 00:00:00' BETWEEN STR_TO_DATE(SUBSTRING({1}, 24, 19), '%m/%d/%Y %H:%i:%s') AND STR_TO_DATE(SUBSTRING({1}, 50, 19), '%m/%d/%Y %H:%i:%s')",
start.ToString("yyyy-MM-dd"),
SchedulerAppointment.PropertyName_RecurrenceInfo);
var recurrenceBetween = string.Format("'{0:yyyy-MM-dd} 00:00:00' BETWEEN STR_TO_DATE(SUBSTRING({1}, 24, 19), '%m/%d/%Y %H:%i:%s') AND STR_TO_DATE(SUBSTRING({1}, 50, 19), '%m/%d/%Y %H:%i:%s')", start, SchedulerAppointment.PropertyName_RecurrenceInfo);
var hasResources = String.Format("{0} IN (SELECT newschappoid FROM resource2newschapp)", BeWoEntityBase.PropertyName_Oid);
var hasResources = $"{BeWoEntityBase.PropertyName_Oid} IN (SELECT newschappoid FROM resource2newschapp)";
var criteria = CreateCriteria<SchedulerAppointment>()
.Add(Restrictions.Eq(BeWoEntityBase.PropertyName_IsActive, ActivationTypeId.Active))
@@ -1324,7 +1322,7 @@ namespace BeWo.Data.Access
public IEnumerable<SchedulerAppointment> GetAllActiveAppointmentsInInterval(DateTime start, DateTime end)
{
var recurrenceBetween = String.Format("'{0} 00:00:00' BETWEEN STR_TO_DATE(SUBSTRING({1}, 24, 19), '%m/%d/%Y %H:%i:%s') AND STR_TO_DATE(SUBSTRING({1}, 50, 19), '%m/%d/%Y %H:%i:%s')", start.ToString("yyyy-MM-dd"), SchedulerAppointment.PropertyName_RecurrenceInfo);
var recurrenceBetween = string.Format("'{0} 00:00:00' BETWEEN STR_TO_DATE(SUBSTRING({1}, 24, 19), '%m/%d/%Y %H:%i:%s') AND STR_TO_DATE(SUBSTRING({1}, 50, 19), '%m/%d/%Y %H:%i:%s')", start.ToString("yyyy-MM-dd"), SchedulerAppointment.PropertyName_RecurrenceInfo);
var criteria = CreateCriteria<SchedulerAppointment>()
.Add(Restrictions.Eq(BeWoEntityBase.PropertyName_IsActive, ActivationTypeId.Active))
@@ -2219,5 +2217,131 @@ namespace BeWo.Data.Access
return c.List<Customer2Person>();
}
public IList<SchedulerAppointment> LoadFilteredAppointments(bool pHasRightToSeeAllEmployeeAppointments, long pEmployeeOid, DateTime pIntervalStart, DateTime pIntervalEnd, List<long> pSelectedEmployees, List<long> pSelectedCustomers, List<long> pSelectedResources, bool pEmployeesOnly, bool pCustomersOnly, bool pResourcesOnly, bool pPrivateAppointmentsOnly, bool pOnlyMyAppointments)
{
var recurrenceBetween = string.Format("'{0} 00:00:00' BETWEEN STR_TO_DATE(SUBSTRING({1}, 24, 19), '%m/%d/%Y %H:%i:%s') AND STR_TO_DATE(SUBSTRING({1}, 50, 19), '%m/%d/%Y %H:%i:%s')", pIntervalStart.ToString("yyyy-MM-dd"), SchedulerAppointment.PropertyName_RecurrenceInfo);
var criteria = CreateCriteria<SchedulerAppointment>()
.Add(Restrictions.Eq(BeWoEntityBase.PropertyName_IsActive, ActivationTypeId.Active))
.Add(Restrictions.Or(
Restrictions.And(Restrictions.Not(Restrictions.Like(SchedulerAppointment.PropertyName_RecurrenceInfo, "Range", MatchMode.Anywhere)),
Restrictions.Like(SchedulerAppointment.PropertyName_RecurrenceInfo, "OccurrenceCount=\"10\"", MatchMode.Anywhere)),
Restrictions.Or(
Restrictions.Or(
Restrictions.And(Restrictions.Lt(SchedulerAppointment.PropertyName_StartDate, pIntervalEnd), Restrictions.Ge(SchedulerAppointment.PropertyName_EndDate, pIntervalStart)),
Restrictions.And(Restrictions.IsNotNull(SchedulerAppointment.PropertyName_RecurrenceInfo), Expression.Sql(new SqlString(recurrenceBetween)))),
Restrictions.And(Restrictions.Eq(SchedulerAppointment.PropertyName_Type, 3), Expression.Sql(new SqlString(recurrenceBetween))))));
if(pPrivateAppointmentsOnly)
{
criteria.Add(Restrictions.Eq(SchedulerAppointment.PropertyName_IsPrivate, true));
}
else
{
if(pEmployeesOnly)
{
var hasEmployees = $"{BeWoEntityBase.PropertyName_Oid} IN (SELECT newschappoid FROM employee2newschapp)";
criteria.Add(Expression.Sql(hasEmployees));
}
if(pCustomersOnly)
{
var hasCustomers = $"{BeWoEntityBase.PropertyName_Oid} IN (SELECT newschappoid FROM customer2newschapp)";
criteria.Add(Expression.Sql(hasCustomers));
}
if(pResourcesOnly)
{
var hasResources = $"{BeWoEntityBase.PropertyName_Oid} IN (SELECT newschappoid FROM resources2newschapp)";
criteria.Add(Expression.Sql(hasResources));
}
if(pSelectedEmployees.Any())
{
var detachedCriteria1 = DetachedCriteria.For<Employee2SchedulerAppointment>()
.Add(Restrictions.In(Employee2SchedulerAppointment.PropertyName_Employee + ".Oid", pSelectedEmployees))
.SetProjection(Projections.Property(Employee2SchedulerAppointment.PropertyName_SchedulerAppointment));
criteria.Add(Subqueries.PropertyIn(BeWoEntityBase.PropertyName_Oid, detachedCriteria1));
}
if(pSelectedCustomers.Any())
{
var list = "";
for(var i = 0; i < pSelectedCustomers.Count; i++)
{
if(i != pSelectedCustomers.Count - 1)
{
list += "" + pSelectedCustomers[i] + ",";
}
else
{
list += "" + pSelectedCustomers[i];
}
}
var blah = $"{BeWoEntityBase.PropertyName_Oid} IN (SELECT newschappoid FROM customer2newschapp WHERE customeroid IN ({list}))";
criteria.Add(Expression.Sql(blah));
}
if(pSelectedResources.Any())
{
var list = "";
for(var i = 0; i < pSelectedResources.Count; i++)
{
if(i != pSelectedResources.Count - 1)
{
list += "" + pSelectedResources[i] + ",";
}
else
{
list += "" + pSelectedResources[i];
}
}
var blah = $"{BeWoEntityBase.PropertyName_Oid} IN (SELECT newschappoid FROM resource2newschapp WHERE resourceoid IN ({list}))";
criteria.Add(Expression.Sql(blah));
}
}
return criteria.List<SchedulerAppointment>();
}
public IEnumerable<SchedulerAppointment> LoadFilteredAppointmentsForEmployee(bool pHasRightToSeeAllEmployeeAppointments, long pEmployeeOid, DateTime pIntervalStart, DateTime pIntervalEnd, List<long> pSelectedEmployees, List<long> pSelectedCustomer, List<long> pSelectedResources, bool pEmployeesOnly, bool pCustomersOnly, bool pResourcesOnly, bool pPrivateAppointmentsOnly, bool pOnlyMyAppointments)
{
//var detachedCriteria = DetachedCriteria.For<Employee2SchedulerAppointment>()
// .Add(Restrictions.And(Restrictions.In(Employee2SchedulerAppointment.PropertyName_Employee + ".Oid", pEmployeeOids),
// Restrictions.Not(Restrictions.Eq(Employee2SchedulerAppointment.PropertyName_ParticipationAnswer, ParticipationAnswer.Absage))));
//detachedCriteria.SetProjection(Projections.Property(Employee2SchedulerAppointment.PropertyName_SchedulerAppointment));
//var recurrenceBetween = String.Format("'{0} 00:00:00' BETWEEN STR_TO_DATE(SUBSTRING({1}, 24, 19), '%m/%d/%Y %H:%i:%s') AND STR_TO_DATE(SUBSTRING({1}, 50, 19), '%m/%d/%Y %H:%i:%s')",
// start.ToString("yyyy-MM-dd"),
// SchedulerAppointment.PropertyName_RecurrenceInfo);
//var hasResources = String.Format("{0} IN (SELECT newschappoid FROM resource2newschapp)", BeWoEntityBase.PropertyName_Oid);
//var criteria = CreateCriteria<SchedulerAppointment>()
// .Add(Restrictions.Eq(BeWoEntityBase.PropertyName_IsActive, ActivationTypeId.Active))
// .Add(Restrictions.Or(
// Restrictions.And(
// Restrictions.Not(Restrictions.Like(SchedulerAppointment.PropertyName_RecurrenceInfo, "Range", MatchMode.Anywhere)),
// Restrictions.Like(SchedulerAppointment.PropertyName_RecurrenceInfo, "OccurrenceCount=\"10\"", MatchMode.Anywhere)),
// Restrictions.Or(
// Restrictions.Or(
// Restrictions.And(Restrictions.Lt(SchedulerAppointment.PropertyName_StartDate, end), Restrictions.Ge(SchedulerAppointment.PropertyName_EndDate, start)),
// Restrictions.And(Restrictions.IsNotNull(SchedulerAppointment.PropertyName_RecurrenceInfo), Expression.Sql(new SqlString(recurrenceBetween)))),
// Restrictions.And(Restrictions.Eq(SchedulerAppointment.PropertyName_Type, 3), Expression.Sql(new SqlString(recurrenceBetween))))))
// .Add(Restrictions.Or(
// Expression.Sql(new SqlString(hasResources)),
// Restrictions.Or(
// Restrictions.In(SchedulerAppointment.PropertyName_Originator + ".Oid", pEmployeeOids),
// Subqueries.PropertyIn(BeWoEntityBase.PropertyName_Oid, detachedCriteria))));
//return criteria.List<SchedulerAppointment>();
return null;
}
}
}

View File

@@ -15,14 +15,14 @@
NHibernate.Driver.MySqlDataDriver
</property>
<property name="connection.connection_string">
<!--<property name="connection.connection_string">
Server=localhost;Password=root;User ID=root;Initial Catalog=bewodemo
</property>-->
<property name="connection.connection_string">
Server=localhost;Password=root;User ID=root;Initial Catalog=betreuwo
</property>
<!--<property name="connection.connection_string">
Server=localhost;Password=root;User ID=root;Initial Catalog=1234567890
</property>-->
<property name="dialect">
NHibernate.Dialect.MySQLDialect
</property>

View File

@@ -172,5 +172,9 @@ namespace BeWo.Service.ServiceContracts
[FaultContract(typeof(BeWoFault))]
[OperationContract]
List<AbsenceTimeDC> GetAllActiveAbsenceTimesInInterval(DateTime pStart, DateTime pEnd, long pEmployeeOid, bool pHasRightToSeeAllEmployeeAppointments);
[FaultContract(typeof(BeWoFault))]
[OperationContract]
List<SchedulerAppointmentDC> LoadFilteredAppointments(bool pHasRightToSeeAllEmployeeAppointments, long pEmployeeOid, DateTime pIntervalStart, DateTime pIntervalEnd, List<long> pSelectedEmployees, List<long> pSelectedCustomer, List<long> pSelectedResources, bool pEmployeesOnly, bool pCustomersOnly, bool pResourcesOnly, bool pPrivateAppointmentsOnly, bool pOnlyMyAppointments);
}
}

View File

@@ -966,5 +966,21 @@ namespace BeWo.Service.ServiceImplementations
throw Utils.CreateBeWoFaultException(e);
}
}
public List<SchedulerAppointmentDC> LoadFilteredAppointments(bool pHasRightToSeeAllEmployeeAppointments, long pEmployeeOid, DateTime pIntervalStart, DateTime pIntervalEnd, List<long> pSelectedEmployees, List<long> pSelectedCustomer, List<long> pSelectedResources, bool pEmployeesOnly, bool pCustomersOnly, bool pResourcesOnly, bool pPrivateAppointmentsOnly, bool pOnlyMyAppointments)
{
try
{
var appointments = pHasRightToSeeAllEmployeeAppointments
? DAOFactory.SearchDAO.LoadFilteredAppointments(pHasRightToSeeAllEmployeeAppointments, pEmployeeOid, pIntervalStart, pIntervalEnd, pSelectedEmployees, pSelectedCustomer, pSelectedResources, pEmployeesOnly, pCustomersOnly, pResourcesOnly, pPrivateAppointmentsOnly, pOnlyMyAppointments)
: DAOFactory.SearchDAO.LoadFilteredAppointmentsForEmployee(pHasRightToSeeAllEmployeeAppointments, pEmployeeOid, pIntervalStart, pIntervalEnd, pSelectedEmployees, pSelectedCustomer, pSelectedResources, pEmployeesOnly, pCustomersOnly, pResourcesOnly, pPrivateAppointmentsOnly, pOnlyMyAppointments);
return MapperFactory.SchedulerAppointmentDCSchedulerAppointment.MapToNewDCs(appointments).OrderBy(a => a.StartDate).ToList();
}
catch(Exception e)
{
throw Utils.CreateBeWoFaultException(e);
}
}
}
}