Merge branch 'master' of ssh://float.beyondsoft.de/git/beyondSoft/BeWo

# Conflicts:
#	BeWo/View/HomeDragPanelView.xaml.cs
This commit is contained in:
staccatomamba
2016-08-05 16:25:42 +02:00
23 changed files with 714 additions and 543 deletions

View File

@@ -79,9 +79,21 @@ namespace BeWo
return;
}
}
BeWoApp.MainControl.HomeView.CloseServerConnection();
try
{
if (BeWoApp.MainControl.HomeView.clientSocket.Connected)
{
BeWoApp.MainControl.HomeView.CloseServerConnection();
}
}
catch (Exception edf)
{
}
BeWoApp.CurrentBeWo.DocumentWatcher.LoescheTempDateien();
Application.Current.Shutdown();

View File

@@ -1177,6 +1177,14 @@ namespace BeWo.ServiceProxy
[System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/ICustomerService/FindAllChatMessagesBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")]
System.Collections.Generic.List<BS.Shared.DataContracts.ChatMessageDC> FindAllChatMessages(long senderOid, long empfaengerOid);
[System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/ICustomerService/FindAllChatMessagesFromTeam", ReplyAction="http://tempuri.org/ICustomerService/FindAllChatMessagesFromTeamResponse")]
[System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/ICustomerService/FindAllChatMessagesFromTeamBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")]
System.Collections.Generic.List<BS.Shared.DataContracts.ChatMessageDC> FindAllChatMessagesFromTeam(long senderOid, long teamEmpfangOid);
[System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/ICustomerService/UpdateIstGelesen", ReplyAction="http://tempuri.org/ICustomerService/UpdateIstGelesenResponse")]
[System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/ICustomerService/UpdateIstGelesenBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")]
void UpdateIstGelesen(long senderOid, long empfaengerOid, bool istGelesen);
[System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/ICustomerService/GetCustomerImage", ReplyAction="http://tempuri.org/ICustomerService/GetCustomerImageResponse")]
[System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/ICustomerService/GetCustomerImageBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")]
byte[] GetCustomerImage(long customerOid);
@@ -1889,6 +1897,16 @@ namespace BeWo.ServiceProxy
return base.Channel.FindAllChatMessages(senderOid, empfaengerOid);
}
public System.Collections.Generic.List<BS.Shared.DataContracts.ChatMessageDC> FindAllChatMessagesFromTeam(long senderOid, long teamEmpfangOid)
{
return base.Channel.FindAllChatMessagesFromTeam(senderOid, teamEmpfangOid);
}
public void UpdateIstGelesen(long senderOid, long empfaengerOid, bool istGelesen)
{
base.Channel.UpdateIstGelesen(senderOid, empfaengerOid, istGelesen);
}
public byte[] GetCustomerImage(long customerOid)
{
return base.Channel.GetCustomerImage(customerOid);
@@ -3775,29 +3793,34 @@ namespace BeWo.ServiceProxy
[System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IOperationsService/CreateNewChatMessagesDC", ReplyAction="http://tempuri.org/IOperationsService/CreateNewChatMessagesDCResponse")]
[System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IOperationsService/CreateNewChatMessagesDCBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")]
BS.Shared.DataContracts.ChatMessageDC CreateNewChatMessagesDC(long senderOid, long empfängerOid, string message, int istZugestellt);
BS.Shared.DataContracts.ChatMessageDC CreateNewChatMessagesDC(long senderOid, long empfängerOid, string message, int istZugestellt, long teamid);
[System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IOperationsService/CreateNewIsChatActiveCustomerAPPCodeDC", ReplyAction="http://tempuri.org/IOperationsService/CreateNewIsChatActiveCustomerAPPCodeDCRespo" +
"nse")]
[System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IOperationsService/CreateNewIsChatActiveCustomerAPPCodeDCBeWoF" +
"aultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")]
BS.Shared.DataContracts.CustomerAPPCodeDC CreateNewIsChatActiveCustomerAPPCodeDC(long customerOid, int activeType);
[System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IOperationsService/UpdateIsChatActiveCustomerAPPCodeDC", ReplyAction="http://tempuri.org/IOperationsService/UpdateIsChatActiveCustomerAPPCodeDCResponse" +
"")]
[System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IOperationsService/UpdateIsChatActiveCustomerAPPCodeDCBeWoFaul" +
"tFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")]
void UpdateIsChatActiveCustomerAPPCodeDC(long customerOid, int activeType);
[System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IOperationsService/GetIsChatActiveCustomerAPPCodeDC", ReplyAction="http://tempuri.org/IOperationsService/GetIsChatActiveCustomerAPPCodeDCResponse")]
[System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IOperationsService/GetIsChatActiveCustomerAPPCodeDCBeWoFaultFa" +
"ult", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")]
System.Collections.Generic.List<BS.Shared.DataContracts.CustomerAPPCodeDC> GetIsChatActiveCustomerAPPCodeDC(long customerOid, int activeType);
[System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IOperationsService/CreateNewEmployeeAPPCodeDC", ReplyAction="http://tempuri.org/IOperationsService/CreateNewEmployeeAPPCodeDCResponse")]
[System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IOperationsService/CreateNewEmployeeAPPCodeDCBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")]
BS.Shared.DataContracts.EmployeeAPPCodeDC CreateNewEmployeeAPPCodeDC(long employeeOid);
[System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IOperationsService/CreateNewIsChatActiveEmployeeAPPCodeDC", ReplyAction="http://tempuri.org/IOperationsService/CreateNewIsChatActiveEmployeeAPPCodeDCRespo" +
"nse")]
[System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IOperationsService/CreateNewIsChatActiveEmployeeAPPCodeDCBeWoF" +
"aultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")]
BS.Shared.DataContracts.EmployeeAPPCodeDC CreateNewIsChatActiveEmployeeAPPCodeDC(long employeeOid, int activeType);
[System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IOperationsService/UpdateIsChatActiveEmployeeAPPCodeDC", ReplyAction="http://tempuri.org/IOperationsService/UpdateIsChatActiveEmployeeAPPCodeDCResponse" +
"")]
[System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IOperationsService/UpdateIsChatActiveEmployeeAPPCodeDCBeWoFaul" +
"tFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")]
void UpdateIsChatActiveEmployeeAPPCodeDC(long employeeOid, int activeType);
[System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IOperationsService/CreateNewNotfallNacrichtEmployeeAPPCodeDC", ReplyAction="http://tempuri.org/IOperationsService/CreateNewNotfallNacrichtEmployeeAPPCodeDCRe" +
"sponse")]
[System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IOperationsService/CreateNewNotfallNacrichtEmployeeAPPCodeDCBe" +
"WoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")]
BS.Shared.DataContracts.EmployeeAPPCodeDC CreateNewNotfallNacrichtEmployeeAPPCodeDC(long employeeOid, string notfallstate);
[System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IOperationsService/UpdateNotfallNacrichtEmployeeAPPCodeDC", ReplyAction="http://tempuri.org/IOperationsService/UpdateNotfallNacrichtEmployeeAPPCodeDCRespo" +
"nse")]
[System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IOperationsService/UpdateNotfallNacrichtEmployeeAPPCodeDCBeWoF" +
"aultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")]
void UpdateNotfallNacrichtEmployeeAPPCodeDC(long employeeOid, string notfallstate);
[System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IOperationsService/LoadOrganisationPersonRelationsByOid", ReplyAction="http://tempuri.org/IOperationsService/LoadOrganisationPersonRelationsByOidRespons" +
"e")]
@@ -4432,14 +4455,19 @@ namespace BeWo.ServiceProxy
return base.Channel.CreateNewCustomerAPPCodeDC(customerOid);
}
public BS.Shared.DataContracts.ChatMessageDC CreateNewChatMessagesDC(long senderOid, long empfängerOid, string message, int istZugestellt)
public BS.Shared.DataContracts.ChatMessageDC CreateNewChatMessagesDC(long senderOid, long empfängerOid, string message, int istZugestellt, long teamid)
{
return base.Channel.CreateNewChatMessagesDC(senderOid, empfängerOid, message, istZugestellt);
return base.Channel.CreateNewChatMessagesDC(senderOid, empfängerOid, message, istZugestellt, teamid);
}
public BS.Shared.DataContracts.CustomerAPPCodeDC CreateNewIsChatActiveCustomerAPPCodeDC(long customerOid, int activeType)
public void UpdateIsChatActiveCustomerAPPCodeDC(long customerOid, int activeType)
{
return base.Channel.CreateNewIsChatActiveCustomerAPPCodeDC(customerOid, activeType);
base.Channel.UpdateIsChatActiveCustomerAPPCodeDC(customerOid, activeType);
}
public System.Collections.Generic.List<BS.Shared.DataContracts.CustomerAPPCodeDC> GetIsChatActiveCustomerAPPCodeDC(long customerOid, int activeType)
{
return base.Channel.GetIsChatActiveCustomerAPPCodeDC(customerOid, activeType);
}
public BS.Shared.DataContracts.EmployeeAPPCodeDC CreateNewEmployeeAPPCodeDC(long employeeOid)
@@ -4447,14 +4475,14 @@ namespace BeWo.ServiceProxy
return base.Channel.CreateNewEmployeeAPPCodeDC(employeeOid);
}
public BS.Shared.DataContracts.EmployeeAPPCodeDC CreateNewIsChatActiveEmployeeAPPCodeDC(long employeeOid, int activeType)
public void UpdateIsChatActiveEmployeeAPPCodeDC(long employeeOid, int activeType)
{
return base.Channel.CreateNewIsChatActiveEmployeeAPPCodeDC(employeeOid, activeType);
base.Channel.UpdateIsChatActiveEmployeeAPPCodeDC(employeeOid, activeType);
}
public BS.Shared.DataContracts.EmployeeAPPCodeDC CreateNewNotfallNacrichtEmployeeAPPCodeDC(long employeeOid, string notfallstate)
public void UpdateNotfallNacrichtEmployeeAPPCodeDC(long employeeOid, string notfallstate)
{
return base.Channel.CreateNewNotfallNacrichtEmployeeAPPCodeDC(employeeOid, notfallstate);
base.Channel.UpdateNotfallNacrichtEmployeeAPPCodeDC(employeeOid, notfallstate);
}
public System.Collections.Generic.List<BS.Shared.DataContracts.OrganisationPersonRelationDC> LoadOrganisationPersonRelationsByOid(System.Collections.Generic.List<long> pOids)

View File

@@ -43,10 +43,10 @@
<Label x:Name="lblIsChatAktive" Grid.Column="0" Grid.Row="1" Content="Chat Aktivieren" />
<CheckBox x:Name="ChatAktive" Grid.Column="1" Grid.Row="1" Margin="3" Height="23" Checked="CheckBox_Checked" Unchecked="CheckBox_Unchecked"
IsChecked="{Binding Path=IsChatAktiv, UpdateSourceTrigger=PropertyChanged}"/>
<CheckBox x:Name="ChatAktive" Grid.Column="1" Grid.Row="1" Margin="3" Height="23" Checked="CheckBox_Checked" Unchecked="CheckBox_Unchecked"/>
<!-- IsChecked="{Binding Path=IsChatAktiv, UpdateSourceTrigger=PropertyChanged}" -->
</Grid>

View File

@@ -26,8 +26,6 @@ namespace BeWo.View
public partial class ChatServiceCustomer
{
private CustomerVM _ViewModel;
long? customerOid;
@@ -68,8 +66,6 @@ namespace BeWo.View
}
private void GenerateCodeClick(object sender, RoutedEventArgs e)
{
@@ -79,31 +75,23 @@ namespace BeWo.View
}
//################### Bugs Vorhanden / statt new Create ein Update genügt ###########################################
private void CheckBox_Checked(object sender, RoutedEventArgs e)
{
ServiceFacade.DoOperationsServiceSync(s => s.CreateNewIsChatActiveCustomerAPPCodeDC(customerOid.Value, 1));
// result.IsChatAktive = 1;
//ServiceFacade.DoOperationsServiceSync(s => s.CreateNewEmployeeAPPCodeDC(2));
ServiceFacade.DoOperationsServiceSync(s => s.UpdateIsChatActiveCustomerAPPCodeDC(customerOid.Value, 1));
}
private void CheckBox_Unchecked(object sender, RoutedEventArgs e)
{
//hehe nö nicht funkt
ServiceFacade.DoOperationsServiceSync(s => s.CreateNewIsChatActiveCustomerAPPCodeDC(customerOid.Value, 0));
// var result = ServiceFacade.DoOperationsServiceSync(s => s.CreateNewCustomerAPPCodeDC(ViewModel.DataContract.CustomerOid.Value));
// result.IsChatAktive = 0;
{
ServiceFacade.DoOperationsServiceSync(s => s.UpdateIsChatActiveCustomerAPPCodeDC(customerOid.Value, 0));
}
private void LaodInfostoView()
{
var getCustomerAppCode = ServiceFacade.DoCustomerServiceSync(s => s.GetAllCustomerAppCodes(customerOid.Value));
int x = getCustomerAppCode[getCustomerAppCode.Count - 1].IsChatAktive;
var getCustomerAppCode = ServiceFacade.DoOperationsServiceSync(s => s.GetIsChatActiveCustomerAPPCodeDC(customerOid.Value, 0));
int x = getCustomerAppCode[0].IsChatAktive;
if (x == 0)
@@ -112,12 +100,8 @@ namespace BeWo.View
ChatAktive.SetCurrentValue(CheckBox.IsCheckedProperty, true);
GeneratetTexfield.Text = getCustomerAppCode[getCustomerAppCode.Count - 1].CustomerCode;
GeneratetTexfield.Text = getCustomerAppCode[getCustomerAppCode.Count-1].CustomerCode;
}
}
}

View File

@@ -76,32 +76,26 @@ namespace BeWo.View
}
//################### Bugs Vorhanden / statt new Create, ein Update genügt ###########################################
private void CheckBox_Checked(object sender, RoutedEventArgs e)
{
//hehe nö nicht funkt weil statt update passiert ein insert
ServiceFacade.DoOperationsServiceSync(s => s.CreateNewIsChatActiveEmployeeAPPCodeDC(employeeOid.Value, 1));
// result.IsChatAktive = 1;
ServiceFacade.DoOperationsServiceSync(s => s.UpdateIsChatActiveEmployeeAPPCodeDC(employeeOid.Value, 1));
}
private void CheckBox_Unchecked(object sender, RoutedEventArgs e)
{
//hehe nö nicht funkt weil statt update passiert ein insert
ServiceFacade.DoOperationsServiceSync(s => s.CreateNewIsChatActiveEmployeeAPPCodeDC(employeeOid.Value, 0));
// var result = ServiceFacade.DoOperationsServiceSync(s => s.CreateNewCustomerAPPCodeDC(ViewModel.DataContract.CustomerOid.Value));
// result.IsChatAktive = 0;
ServiceFacade.DoOperationsServiceSync(s => s.UpdateIsChatActiveEmployeeAPPCodeDC(employeeOid.Value, 0));
}
private void Creat_NotfallMessage(object sender, RoutedEventArgs e)
{
if(!NotfallTexfield.Text.Equals(""))
ServiceFacade.DoOperationsServiceSync(s => s.CreateNewNotfallNacrichtEmployeeAPPCodeDC(employeeOid.Value, NotfallTexfield.Text));
ServiceFacade.DoOperationsServiceSync(s => s.UpdateNotfallNacrichtEmployeeAPPCodeDC(employeeOid.Value, NotfallTexfield.Text));
}
private void LaodInfostoView()
{
//
var getEmployeeAppCode = ServiceFacade.DoEmployeeServiceSync(s => s.GetAllEmployeeAppCodes(employeeOid.Value));
int x;
@@ -110,7 +104,7 @@ namespace BeWo.View
GeneratetTexfield.Text = getEmployeeAppCode[getEmployeeAppCode.Count - 1].EmployeeCode;
NotfallTexfield.Text = getEmployeeAppCode[getEmployeeAppCode.Count - 1].NotfallStatement;
NotfallTexfield.Text = getEmployeeAppCode[0].NotfallStatement;
}
else

View File

@@ -10,7 +10,14 @@
<GroupBox Header="Chat" x:Name="rootGroupBox" Style="{DynamicResource MainContentGroupBoxWithoutMaximizeBtnStyle}" MouseLeftButtonDown="RootGroupBox_OnMouseLeftButtonDown">
<Grid Background="{StaticResource ObjectEditBackgroundBrush}">
<TextBox x:Name="ServerStats" Height="23" Margin="539,13,7,0" TextWrapping="Wrap" VerticalAlignment="Top" ToolTip="Server Info" IsEnabled="False"/>
<TextBox x:Name="ServerStats" Height="23" Margin="539,13,7,0" TextWrapping="Wrap" VerticalAlignment="Top" ToolTip="Server Info" IsEnabled="False" VerticalContentAlignment="Center">
<TextBox.Resources>
<Style TargetType="{x:Type Border}">
<Setter Property="CornerRadius" Value="3"/>
<Setter Property="Padding" Value="10,0,0,0" />
</Style>
</TextBox.Resources>
</TextBox>
<TextBox x:Name="Chatbox" HorizontalAlignment="Left" Margin="174,719,0,11" TextWrapping="Wrap"
VerticalContentAlignment="Center" Width="462" Height="25" ToolTip="Schreiben Sie hier eine Nachricht hinein" KeyDown="OnKeyDownHandler" GotFocus="OnFocus" Text="Nachricht schreiben" Foreground="DarkGray" >
@@ -22,12 +29,12 @@
</TextBox.Resources>
</TextBox>
<ListBox x:Name="Chat" HorizontalAlignment="Left" Height="630" Margin="170,64,0,0" VerticalAlignment="Top" Width="615" VirtualizingStackPanel.IsVirtualizing="True" VirtualizingStackPanel.VirtualizationMode="Recycling" >
<ListBox x:Name="Chat" HorizontalAlignment="Left" Height="630" Margin="170,64,0,0" VerticalAlignment="Top" Width="615" VirtualizingStackPanel.IsVirtualizing="True" VirtualizingStackPanel.VirtualizationMode="Recycling" SelectionMode="Multiple" >
<ListBox.ItemContainerStyle>
<Style TargetType="ListBoxItem">
<!--<Setter Property="IsEnabled" Value="False" />
<Setter Property="Foreground" Value="Black" />-->
<Setter Property="Focusable" Value="False"/>
<Setter Property="Foreground" Value="Black" />
<Setter Property="Focusable" Value="False"/>-->
</Style>
</ListBox.ItemContainerStyle>
<ListBox.Resources>
@@ -60,14 +67,14 @@
<!--###################################### Liste aller User mit Chat Berechtigung ######################################################-->
<ListView x:Name="Clientlist" HorizontalAlignment="Left" Height="680" Margin="10,64,0,0" VerticalAlignment="Top" Width="157" SelectionChanged="ListBoxSelectedIndexChanged" Style="{DynamicResource ResourceKey=styleListBox}" ItemTemplate="{DynamicResource DataTemplate1}">
<ListView x:Name="Clientlist" HorizontalAlignment="Left" Height="680" Margin="10,64,0,0" VerticalAlignment="Top" Width="155" SelectionChanged="ListBoxSelectedIndexChanged" Style="{DynamicResource ResourceKey=styleListBox}" ItemTemplate="{DynamicResource DataTemplate1}" >
<ListView.Resources>
<DataTemplate x:Key="DataTemplate1">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="50"/>
<ColumnDefinition Width="90"/>
<ColumnDefinition Width="20"/>
<ColumnDefinition Width="100"/>
<ColumnDefinition Width="10"/>
</Grid.ColumnDefinitions>
<Ellipse Width='30' Height='30'>
@@ -120,7 +127,7 @@
</ListView.GroupStyle>
</ListView>
<!--###################################### Umabauarbeiten Laufen #######################################################-->
<!--###################################### Ende List view #######################################################-->

View File

@@ -36,7 +36,6 @@ namespace BeWo.View
public int abr = 0;
protected TcpClient tcpClient;
// protected ListBox saveOnlineList = new ListBox();
protected CollectionView view;
@@ -49,12 +48,10 @@ namespace BeWo.View
rootGroupBox.Header = nameinf;
this.tcpClient = tcpClient;
// SetChatSetting();
closeWindow();
LoadallChatKontakts();
ErstelleContextMenue();
}
/* private void SetChatSetting()
@@ -64,9 +61,6 @@ namespace BeWo.View
List<string> data = new List<string>();
data.Add("Gerade Online");
data.Add("Gerade Offline");
data.Add("Nur Team");
data.Add("Nur Mitarbeiter");
data.Add("Nur Klienten");
chatSettingControll.ItemsSource = data;
chatSettingControll.SelectedIndex = 0;
@@ -75,7 +69,6 @@ namespace BeWo.View
{
MessageBox.Show("Das Aufbauen der Chat-Settings ist fehlgeschlagen.", "Fehler: 2200 ", MessageBoxButton.OK);
}
}*/
private void RootGroupBox_OnMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
@@ -98,7 +91,7 @@ namespace BeWo.View
}));
}
public void SetTextFromMiniV(String[] text, String nameclient, long personoid)
/* public void SetTextFromMiniV(String[] text, String nameclient, long personoid)
{
try
{
@@ -113,13 +106,12 @@ namespace BeWo.View
{
foreach (String i in text)
{
Chat.Items.Add(new KontakMessageBuilder(nameclient, i, DateTime.Now.ToString()));
Chat.Items.Add(new KontakMessageBuilder(nameclient, i, DateTime.Now.ToString(),personoid));
// SaveChatMessageinDB(personoid,BeWoApp.LoggedOnEmployee.PersonOid.Value,i);
}
Chat.Items.MoveCurrentToLast();
Chat.ScrollIntoView(Chat.Items.CurrentItem);
}
}
else
@@ -136,6 +128,7 @@ namespace BeWo.View
if (abc.EmpfaengerOid == personoid)
{
abc.Receivems = anzReceive++.ToString();
view.Refresh();
}
}
//SaveChatMessageinDB( personoid,BeWoApp.LoggedOnEmployee.PersonOid.Value, i);
@@ -157,6 +150,7 @@ namespace BeWo.View
if (abc.EmpfaengerOid == personoid)
{
abc.Receivems = anzRec++.ToString();
view.Refresh();
}
}
//SaveChatMessageinDB(personoid, BeWoApp.LoggedOnEmployee.PersonOid.Value, i);
@@ -168,39 +162,33 @@ namespace BeWo.View
{
MessageBox.Show("Die Übername einer Message der Mini-View ist fehlgeschlagen.", "Fehler: 2210 ", MessageBoxButton.OK);
}
}
}*/
public void SetText(String text, String nameclient, long personoid )
public void SetText(String text, String nameclient, long personoid )
{
try
{
if (!nameclient.Equals("NULL") && personoid != 0)
{
//Hier mus abfrage hin für Chat , wenn personoid not open dann soll das nicht nur zur db gesendet werden sonder
//es soll im ClientList auf der rechten seite eine zahl angezeigt weden, diese zahl ist anzahl ungelesener Nachrichten
if (AktChatUser.Items.Count != 0)
{
KontaktlistBuilder curItem = (KontaktlistBuilder) AktChatUser.Items[0];
if (curItem.EmpfaengerOid == personoid)
{
foreach (var collection in ita)
{
if (collection.EmpfaengerOid == personoid)
collection.Receivems = "";
view.Refresh();
}
curItem.Receivems = "";
if (!nameclient.Equals("NULL") && personoid != 0)
{
Chat.Items.Add(new KontakMessageBuilder(nameclient, text, DateTime.Now.ToString()));
Chat.Items.Add(new KontakMessageBuilder(nameclient, text, DateTime.Now.ToString(),personoid));
//SaveChatMessageinDB(personoid,BeWoApp.LoggedOnUser.Employee.PersonOid, text);
Chat.Items.MoveCurrentToLast();
@@ -212,8 +200,6 @@ namespace BeWo.View
{
if (!nameclient.Equals("NULL") && personoid != 0)
{
//Abfrage foreach und da id zutrifft an der leiste eine nachricht anfügen
foreach (var abc in ita)
{
@@ -228,7 +214,7 @@ namespace BeWo.View
abc.Receivems = 1.ToString();
}
}
view.Refresh();
//SaveChatMessageinDB(personoid, BeWoApp.LoggedOnUser.Employee.PersonOid, text);
}
}
@@ -251,15 +237,10 @@ namespace BeWo.View
var a = person[0].Type;
// String listSelection = chatSettingControll.SelectionBoxItem as string; listSelection.Equals("Gerade Online") &&
if ( a == PersonType.Employee)
{
var mitarbeiter = ServiceFacade.DoEmployeeServiceSync(s => s.GetEmployeeWithPersonOid(personoid));
// Clientlist.Items.Add(new KontaktlistBuilder(clientname, "Online", BuildImg(ServiceFacade.DoEmployeeServiceSync(s => s.GetEmployeeImage(mitarbeiter.EmployeeOid.Value))), personoid,ChatType.Mitarbeiter));
KontaktlistBuilder konbuild = new KontaktlistBuilder(clientname, "Online", BuildImg(ServiceFacade.DoEmployeeServiceSync(s => s.GetEmployeeImage(mitarbeiter.EmployeeOid.Value))), personoid,ChatType.Mitarbeiter);
foreach (var variable in ita)
@@ -269,24 +250,15 @@ namespace BeWo.View
}
//ita.Add(new KontaktlistBuilder(clientname, "Online", BuildImg(ServiceFacade.DoEmployeeServiceSync(s => s.GetEmployeeImage(mitarbeiter.EmployeeOid.Value))), personoid,ChatType.Mitarbeiter));
view.Refresh();
//saveOnlineList.Items.Add(new KontaktlistBuilder(clientname, "Online", BuildImg(null), personoid, ChatType.Mitarbeiter));
}
else if ( a == PersonType.Customer)
{
var klienten = ServiceFacade.DoCustomerServiceSync(s => s.GetCustomerWithPersonOid(personoid));
// Clientlist.Items.Add(new KontaktlistBuilder(clientname, "Online", BuildImg(ServiceFacade.DoCustomerServiceSync(s => s.GetCustomerImage(klienten.CustomerOid.Value))), personoid, ChatType.Klienten));
KontaktlistBuilder konbuild = new KontaktlistBuilder(clientname, "Online", BuildImg(ServiceFacade.DoCustomerServiceSync(s => s.GetCustomerImage(klienten.CustomerOid.Value))), personoid, ChatType.Klienten);
foreach (var variable in ita)
{
if (konbuild.Name.Equals(variable.Name))
@@ -295,12 +267,7 @@ namespace BeWo.View
}
view.Refresh();
// saveOnlineList.Items.Add(new KontaktlistBuilder(clientname, "Online", BuildImg(null), personoid, ChatType.Klienten)); // buildimg mit
}
// saveOnlineList.Items.Add(new KontaktlistBuilder(clientname, "Online", BuildImg(null), personoid));
}
catch (Exception)
{
@@ -312,8 +279,6 @@ namespace BeWo.View
{
try
{
//ist gleich setze den User Offline
foreach (var abc in ita)
{
@@ -340,7 +305,8 @@ namespace BeWo.View
{
if (abc.EmpfaengerOid == personid)
{
return true;
if(abc.Lastms.Equals("Online"))
return true;
}
}
return false;
@@ -366,7 +332,7 @@ namespace BeWo.View
{
KontaktlistBuilder curItem = (KontaktlistBuilder) AktChatUser.Items[0];
SendMessage(curItem.EmpfaengerOid);
SendMessage(curItem.EmpfaengerOid,curItem.TypeChat);
// SaveChatMessageinDB(BeWoApp.LoggedOnEmployee.PersonOid.Value,curItem.EmpfaengerOid, Chatbox.Text);
@@ -402,8 +368,8 @@ namespace BeWo.View
Chatbox.Foreground = new SolidColorBrush(Colors.DarkGray);
}
}
}
}
}
catch (Exception sf)
{
MessageBox.Show("Beim Senden einer Nachricht ist ein Fehler aufgetreten.", "Fehler: 2250 ", MessageBoxButton.OK);
@@ -421,7 +387,7 @@ namespace BeWo.View
{
KontaktlistBuilder curItem = (KontaktlistBuilder) AktChatUser.Items[0];
SendMessage(curItem.EmpfaengerOid);
SendMessage(curItem.EmpfaengerOid,curItem.TypeChat);
// SaveChatMessageinDB(BeWoApp.LoggedOnEmployee.PersonOid.Value, curItem.EmpfaengerOid, Chatbox.Text);
@@ -452,46 +418,52 @@ namespace BeWo.View
private void LoadallChatKontakts()
{
var offteams = ServiceFacade.DoEmployeeServiceSync(s => s.GetAllTeamsCompact());
var offmitarbeiter =
ServiceFacade.DoEmployeeServiceSync(s => s.GetAllChatActiveEmployeesCompact());
var offklienten = ServiceFacade.DoCustomerServiceSync(s => s.GetAllChatActiveCustomersCompact());
string Goff = "Offline";
foreach (var team in offteams)
try
{
Clientlist.Items.Add(new KontaktlistBuilder(team.Name, Goff, BuildImg(null), team.TeamOid, ChatType.Team));
var offteams = ServiceFacade.DoEmployeeServiceSync(s => s.GetAllTeamsCompact());
var offmitarbeiter =
ServiceFacade.DoEmployeeServiceSync(s => s.GetAllChatActiveEmployeesCompact());
var offklienten = ServiceFacade.DoCustomerServiceSync(s => s.GetAllChatActiveCustomersCompact());
string Goff = "Offline";
foreach (var team in offteams)
{
Clientlist.Items.Add(new KontaktlistBuilder(team.Name, Goff, BuildImg(null), team.TeamOid, ChatType.Team));
}
foreach (var list in offmitarbeiter)
{
Clientlist.Items.Add(new KontaktlistBuilder(list.FirstName + " " + list.LastName, Goff,
BuildImg(ServiceFacade.DoEmployeeServiceSync(s => s.GetEmployeeImage(list.EmployeeOid))),
list.PersonOid, ChatType.Mitarbeiter));
}
foreach (var list in offklienten)
{
Clientlist.Items.Add(new KontaktlistBuilder(list.FirstName + " " + list.LastName, Goff,
BuildImg(ServiceFacade.DoCustomerServiceSync(s => s.GetCustomerImage(list.CustomerOid))),
list.PersonOid, ChatType.Klienten));
}
foreach (var a in Clientlist.Items)
{
KontaktlistBuilder cl = (KontaktlistBuilder)a;
ita.Add(cl);
}
Clientlist.Items.Clear();
Clientlist.ItemsSource = ita;
view = (CollectionView)CollectionViewSource.GetDefaultView(Clientlist.ItemsSource);
PropertyGroupDescription groupDescription = new PropertyGroupDescription("TypeChat");
view.GroupDescriptions.Add(groupDescription);
}
foreach (var list in offmitarbeiter)
catch (Exception edf)
{
Clientlist.Items.Add(new KontaktlistBuilder(list.FirstName + " " + list.LastName, Goff,
BuildImg(ServiceFacade.DoEmployeeServiceSync(s => s.GetEmployeeImage(list.EmployeeOid))),
list.PersonOid, ChatType.Mitarbeiter));
}
foreach (var list in offklienten)
{
Clientlist.Items.Add(new KontaktlistBuilder(list.FirstName + " " + list.LastName, Goff,
BuildImg(ServiceFacade.DoCustomerServiceSync(s => s.GetCustomerImage(list.CustomerOid))),
list.PersonOid, ChatType.Klienten));
}
foreach (var a in Clientlist.Items)
{
KontaktlistBuilder cl = (KontaktlistBuilder)a;
ita.Add(cl);
}
Clientlist.Items.Clear();
Clientlist.ItemsSource = ita;
view = (CollectionView)CollectionViewSource.GetDefaultView(Clientlist.ItemsSource);
PropertyGroupDescription groupDescription = new PropertyGroupDescription("TypeChat");
view.GroupDescriptions.Add(groupDescription);
MessageBox.Show("Beim Setzen einer Neuen Chat Einstellung ist ein Fehler aufgetreten.", "Fehler: 2270 ", MessageBoxButton.OK);
}
}
@@ -499,7 +471,6 @@ namespace BeWo.View
public void SetAllUserOfflineIfNoInet()
{
//set all User offline
foreach (var list in ita)
{
list.Lastms = "Offline";
@@ -508,6 +479,52 @@ namespace BeWo.View
view.Refresh();
}
private void ErstelleContextMenue()
{
try
{
//Erstelle ContextMenue und Füge Items Hinzu
ContextMenu context = new ContextMenu();
MenuItem item1 = new MenuItem();
MenuItem item2 = new MenuItem();
context.Items.Add(item1);
context.Items.Add(item2);
item1.Header = "Lese Daten aus";
item1.Visibility = Visibility.Visible;
item1.Click += new RoutedEventHandler(OnChatRightClickMenue);
item2.Header = "Klick";
item2.Visibility = Visibility.Visible;
Chat.ContextMenu = context;
}
catch (Exception edf)
{
MessageBox.Show("Beim Setzen einer Neuen Chat Einstellung ist ein Fehler aufgetreten.", "Fehler: 2380 ", MessageBoxButton.OK);
}
}
private void OnChatRightClickMenue(object sender, RoutedEventArgs e)
{
KontakMessageBuilder Item;
foreach (Object selecteditem in Chat.SelectedItems)
{
Item = selecteditem as KontakMessageBuilder;
Console.WriteLine(Item.UserMessage +" Oid: "+Item.MessagePersonOid); // <---- Gibt die UserMessages in der Console aus.
}
}
/* private void ComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
try
@@ -526,183 +543,7 @@ namespace BeWo.View
{
Clientlist.Items.Add(xyz);
}
break;
case "Gerade Offline":
//Rufe alle listen auf und zeige diese an
var offteams = ServiceFacade.DoEmployeeServiceSync(s => s.GetAllTeamsCompact());
var offmitarbeiter =
ServiceFacade.DoEmployeeServiceSync(s => s.GetAllChatActiveEmployeesCompact());
var offklienten = ServiceFacade.DoCustomerServiceSync(s => s.GetAllChatActiveCustomersCompact());
Clientlist.ItemsSource = null; //.Clear(); //Clientlist.Items.Clear();
string Goff = "Offline";
foreach (var team in offteams)
{
Clientlist.Items.Add(new KontaktlistBuilder(team.Name, Goff, BuildImg(null), team.TeamOid, ChatType.Team));
}
foreach (var list in offmitarbeiter)
{
Clientlist.Items.Add(new KontaktlistBuilder(list.FirstName+" "+list.LastName, Goff,
BuildImg(ServiceFacade.DoEmployeeServiceSync(s => s.GetEmployeeImage(list.EmployeeOid))),
list.PersonOid, ChatType.Mitarbeiter));
}
foreach (var list in offklienten)
{
Clientlist.Items.Add(new KontaktlistBuilder(list.FirstName+" "+list.LastName, Goff,
BuildImg(ServiceFacade.DoCustomerServiceSync(s => s.GetCustomerImage(list.CustomerOid))),
list.PersonOid, ChatType.Klienten));
}
// Gerade Online mit Gerade Offline Vergleichen und wenn es vergleiche gibt diese dann aus Clientlist nehemen da der ja online ist || Warum nicht schon vorher schauen ob diese person online ist
foreach (var clist in Clientlist.Items)
{
KontaktlistBuilder cl = (KontaktlistBuilder) clist;
foreach (var savelist in saveOnlineList.Items)
{
KontaktlistBuilder sl = (KontaktlistBuilder) savelist;
if (cl.EmpfaengerOid == sl.EmpfaengerOid)
{
Clientlist.Items.Remove(cl);
}
}
}
//######################## Umbau Aktion #########################################################
List<KontaktlistBuilder> ita = new List<KontaktlistBuilder>();
foreach (var a in Clientlist.Items)
{
KontaktlistBuilder cl = (KontaktlistBuilder)a;
ita.Add(cl);
}
Clientlist.Items.Clear();
Clientlist.ItemsSource = ita ;
CollectionView view = (CollectionView)CollectionViewSource.GetDefaultView(Clientlist.ItemsSource);
PropertyGroupDescription groupDescription = new PropertyGroupDescription("TypeChat");
view.GroupDescriptions.Add(groupDescription);
// view.Refresh();
//################################################################################################
break;
case "Nur Team":
var teams = ServiceFacade.DoEmployeeServiceSync(s => s.GetAllTeamsCompact());
Clientlist.ItemsSource = null; //.Clear();
string Ton = "Online";
//zeigt alle teams die die berechtigung haben an
foreach (var team in teams)
{
Clientlist.Items.Add(new KontaktlistBuilder(team.Name, Ton, BuildImg(null), team.TeamOid, ChatType.Team));
}
//*****************************************************
List<KontaktlistBuilder> itaa = new List<KontaktlistBuilder>();
foreach (var a in Clientlist.Items)
{
KontaktlistBuilder cl = (KontaktlistBuilder)a;
itaa.Add(cl);
}
Clientlist.Items.Clear();
Clientlist.ItemsSource = itaa ;
CollectionView viewa = (CollectionView)CollectionViewSource.GetDefaultView(Clientlist.ItemsSource);
PropertyGroupDescription groupDescriptiona = new PropertyGroupDescription("TypeChat");
viewa.GroupDescriptions.Add(groupDescriptiona);
//*****************************************************************************
break;
case "Nur Mitarbeiter":
var mitarbeiter = ServiceFacade.DoEmployeeServiceSync(s => s.GetAllChatActiveEmployeesCompact());
Clientlist.Items.Clear();
string Mon = "Online";
foreach (var list in mitarbeiter)
{
//überprüfen wer von denen grad online ist und je nachdem aussortieren
foreach (var abc in saveOnlineList.Items)
{
KontaktlistBuilder curItem = (KontaktlistBuilder) abc;
if (curItem.EmpfaengerOid == list.PersonOid)
Clientlist.Items.Add(new KontaktlistBuilder(list.FirstName, Mon,
BuildImg(
ServiceFacade.DoEmployeeServiceSync(
s => s.GetEmployeeImage(list.EmployeeOid))), list.PersonOid,ChatType.Mitarbeiter));
}
}
break;
case "Nur Klienten":
var klienten = ServiceFacade.DoCustomerServiceSync(s => s.GetAllChatActiveCustomersCompact());
Clientlist.Items.Clear();
string Kon = "Online";
//Add items der Liste //funktionierendes original
foreach (var list in klienten)
{
foreach (var sl in saveOnlineList.Items)
{
KontaktlistBuilder curItem = (KontaktlistBuilder) sl;
if (curItem.EmpfaengerOid == list.PersonOid)
Clientlist.Items.Add(new KontaktlistBuilder(list.FirstName, Kon,
BuildImg(
ServiceFacade.DoCustomerServiceSync(
s => s.GetCustomerImage(list.CustomerOid))), list.PersonOid, ChatType.Klienten));
}
}
break;
break;
}
}
catch (Exception edf)
@@ -720,17 +561,15 @@ namespace BeWo.View
{
if (blub.EmpfaengerOid == personoid && blub.Name.Equals(name))
{
AktChatUser.Items.Clear();
Chat.Items.Clear();
AktChatUser.Items.Add(new KontaktlistBuilder(blub.Name, blub.Lastms, blub.Image, blub.EmpfaengerOid, blub.TypeChat));
LoadChatMessagefromDB(BeWoApp.LoggedOnEmployee.PersonOid.Value, blub.EmpfaengerOid);
}
LoadChatMessagefromDB(BeWoApp.LoggedOnEmployee.PersonOid.Value, blub.EmpfaengerOid, blub);
}
}
Chat.Items.MoveCurrentToLast();
Chat.ScrollIntoView(Chat.Items.CurrentItem);
}
catch (Exception edf)
{
@@ -739,11 +578,6 @@ namespace BeWo.View
}
private void ListBoxSelectedIndexChanged(object sender, System.EventArgs e)
{
KontaktlistBuilder curItem;
@@ -758,20 +592,19 @@ namespace BeWo.View
AktChatUser.Items.Clear();
if(!curItem.Receivems.Equals("")){
int isx = int.Parse(curItem.Receivems);
curItem.Receivems = "";
}
AktChatUser.Items.Add(new KontaktlistBuilder(curItem.Name, curItem.Lastms, curItem.Image, curItem.EmpfaengerOid,curItem.TypeChat));
}
else
{
AktChatUser.Items.Add(new KontaktlistBuilder(curItem.Name, curItem.Lastms, curItem.Image, curItem.EmpfaengerOid, curItem.TypeChat));
}
ChatType a = curItem.TypeChat;
AktChatUser.Items.Add(new KontaktlistBuilder(curItem.Name, curItem.Lastms, curItem.Image, curItem.EmpfaengerOid, curItem.TypeChat));
LoadChatMessagefromDB(BeWoApp.LoggedOnEmployee.PersonOid.Value, curItem.EmpfaengerOid);
LoadChatMessagefromDB(BeWoApp.LoggedOnEmployee.PersonOid.Value, curItem.EmpfaengerOid, curItem);
Chat.Items.MoveCurrentToLast();
Chat.ScrollIntoView(Chat.Items.CurrentItem);
view.Refresh();
}
}
catch (Exception s)
@@ -838,25 +671,31 @@ namespace BeWo.View
}
public void SendMessage(long empfängeroid)
public void SendMessage(long empfängeroid,ChatType type)
{
try
{
string msg = Chatbox.Text;
Chat.Items.Add(new KontakMessageBuilder(BeWoApp.LoggedOnUser.Employee.FirstName, msg, DateTime.Now.ToString()));
Chat.Items.Add(new KontakMessageBuilder(BeWoApp.LoggedOnUser.Employee.FirstName, msg, DateTime.Now.ToString(), BeWoApp.LoggedOnUser.Employee.PersonOid));
if (tcpClient.Connected)
{
NetworkStream serverStream = tcpClient.GetStream();
byte[] outStream =
System.Text.Encoding.UTF8.GetBytes("" + BeWoApp.LoggedOnUser.Employee.PersonOid + ";" + empfängeroid + ";" +
BeWoApp.LoggedOnUser.LoginName.Length + ";" +
msg.Length + ";" + 0 + ";" + BeWoApp.LoggedOnUser.LoginName + ";" + "0" +
BeWoApp.Tenant + msg +
DateTime.Now.ToString("dd.MM.yyyy HH:mm:ss"));
Packet a = new Packet();
byte[] outStream;
if (type == ChatType.Team)
{
outStream = a.GetDataStream(BeWoApp.LoggedOnUser.Employee.PersonOid, empfängeroid, BeWoApp.LoggedOnUser.LoginName, msg, DataIdentifier.Team, BeWoApp.Tenant, false);
}
else
{
outStream = a.GetDataStream(BeWoApp.LoggedOnUser.Employee.PersonOid, empfängeroid, BeWoApp.LoggedOnUser.LoginName, msg, 0, BeWoApp.Tenant, false);
}
serverStream.Write(outStream, 0, outStream.Length);
serverStream.Flush();
@@ -867,7 +706,7 @@ namespace BeWo.View
}
else
{
SaveChatMessageinDB(BeWoApp.LoggedOnUser.Employee.PersonOid,empfängeroid, msg, 0);
SaveChatMessageinDB(BeWoApp.LoggedOnUser.Employee.PersonOid,empfängeroid, msg, 0, type);
MessageBox.Show("Die Daten werden in der Datenbank Gespeichert, da der Server nicht zur Verfügung steht.", "Info ", MessageBoxButton.OK);
}
}
@@ -879,18 +718,26 @@ namespace BeWo.View
Dispatcher.Invoke(
DispatcherPriority.Normal,
(ThreadStart)
(ThreadStart) // <--- Muss dass nicht Weg
delegate { ServerStats.Text = "Fehler: Die Nachricht konnte nicht gesendet werden."; });
}
}
}
public void SaveChatMessageinDB( long senderoid,long empfangid,string message,int istZugestellt)
public void SaveChatMessageinDB( long senderoid,long empfangid,string message,int istZugestellt,ChatType type)
{
try
{
ServiceFacade.DoOperationsServiceSync(s => s.CreateNewChatMessagesDC(senderoid, empfangid, message, istZugestellt));
//hier abfrage für team
if (type == ChatType.Team)
{
ServiceFacade.DoOperationsServiceSync(s => s.CreateNewChatMessagesDC(senderoid, empfangid, message, istZugestellt,empfangid));
}
else
{
ServiceFacade.DoOperationsServiceSync(s => s.CreateNewChatMessagesDC(senderoid, empfangid, message, istZugestellt,0));
}
}
catch (InvalidOperationException e)
{
@@ -900,40 +747,103 @@ namespace BeWo.View
public void LoadChatMessagefromDB(long senderoid ,long empfaengerOid)
public void LoadChatMessagefromDB(long senderoid ,long empfaengerOid, KontaktlistBuilder Curitem)
{
try
{
//if() team abfrage muss noch geregelt werden // es muss der richtige name gesetzt werden
var allitems =
ServiceFacade.DoCustomerServiceSync(
s => s.FindAllChatMessages(senderoid, empfaengerOid));
//######################################### Funktioniert auf anhieb ################################
if (Curitem.TypeChat == ChatType.Team)
{
var allTeamItems =
ServiceFacade.DoCustomerServiceSync(
s => s.FindAllChatMessagesFromTeam(senderoid, empfaengerOid));
List<long> x = new List<long>();
x.Add(senderoid);
x.Add(empfaengerOid);
var person = ServiceFacade.DoCustomerServiceSync(s => s.GetPersonsById(x));
List<long> x = new List<long>();
foreach (var list in allitems)
{
if (list.SenderPersonOid == senderoid)
{
Chat.Items.Add(new KontakMessageBuilder(person[0].FirstName, list.ChatText,
list.Uhrzeit.ToString()));
foreach (var team in allTeamItems)
{
if (!x.Contains(team.SenderPersonOid.Value))
x.Add(team.SenderPersonOid.Value);
}
else
x.Sort();
var person = ServiceFacade.DoCustomerServiceSync(s => s.GetPersonsById(x));
foreach (var anzeige in allTeamItems)
{
Chat.Items.Add(new KontakMessageBuilder(person[1].FirstName, list.ChatText, list.Uhrzeit.ToString()));
}
if (x.Contains(anzeige.SenderPersonOid.Value))
{
// Hier muss noch abfrage für ungelesene Nachricht hin
int zahl = (int) x.IndexOf(anzeige.SenderPersonOid.Value);
Chat.Items.Add(new KontakMessageBuilder(person[zahl].FirstName, anzeige.ChatText,
anzeige.Uhrzeit.ToString(), anzeige.SenderPersonOid.Value));
}
}
}
else
{
// von hier aus alles original funktionierende Funktionen
var allitems =
ServiceFacade.DoCustomerServiceSync(
s => s.FindAllChatMessages(senderoid, empfaengerOid));
List<long> x = new List<long>();
x.Add(senderoid);
x.Add(empfaengerOid);
var person = ServiceFacade.DoCustomerServiceSync(s => s.GetPersonsById(x));
int i = 0;
foreach (var list in allitems)
{
if (list.IstGelesen == 1 && list.TeamOid == null)
{
if (list.SenderPersonOid == senderoid) //<- Funktionsfähiges Original hehe
{
Chat.Items.Add(new KontakMessageBuilder(person[0].FirstName, list.ChatText,
list.Uhrzeit.ToString(), senderoid));
}
else
{
Chat.Items.Add(new KontakMessageBuilder(person[1].FirstName, list.ChatText,
list.Uhrzeit.ToString(), empfaengerOid));
} //<- Funktionsfähiges Original hehe
}
else
{
if (list.TeamOid == null){
if (i == 0) // mus entweder zum empfänger oder zum sender mit hinein implementiert werden.
{
Chat.Items.Add(new KontakMessageBuilder("", "------------------------ Ungelesene Nachrichten -----------------------", "", 0));
i++;
}
if (list.SenderPersonOid == senderoid)
{
Chat.Items.Add(new KontakMessageBuilder(person[0].FirstName, list.ChatText, // also hier
list.Uhrzeit.ToString(), senderoid));
}
else
{
Chat.Items.Add(new KontakMessageBuilder(person[1].FirstName, list.ChatText, // oder hier
list.Uhrzeit.ToString(), empfaengerOid));
}
}
}
}
// abfrage für team muss auch hier hin
ServiceFacade.DoCustomerServiceSync(s => s.UpdateIstGelesen(senderoid, empfaengerOid, true));
}
}
catch (Exception edf)
{
MessageBox.Show("Beim Laden einer Nachricht aus der Datenbank ist ein Fehler aufgetreten.", "Fehler: 2320 ", MessageBoxButton.OK);
}
}
//placeholder
@@ -949,6 +859,7 @@ namespace BeWo.View
MessageBox.Show("Fehler beim Fokusieren der Nachrichten Leiste.", "Fehler: 2330 ", MessageBoxButton.OK);
}
}
/* private void OnDefocus(object sender, EventArgs e)
{
try
@@ -964,42 +875,18 @@ namespace BeWo.View
MessageBox.Show("Fehler beim De-Fokusieren der Nachrichten Leiste.", "Fehler: 2340 ", MessageBoxButton.OK);
}
}*/
}
//KontaklisteFormat und KontaktMessageBuilder Klasse
public class KontaktlistBuilder
{
/* public KontaktlistBuilder(string name, string lastms, ImageSource image, long empfaengerid, Int32 workerid, ChatType typeChat)
{
this.Name = name;
this.Lastms = lastms;
this.Image = image;
this.EmpfaengerOid = empfaengerid;
this.WorkerId = workerid;
Receivems = "";
//this.isTeam = isteam;
TypeChat = typeChat;
}
public KontaktlistBuilder(string name, string lastms, ImageSource image, long empfaengerid, Int32 workerid, int receivems,ChatType typeChat)
{
this.Name = name;
this.Lastms = lastms;
this.Image = image;
this.EmpfaengerOid = empfaengerid;
this.WorkerId = workerid;
Receivems = receivems.ToString();
//this.isTeam = isteam;
TypeChat = typeChat;
}*/
public KontaktlistBuilder(string name, string lastms, ImageSource image, long empfaengerid,ChatType typeChat)
{
this.Name = name;
this.Lastms = lastms;
this.Image = image;
this.EmpfaengerOid = empfaengerid;
// this.WorkerId = null;
this.EmpfaengerOid = empfaengerid;
Receivems = "";
TypeChat = typeChat;
@@ -1012,11 +899,8 @@ namespace BeWo.View
public ImageSource Image { get; private set; }
public long EmpfaengerOid { get; private set; }
// public int? WorkerId { get; private set; }
public string Receivems { get; set; }
//public Boolean isTeam {get; private set; }
public string Receivems { get; set; }
public ChatType TypeChat { get; set; }
}
@@ -1027,21 +911,18 @@ namespace BeWo.View
public class KontakMessageBuilder
{
public KontakMessageBuilder(string username, string message, string sendtime)
public KontakMessageBuilder(string username, string message, string sendtime,long messagePersonOid)
{
Username = username;
UserMessage = message;
SendTime = sendtime;
MessagePersonOid = messagePersonOid;
}
public string Username { get; private set; }
public string UserMessage { get; private set; }
public string SendTime { get; private set; }
public long MessagePersonOid { get; private set; }
}
}

View File

@@ -64,6 +64,7 @@ namespace BeWo.View
public TcpClient clientSocket = new TcpClient();
NetworkStream serverStream;
protected Thread asx;
protected bool isReconnect = false;
//################################################################
@@ -1247,7 +1248,7 @@ namespace BeWo.View
});
var ipAdresse = "192.168.1.103"; //9
var ipAdresse = "192.168.1.103"; //3 |9
var port = 5000;
clientSocket.Connect(ipAdresse, port);
@@ -1272,7 +1273,8 @@ namespace BeWo.View
}
catch (Exception e)
{
MessageBox.Show("Verbindung zum Chat-Server konnte nicht aufgebaut werden.", "Fehler: 2010 ", MessageBoxButton.OK);
if (!isReconnect)
MessageBox.Show("Verbindung zum Chat-Server konnte nicht aufgebaut werden.", "Fehler: 2010 ", MessageBoxButton.OK);
Dispatcher.Invoke(
DispatcherPriority.Normal,
@@ -1296,24 +1298,13 @@ namespace BeWo.View
String abc = "";
var packet = new Packet();
packet.Socket = s.Client;
packet.ChatMessage = "";
packet.ClientName = BeWoApp.LoggedOnEmployee.FirstName + " " + BeWoApp.LoggedOnEmployee.LastName;
packet.DataIdentifier = DataIdentifier.Login;
packet.MessageTimeStamp = DateTime.Now;
packet.Tenant = BeWoApp.Tenant;
packet.SenderPersonOid = BeWoApp.LoggedOnEmployee.PersonOid ?? 0;
byte[] outStream = System.Text.Encoding.ASCII.GetBytes("" + BeWoApp.LoggedOnUser.Employee.PersonOid + ";0;" + BeWoApp.LoggedOnUser.LoginName.Length + ";" +
abc.Length + ";" +(int)DataIdentifier.Login + ";" + BeWoApp.LoggedOnUser.LoginName + ";" + "0" +
BeWoApp.Tenant + abc + DateTime.Now.ToString("dd.MM.yyyy HH:mm:ss"));
//outStream = packet.GetDataStream();
Packet a = new Packet();
byte[] outStream = a.GetDataStream(BeWoApp.LoggedOnUser.Employee.PersonOid, 0, BeWoApp.LoggedOnUser.LoginName, abc, DataIdentifier.Login, BeWoApp.Tenant,false);
//byte[] outStream = System.Text.Encoding.ASCII.GetBytes("" + BeWoApp.LoggedOnUser.Employee.PersonOid + ";0;" + BeWoApp.LoggedOnUser.LoginName.Length + ";" +
// abc.Length + ";" +(int)DataIdentifier.Login + ";" + BeWoApp.LoggedOnUser.LoginName + ";" + "0" +
// BeWoApp.Tenant + abc + DateTime.Now.ToString("dd.MM.yyyy HH:mm:ss"));
serverStream.Write(outStream, 0, outStream.Length);
serverStream.Flush();
}
@@ -1344,27 +1335,34 @@ namespace BeWo.View
String[] receiveData = ErhalteDatenFromString(data);
long persoid = Int32.Parse(receiveData[3]);
List<long> x = new List<long>();
x.Add(persoid);
var person = ServiceFacade.DoCustomerServiceSync(s => s.GetPersonsById(x));
if (persoid != 0) // <--- Vorsorglich erichtet
{
List<long> x = new List<long>();
x.Add(persoid);
if (!chatpav.CompareWithListItem(persoid))
{
ErstelleChatViews(persoid);
}
var person = ServiceFacade.DoCustomerServiceSync(s => s.GetPersonsById(x));
if (!chatpav.CompareWithListItem(persoid))
{
ErstelleChatViews(persoid);
}
if (receiveData[4] == DataIdentifier.Logout.ToString())
{
DeleteLoggedOffUsers(receiveData[2],persoid);
}
else
{
//Hier eine weitere überprüfung einbauen wegen lehrstring
UebergebeNachricht(receiveData[0], person[0].FirstName + " " + person[0].LastName, persoid);
}
if (receiveData[4] == DataIdentifier.StatusNotificationLogout.ToString())
{
DeleteLoggedOffUsers(receiveData[2],persoid);
}
else
{
//Hier testen ob alles klappt
if(!receiveData[0].Equals(""))
UebergebeNachricht(receiveData[0], person[0].FirstName + " " + person[0].LastName, persoid);
}
WaitForMsFromServer();
}
}
}
@@ -1384,7 +1382,6 @@ namespace BeWo.View
a.GetData(message);
string[] alfa = new string[5];
alfa[0] = a.ChatMessage;
@@ -1426,29 +1423,52 @@ namespace BeWo.View
Dispatcher.Invoke(
DispatcherPriority.Normal,
(ThreadStart) delegate
{
chat.AppendText(name + ": " + text + "\n");
chat.ScrollToEnd();
{
if (chatpav.AktChatUser.Items.Count > 0){
KontaktlistBuilder curItem = (KontaktlistBuilder) chatpav.AktChatUser.Items[0];
if (chatpav.Visibility != Visibility.Visible &&
pavlist[personoid].Visibility != Visibility.Visible)
{
pavlist[personoid].Visibility = Visibility.Visible;
pavlist[personoid].SetText(text, 1);
}
else if (pavlist[personoid].Visibility != Visibility.Visible)
{
chatpav.SetText(text, name, personoid);
}
else
{
pavlist[personoid].AppendTextwhileViewOpen(text, 1);
}
if (chatpav.Visibility == Visibility.Collapsed &&
pavlist[personoid].Visibility == Visibility.Collapsed)
{
pavlist[personoid].Visibility = Visibility.Visible;
pavlist[personoid].SetText(text, 1);
}
else if (pavlist[personoid].Visibility == Visibility.Collapsed && chatpav.Visibility == Visibility.Visible && curItem.EmpfaengerOid.Equals(personoid))
{
chatpav.SetText(text, name, personoid);
}
else if (pavlist[personoid].Visibility == Visibility.Collapsed && !curItem.EmpfaengerOid.Equals(personoid))
{
pavlist[personoid].Visibility = Visibility.Visible;
pavlist[personoid].SetText(text, 1);
}
else
{
pavlist[personoid].AppendTextwhileViewOpen(text, 1);
}
}else
{
if (chatpav.Visibility == Visibility.Collapsed &&
pavlist[personoid].Visibility == Visibility.Collapsed)
{
pavlist[personoid].Visibility = Visibility.Visible;
pavlist[personoid].SetText(text, 1);
}
else if (pavlist[personoid].Visibility == Visibility.Collapsed && chatpav.Visibility == Visibility.Visible)
{
pavlist[personoid].Visibility = Visibility.Visible;
pavlist[personoid].SetText(text, 1);
}
else
{
pavlist[personoid].AppendTextwhileViewOpen(text, 1);
}
}
});
//Continue Waiting for data
WaitForMsFromServer();
// WaitForMsFromServer();
}
catch (Exception e)
{
@@ -1490,8 +1510,6 @@ namespace BeWo.View
{
while (true)
{
//Connected ist immer true ??????
if (clientSocket.Connected == false)
{
@@ -1504,11 +1522,9 @@ namespace BeWo.View
{
chatpav.ButtonAlarmLabel.Visibility = Visibility.Visible;
chatpav.SetAllUserOfflineIfNoInet();
});
// asx.Join();
// asx = new Thread(ReConnectAfterLoseConnection); // <---------- performanceproblems Thread neu setzen und dann methode aufrufen
ReConnectAfterLoseConnection();
break;
@@ -1525,6 +1541,7 @@ namespace BeWo.View
}
private void ReConnectAfterLoseConnection()
{
@@ -1532,16 +1549,23 @@ namespace BeWo.View
{
if (clientSocket.Connected == false)
{
while (true)
while (true) // <--- erstma weg ?
{
// abfrage dami dies nicht millionen mal wiederholt wird
asx = new Thread(ConnectWithServer);
asx.Start();
if (clientSocket.Connected)
break;
{
isReconnect = false;
break;
}
isReconnect = true;
Thread.Sleep(5000);
Thread.Sleep(15000);
}
}
@@ -1571,7 +1595,6 @@ namespace BeWo.View
chatpav.SetList(person[0].FirstName + " " + person[0].LastName, personOid);
chatpav.SetServerStats(person[0].FirstName + " " + person[0].LastName + " Connected");
//statt "" war erhalteneDS | neu hinzugefügt
pav = new MiniChatView(person[0].FirstName + " " + person[0].LastName, "", chatpav, personOid);
pav.Visibility = Visibility.Collapsed;
@@ -1600,6 +1623,14 @@ namespace BeWo.View
{
serverStream.Close();
}
if (asx.IsAlive)
{
asx.Join();// kann muss aber nicht
asx = null;
}
}
catch (Exception edf)
{

View File

@@ -84,8 +84,8 @@ namespace BeWo.View
var myArray = myListDS.ToArray();
anzahlDS = 0;
//abfrage ob viewchat gesetzt ist
viewChat.SetTextFromMiniV(myArray, incommingName, incommingEmpfangOid);
viewChat.SetListBoxSelection(incommingEmpfangOid,incommingName);
viewChat.SetListBoxSelection(incommingEmpfangOid,incommingName);
// viewChat.SetTextFromMiniV(myArray, incommingName, incommingEmpfangOid);
viewChat.Visibility = Visibility.Visible;
myListDS.Clear();
Visibility = Visibility.Collapsed;
@@ -109,10 +109,9 @@ namespace BeWo.View
var myArray = myListDS.ToArray();
anzahlDS = 0;
//abfrage ob viewchat gesetzt ist <---
viewChat.SetTextFromMiniV(myArray, incommingName,incommingEmpfangOid);
anzahlDS = 0;
viewChat.SetListBoxSelection(incommingEmpfangOid, incommingName);
//viewChat.SetTextFromMiniV(myArray, incommingName,incommingEmpfangOid);
viewChat.Visibility = Visibility.Visible;
myListDS.Clear();
Visibility = Visibility.Collapsed;
@@ -176,9 +175,9 @@ namespace BeWo.View
var myArray = myListDS.ToArray();
anzahlDS = 0;
viewChat.SetTextFromMiniV(myArray, incommingName, incommingEmpfangOid);
viewChat.SetListBoxSelection(incommingEmpfangOid, incommingName);
viewChat.SetListBoxSelection(incommingEmpfangOid, incommingName);
// viewChat.SetTextFromMiniV(myArray, incommingName, incommingEmpfangOid);
viewChat.Visibility = Visibility.Visible;
myListDS.Clear();
Visibility = Visibility.Collapsed;

View File

@@ -12,6 +12,8 @@ namespace BeWo.ViewModel
public static string PropertyName_IstZugestellt = "IstZugestellt";
public static string PropertyName_IstGelesen = "IstGelesen";
private string _ChatText;
private DateTime _Uhrzeit;
@@ -22,6 +24,10 @@ namespace BeWo.ViewModel
private int _istZugestellt;
private int _IstGelesen;
private long? _TeamOid;
public ChatMessageVM(ChatMessageDC pDC)
: base(pDC, true)
@@ -105,6 +111,39 @@ namespace BeWo.ViewModel
}
}
public virtual int IstGelesen
{
get
{
return _IstGelesen;
}
set
{
if (AreDifferent(_IstGelesen, value))
{
_IstGelesen = value;
}
}
}
public virtual long? TeamOid
{
get
{
return _TeamOid;
}
set
{
if (this.AreDifferent(this._TeamOid, value))
{
this._TeamOid = value;
}
}
}
protected override void InitByDataContract(ChatMessageDC pDataContract)
{
@@ -113,6 +152,8 @@ namespace BeWo.ViewModel
this._Uhrzeit = pDataContract.Uhrzeit;
this._ChatText = pDataContract.ChatText;
_istZugestellt = pDataContract.IstZugestellt;
_IstGelesen = pDataContract.IstGelesen;
_TeamOid = pDataContract.TeamOid;
}
protected override ChatMessageDC MapToDataContract(ChatMessageDC pDataContract, bool doCommit)
@@ -122,6 +163,8 @@ namespace BeWo.ViewModel
pDataContract.Uhrzeit = _Uhrzeit;
pDataContract.ChatText = _ChatText;
pDataContract.IstZugestellt = _istZugestellt;
pDataContract.IstGelesen = _IstGelesen;
pDataContract.TeamOid = _TeamOid;
return pDataContract;
}

File diff suppressed because one or more lines are too long

View File

@@ -1536,6 +1536,26 @@ namespace BeWo.Data.Access
return c.List<ChatMessage>();
}
public IEnumerable<ChatMessage> FindAllChatMessagesFromTeam(long senderOid, long teamOid)
{
var c = CreateCriteriaIsActive<ChatMessage>()
.Add(Restrictions.Eq(ChatMessage.PropertyName_TeamOid, teamOid));
return c.List<ChatMessage>();
}
public IEnumerable<ChatMessage> FindAllEmpfängerChatMessages(long senderOid, long empfaengerOid)
{
var c = CreateCriteriaIsActive<ChatMessage>()
.Add(Restrictions.And(
Restrictions.Eq(ChatMessage.PropertyName_SenderPersonOid, senderOid),
Restrictions.Eq(ChatMessage.PropertyName_EmpfängerPersonOid, empfaengerOid)));
return c.List<ChatMessage>();
}
public IEnumerable<Employee> FindAllChatActiveEmployees()
{
var c = CreateCriteriaIsActive<EmployeeAPPCode>()

View File

@@ -14,8 +14,12 @@ namespace BeWo.Data.Entities
public static string PropertyName_SenderPersonOid = "SenderPersonOid";
public static string PropertyName_TeamOid = "TeamOid";
public static string PropertyName_IstZugestellt = "IstZugestellt";
public static string PropertyName_IstGelesen = "IstGelesen";
private string _ChatText;
private DateTime _Uhrzeit;
@@ -26,6 +30,10 @@ namespace BeWo.Data.Entities
private int _istZugestellt;
private int _IstGelesen;
private long? _TeamOid;
public ChatMessage()
{
_Tid = TableID.ChatMessage;
@@ -109,5 +117,39 @@ namespace BeWo.Data.Entities
}
}
}
public virtual int IstGelesen
{
get
{
return _IstGelesen;
}
set
{
if (AreDifferent(_IstGelesen, value))
{
_IstGelesen = value;
}
}
}
public virtual long? TeamOid
{
get
{
return _TeamOid;
}
set
{
if (this.AreDifferent(this._TeamOid, value))
{
this._TeamOid = value;
}
}
}
}
}

View File

@@ -18,6 +18,8 @@
<property name="Uhrzeit" column="Uhrzeit" />
<property name="ChatText" column="ChatText" />
<property name="istZugestellt" column="IstZugestellt" />
<property name="IstGelesen" column="IstGelesen" />
<property name="TeamOid" column="TeamOid" />
</class>
</hibernate-mapping>

View File

@@ -0,0 +1,2 @@
ALTER TABLE `1234567890`.`chatmessages`
ADD COLUMN `TeamOid` BIGINT(19) NULL DEFAULT NULL COMMENT '' AFTER `IstGelesen`;

View File

@@ -15,6 +15,8 @@ namespace BeWo.Service.DCEntityMapper
pDataContract.ChatText = pEntity.ChatText;
pDataContract.Uhrzeit = pEntity.Uhrzeit;
pDataContract.IstZugestellt = pEntity.istZugestellt;
pDataContract.IstGelesen = pEntity.IstGelesen;
pDataContract.TeamOid = pEntity.TeamOid;
return pDataContract;
}
@@ -26,6 +28,8 @@ namespace BeWo.Service.DCEntityMapper
pEntity.Uhrzeit = pDataContract.Uhrzeit;
pEntity.ChatText = pDataContract.ChatText;
pEntity.istZugestellt = pDataContract.IstZugestellt;
pEntity.IstGelesen = pDataContract.IstGelesen;
pEntity.TeamOid = pDataContract.TeamOid;
return pEntity;
}

View File

@@ -593,6 +593,14 @@ namespace BeWo.Service.ServiceContracts
[OperationContract]
List<ChatMessageDC> FindAllChatMessages(long senderOid, long empfaengerOid);
[FaultContract(typeof (BeWoFault))]
[OperationContract]
List<ChatMessageDC> FindAllChatMessagesFromTeam(long senderOid, long teamEmpfangOid);
[FaultContract(typeof (BeWoFault))]
[OperationContract]
void UpdateIstGelesen(long senderOid, long empfaengerOid, bool istGelesen);
[FaultContract(typeof (BeWoFault))]
[OperationContract]
Byte[] GetCustomerImage(long customerOid);

View File

@@ -515,11 +515,16 @@ namespace BeWo.Service.ServiceContracts
[FaultContract(typeof (BeWoFault))]
[OperationContract]
ChatMessageDC CreateNewChatMessagesDC(long senderOid, long empfängerOid, string message, int istZugestellt);
ChatMessageDC CreateNewChatMessagesDC(long senderOid, long empfängerOid, string message, int istZugestellt,long teamid);
[FaultContract(typeof(BeWoFault))]
[OperationContract]
CustomerAPPCodeDC CreateNewIsChatActiveCustomerAPPCodeDC(long customerOid, int activeType);
void UpdateIsChatActiveCustomerAPPCodeDC(long customerOid, int activeType);
[FaultContract(typeof (BeWoFault))]
[OperationContract]
IList<CustomerAPPCodeDC> GetIsChatActiveCustomerAPPCodeDC(long customerOid, int activeType);
[FaultContract(typeof(BeWoFault))]
[OperationContract]
@@ -527,11 +532,11 @@ namespace BeWo.Service.ServiceContracts
[FaultContract(typeof (BeWoFault))]
[OperationContract]
EmployeeAPPCodeDC CreateNewIsChatActiveEmployeeAPPCodeDC(long employeeOid, int activeType);
void UpdateIsChatActiveEmployeeAPPCodeDC(long employeeOid, int activeType);
[FaultContract(typeof (BeWoFault))]
[OperationContract]
EmployeeAPPCodeDC CreateNewNotfallNacrichtEmployeeAPPCodeDC(long employeeOid, String notfallstate);
void UpdateNotfallNacrichtEmployeeAPPCodeDC(long employeeOid, String notfallstate);
[FaultContract(typeof(BeWoFault))]
[OperationContract]

View File

@@ -3174,6 +3174,50 @@ namespace BeWo.Service.ServiceImplementations
}
}
public List<ChatMessageDC> FindAllChatMessagesFromTeam (long senderOid, long teamEmpfangOid)
{
try
{
var messages = DAOFactory.SearchDAO.FindAllChatMessagesFromTeam(senderOid, teamEmpfangOid);
return MapperFactory.ChatMessagesDC_ChatMessages.MapToNewDCs(messages);
}
catch (Exception e)
{
throw Utils.CreateBeWoFaultException(e);
}
}
public void UpdateIstGelesen(long senderOid, long empfaengerOid, bool istGelesen)
{
try
{
var messages = DAOFactory.SearchDAO.FindAllEmpfängerChatMessages(senderOid, empfaengerOid);
// var updateGelesen = MapperFactory.ChatMessagesDC_ChatMessages.MapToNewDCs(messages);
foreach (var read in messages)
{
if(istGelesen)
{
read.IstGelesen = 1;
}
else
{
read.IstGelesen = 0;
}
}
DAOFactory.GenericDAO.Update(messages);
}
catch (Exception e)
{
throw Utils.CreateBeWoFaultException(e);
}
}
public List<CustomerAPPCodeDC> GetAllCustomerAppCodes(long pCustomerOid)
{

View File

@@ -3021,30 +3021,21 @@ namespace BeWo.Service.ServiceImplementations
newCode.EmployeeOid = employeeOid;
newCode.EmployeeCodeGenDate = DateTime.Now;
DAOFactory.GenericDAO.Insert(newCode);
var employeeAPPCodeDC = MapperFactory.EmployeeAPPCodeDC_EmployeeAPPCode.MapToNewDC(newCode);
var x = DAOFactory.SearchDAO.FindAllEmployeeAppCodes(employeeOid);
return employeeAPPCodeDC;
}
catch (Exception e)
{
throw Utils.CreateBeWoFaultException(e);
}
}
int ischatAktive = 0;
string notfallstate = "";
foreach (var item in x)
{
ischatAktive = item.IsChatAktiv;
notfallstate = item.NotfallStatement;
break;
}
public EmployeeAPPCodeDC CreateNewIsChatActiveEmployeeAPPCodeDC(long employeeOid, int activeType)
{
try
{
EmployeeAPPCode newCode = new EmployeeAPPCode();
newCode.EmployeeOid = employeeOid;
if(activeType == 1)
newCode.IsChatAktiv = activeType;
else
newCode.IsChatAktiv = 0;
newCode.IsChatAktiv = ischatAktive;
newCode.NotfallStatement = notfallstate;
DAOFactory.GenericDAO.Insert(newCode);
@@ -3058,20 +3049,42 @@ namespace BeWo.Service.ServiceImplementations
}
}
public EmployeeAPPCodeDC CreateNewNotfallNacrichtEmployeeAPPCodeDC(long employeeOid, String notfallstate)
public void UpdateIsChatActiveEmployeeAPPCodeDC(long employeeOid, int activeType)
{
try
{
EmployeeAPPCode newCode = new EmployeeAPPCode();
newCode.EmployeeOid = employeeOid;
var employeecode = DAOFactory.SearchDAO.FindAllEmployeeAppCodes(employeeOid);
newCode.NotfallStatement = notfallstate;
foreach (var items in employeecode)
{
if (activeType == 1)
items.IsChatAktiv = activeType;
else
items.IsChatAktiv = 0;
}
DAOFactory.GenericDAO.Insert(newCode);
DAOFactory.GenericDAO.Update(employeecode);
}
catch (Exception e)
{
throw Utils.CreateBeWoFaultException(e);
}
}
var employeeAPPCodeDC = MapperFactory.EmployeeAPPCodeDC_EmployeeAPPCode.MapToNewDC(newCode);
public void UpdateNotfallNacrichtEmployeeAPPCodeDC(long employeeOid, String notfallstate)
{
try
{
var employeecode = DAOFactory.SearchDAO.FindAllEmployeeAppCodes(employeeOid);
return employeeAPPCodeDC;
foreach (var items in employeecode)
{
items.NotfallStatement = notfallstate;
}
DAOFactory.GenericDAO.Update(employeecode);
}
catch (Exception e)
{
@@ -3090,6 +3103,19 @@ namespace BeWo.Service.ServiceImplementations
newCode.CustomerOid = customerOid;
newCode.CustomerCodeGenDate = DateTime.Now;
var x = DAOFactory.SearchDAO.FindAllCustomerAppCodes(customerOid);
int ischatAktive = 0;
foreach (var item in x)
{
ischatAktive = item.IsChatAktiv;
break;
}
newCode.IsChatAktiv = ischatAktive;
DAOFactory.GenericDAO.Insert(newCode);
var customerAPPCodeDC = MapperFactory.CustomerAPPCodeDC_CustomerAPPCode.MapToNewDC(newCode);
@@ -3102,7 +3128,7 @@ namespace BeWo.Service.ServiceImplementations
}
}
public ChatMessageDC CreateNewChatMessagesDC(long senderOid, long empfängerOid, string message, int istZugestellt)
public ChatMessageDC CreateNewChatMessagesDC(long senderOid, long empfängerOid, string message, int istZugestellt, long teamid)
{
try
{
@@ -3112,7 +3138,14 @@ namespace BeWo.Service.ServiceImplementations
newCode.Uhrzeit = DateTime.Now;
newCode.ChatText = message;
newCode.istZugestellt = istZugestellt;
newCode.IstGelesen = 0;
if (teamid != 0)
newCode.TeamOid = teamid;
else
newCode.TeamOid = null;
DAOFactory.GenericDAO.Insert(newCode);
var ChatMEssagesDC = MapperFactory.ChatMessagesDC_ChatMessages.MapToNewDC(newCode);
@@ -3125,21 +3158,37 @@ namespace BeWo.Service.ServiceImplementations
}
}
public CustomerAPPCodeDC CreateNewIsChatActiveCustomerAPPCodeDC(long customerOid,int activeType)
public void UpdateIsChatActiveCustomerAPPCodeDC(long customerOid,int activeType)
{
try
{
CustomerAPPCode newCode = new CustomerAPPCode();
newCode.CustomerOid = customerOid;
if(activeType == 1)
newCode.IsChatAktiv = activeType;
else
newCode.IsChatAktiv = 0;
DAOFactory.GenericDAO.Insert(newCode);
var customercode = DAOFactory.SearchDAO.FindAllCustomerAppCodes(customerOid);
var customerAPPCodeDC = MapperFactory.CustomerAPPCodeDC_CustomerAPPCode.MapToNewDC(newCode);
foreach (var items in customercode)
{
if (activeType == 1)
items.IsChatAktiv = activeType;
else
items.IsChatAktiv = 0;
}
DAOFactory.GenericDAO.Update(customercode);
}
catch (Exception e)
{
throw Utils.CreateBeWoFaultException(e);
}
}
public IList<CustomerAPPCodeDC> GetIsChatActiveCustomerAPPCodeDC(long customerOid, int activeType)
{
try
{
var customercode = DAOFactory.SearchDAO.FindAllCustomerAppCodes(customerOid);
var customerAPPCodeDC = MapperFactory.CustomerAPPCodeDC_CustomerAPPCode.MapToNewDCs(customercode);
return customerAPPCodeDC;
}

View File

@@ -832,6 +832,7 @@ namespace BS.Shared
StatusNotificationLogout,
OldMessage,
DeliveringStatusChange,
StatusNotificationLoginBroadcast
StatusNotificationLoginBroadcast,
Team
}
}

View File

@@ -25,6 +25,10 @@ namespace BS.Shared.DataContracts
[DataMember]
public int IstZugestellt { get; set; }
[DataMember]
public int IstGelesen { get; set; }
[DataMember]
public long? TeamOid { get; set; }
}
}

View File

@@ -96,5 +96,16 @@ namespace BS.Shared
return Encoding.UTF8.GetBytes(result);
}
public byte[] GetDataStream(long senderPersonOid, long empfaengerPersonoid, string clientName, string message, DataIdentifier dataIdentifier, string tenant, bool isDelivered)
{
//Bewo Klient Speziallisiert
var result = "";
result += senderPersonOid + ";" + empfaengerPersonoid + ";" + clientName.Length + ";" + message.Length + ";" + (int)dataIdentifier + ";" + 0 + ";" + 0 + ";" + tenant + ";" + clientName + message + DateTime.Now.ToString("dd.MM.yyyy HH:mm:ss") + "" + (isDelivered ? 1 : 0);
return Encoding.UTF8.GetBytes(result);
}
}
}