Merge branch 'master' of ssh://float.beyondsoft.de/git/beyondSoft/BeWo
# Conflicts: # BeWo/View/ChatView.xaml.cs # BeWoChatServer/Server.cs # BeWoOhneReports.v12.suo # BeWoPlanerMobil/logs/Traces.svclog # Service/DCEntityMapper/ChatMessageDC_ChatMessage.cs # Service/ServiceImplementations/OperationsServiceImp.cs
This commit is contained in:
@@ -38,16 +38,16 @@
|
||||
<UpdatePeriodically>false</UpdatePeriodically>
|
||||
<UpdateRequired>true</UpdateRequired>
|
||||
<MapFileExtensions>false</MapFileExtensions>
|
||||
<InstallUrl>http://FOBP01.fortis-ev.org.local/</InstallUrl>
|
||||
<InstallUrl>http://app.beyondsoft.de/intern/</InstallUrl>
|
||||
<TargetCulture>de-DE</TargetCulture>
|
||||
<ProductName>BeWoPlaner</ProductName>
|
||||
<PublisherName>beyondSoft GmbH</PublisherName>
|
||||
<MinimumRequiredVersion>2.0.1.103</MinimumRequiredVersion>
|
||||
<MinimumRequiredVersion>2.0.1.113</MinimumRequiredVersion>
|
||||
<CreateWebPageOnPublish>true</CreateWebPageOnPublish>
|
||||
<WebPage>publish.htm</WebPage>
|
||||
<OpenBrowserOnPublish>false</OpenBrowserOnPublish>
|
||||
<TrustUrlParameters>true</TrustUrlParameters>
|
||||
<ApplicationRevision>104</ApplicationRevision>
|
||||
<ApplicationRevision>114</ApplicationRevision>
|
||||
<ApplicationVersion>2.0.1.%2a</ApplicationVersion>
|
||||
<UseApplicationTrust>false</UseApplicationTrust>
|
||||
<CreateDesktopShortcut>true</CreateDesktopShortcut>
|
||||
@@ -401,6 +401,14 @@
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="View\ChatDokumentationsView.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="View\ChatEmojisView.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="View\MiniChatView.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
@@ -759,6 +767,12 @@
|
||||
<Compile Include="View\ChatServiceEmployee.xaml.cs">
|
||||
<DependentUpon>ChatServiceEmployee.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="View\ChatDokumentationsView.xaml.cs">
|
||||
<DependentUpon>ChatDokumentationsView.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="View\ChatEmojisView.xaml.cs">
|
||||
<DependentUpon>ChatEmojisView.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="View\MiniChatView.xaml.cs">
|
||||
<DependentUpon>MiniChatView.xaml</DependentUpon>
|
||||
</Compile>
|
||||
@@ -2379,12 +2393,14 @@
|
||||
<ItemGroup>
|
||||
<Resource Include="BeWoPlaner.ico" />
|
||||
</ItemGroup>
|
||||
<ItemGroup />
|
||||
<ItemGroup>
|
||||
<Resource Include="Ressources\Icons\delete.png" />
|
||||
<Resource Include="Ressources\Icons\edit.png" />
|
||||
<Resource Include="Ressources\Icons\new.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="Ressources\Icons\trauriges-smiley.png" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<PropertyGroup>
|
||||
<PostBuildEvent>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<PublishUrlHistory>D:\Projects\beyondsoft\BeWoPlaner\Publish\|C:\Projects\beyondsoft\BeWoPlaner\Publish\|D:\Projects\BEYONDSOFT\BeWoPlaner\Publish\|C:\Projects\BEYONDSOFT\BeWoPlaner\Publish\|C:\Projects\BEYONDSOFT\BeWoPlaner\Publish4\</PublishUrlHistory>
|
||||
<InstallUrlHistory>http://FOBP01.fortis-ev.org.local/|http://10.0.116.4/|http://app.beyondsoft.de/|http://app.beyondsoft.de/test/|http://app.beyondsoft.de/deploy/</InstallUrlHistory>
|
||||
<InstallUrlHistory>http://app.beyondsoft.de/intern/|http://app.beyondsoft.de/deploy/|http://FOBP01.fortis-ev.org.local/|http://10.0.116.4/|http://app.beyondsoft.de/</InstallUrlHistory>
|
||||
<SupportUrlHistory />
|
||||
<UpdateUrlHistory />
|
||||
<BootstrapperUrlHistory />
|
||||
|
||||
@@ -82,11 +82,11 @@ namespace BeWo
|
||||
|
||||
try
|
||||
{
|
||||
if (BeWoApp.MainControl.HomeView.clientSocket.Connected)
|
||||
{
|
||||
// if (BeWoApp.MainControl.HomeView.clientSocket.Connected)
|
||||
// {
|
||||
BeWoApp.MainControl.HomeView.CloseServerConnection();
|
||||
|
||||
}
|
||||
// }
|
||||
}
|
||||
catch (Exception edf)
|
||||
{
|
||||
|
||||
14
BeWo/View/ChatDokumentationsView.xaml
Normal file
14
BeWo/View/ChatDokumentationsView.xaml
Normal file
@@ -0,0 +1,14 @@
|
||||
<Window x:Class="BeWo.View.ChatDokumentationsView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:view="clr-namespace:BeWo.View"
|
||||
Title="Chat Dokumentation" Height="800" Width="550" WindowStartupLocation="CenterScreen" WindowStyle="None"
|
||||
AllowsTransparency="True"
|
||||
Background="Transparent"
|
||||
ResizeMode="NoResize">
|
||||
<Grid >
|
||||
<Border x:Name="popup_contentChat" MouseLeftButtonDown="RootGroupBox_OnMouseLeftButtonDown"/>
|
||||
</Grid>
|
||||
</Window>
|
||||
|
||||
|
||||
216
BeWo/View/ChatDokumentationsView.xaml.cs
Normal file
216
BeWo/View/ChatDokumentationsView.xaml.cs
Normal file
@@ -0,0 +1,216 @@
|
||||
using System;
|
||||
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.Detail;
|
||||
using BeWo.ViewModel.ListViewModel;
|
||||
using BS.Shared;
|
||||
using BS.Shared.DataContracts;
|
||||
using BS.Shared.DataContracts.Compact;
|
||||
using DevExpress.Xpf.Core;
|
||||
using DevExpress.XtraPrinting.Native;
|
||||
using DevExpress.XtraPrinting.XamlExport;
|
||||
using Microsoft.Office.Interop.Word;
|
||||
using Color = System.Drawing.Color;
|
||||
|
||||
namespace BeWo.View
|
||||
{
|
||||
public partial class ChatDokumentationsView
|
||||
{
|
||||
protected List<KontakMessageBuilder> listarray;
|
||||
protected long? loggedOnMitarbeiter;
|
||||
|
||||
private ServiceRecordVM serviceRecord;
|
||||
|
||||
public ChatDokumentationsView(List<KontakMessageBuilder> _listarray, long? _loggedOnMitarbeiter,long _customerPersonOid,CompactCustomerDC _compactCustomer)
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
listarray = _listarray;
|
||||
loggedOnMitarbeiter = _loggedOnMitarbeiter;
|
||||
|
||||
|
||||
|
||||
long? customerOid = _customerPersonOid;
|
||||
string message = "";
|
||||
|
||||
|
||||
listarray.Sort((a, b) => a.SendTime.CompareTo(b.SendTime)); //-> Sortiere nach datum / hätte auch ein order by geholfen?
|
||||
|
||||
foreach (var ita in listarray)
|
||||
{
|
||||
message += ita.SendTime + " - "+ ita.Username + ": " + ita.UserMessage + "\n";
|
||||
}
|
||||
var firstTime = listarray.Min(r =>
|
||||
{
|
||||
var dt = DateTime.Parse(r.SendTime);
|
||||
dt = new DateTime(dt.Year, dt.Month, dt.Day, dt.Hour, dt.Minute, 0);
|
||||
return dt;
|
||||
});
|
||||
var lastTime = listarray.Max(r =>
|
||||
{
|
||||
var dt = 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 =>
|
||||
VMFactory.CreateServiceRecordVMAsync(
|
||||
BeWoApp.LoggedOnUser.Employee.EmployeeOid,
|
||||
vm => this.Dispatch(
|
||||
delegate
|
||||
{
|
||||
ServiceRecordEditView newView = new ServiceRecordEditView();
|
||||
|
||||
vm.DispatcherObject = this;
|
||||
|
||||
var dc = new ServiceRecordDC();
|
||||
dc.Start = firstTime;
|
||||
dc.End = lastTime;
|
||||
dc.Employee = BeWoApp.LoggedOnUser.Employee;
|
||||
dc.Customer = customerCompact;
|
||||
dc.SupportConcept = HoleHilfeplanAusListe(scList, customerCompact, firstTime, lastTime);
|
||||
|
||||
if (vm.PrototypeVM.SortedCategories != null && vm.PrototypeVM.SortedCategories.Count > 0)
|
||||
{
|
||||
var cat1 = vm.PrototypeVM.SortedCategories[0];
|
||||
|
||||
dc.ServiceDescription = vm.PrototypeVM.Category2Services[cat1][0];
|
||||
}
|
||||
serviceRecord = new ServiceRecordVM(dc, vm.PrototypeVM.Category2Services, vm.PrototypeVM.AllGoalCategories, vm.PrototypeVM.AllGoals);
|
||||
serviceRecord.Notice = message;
|
||||
|
||||
newView.InitView(vm, serviceRecord,false);
|
||||
if (customerCompact != null)
|
||||
{
|
||||
newView.SetSearchText(customerCompact.LastName);
|
||||
}
|
||||
else
|
||||
{
|
||||
newView.SetSearchText("");
|
||||
}
|
||||
|
||||
if (newView.CommandBindings.Count == 0)
|
||||
{
|
||||
newView.CommandBindings.Add(
|
||||
new CommandBinding(
|
||||
ApplicationCommands.Close,
|
||||
(s, e) =>
|
||||
{
|
||||
if (!newView.DoSaveCheck())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Close();
|
||||
}));
|
||||
newView.CommandBindings.Add(
|
||||
new CommandBinding(
|
||||
ApplicationCommands.Save,
|
||||
(s, e) =>
|
||||
{
|
||||
bool save = newView.IsValid();
|
||||
|
||||
if (!save)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
newView.SaveData();
|
||||
Close();
|
||||
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
popup_contentChat.Child = newView;
|
||||
|
||||
popup_contentChat.Visibility = Visibility.Visible;
|
||||
|
||||
|
||||
|
||||
//newView.SetStartTimeEndTime(first, last);
|
||||
//newView.SetLoggedOnEmployee();
|
||||
|
||||
})));
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
//rootGroupBox.Header = nameinf;
|
||||
|
||||
this.tcpClient = tcpClient;
|
||||
|
||||
closeWindow();
|
||||
LoadallChatKontakts();
|
||||
ErstelleContextMenue();
|
||||
SetChatSetting();*/
|
||||
}
|
||||
|
||||
private CompactSupportConceptDC HoleHilfeplanAusListe(List<CompactSupportConceptDC> scList, CompactCustomerDC customerCompact, DateTime firstTime, DateTime lastTime)
|
||||
{
|
||||
foreach (var sc in scList)
|
||||
{
|
||||
if (sc.Customer.Oid == customerCompact.Oid)
|
||||
{
|
||||
if (sc.StartDate.HasValue && sc.EndDate.HasValue && sc.StartDate <= lastTime &&
|
||||
sc.EndDate >= firstTime)
|
||||
{
|
||||
return sc;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void RootGroupBox_OnMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
DragMove();
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private DateTime ConvertToDateTimeStart(string startTime)
|
||||
{
|
||||
|
||||
return DateTime.Parse(startTime);
|
||||
}
|
||||
|
||||
private DateTime ConvertToDateTimeEnd(string endTime)
|
||||
{
|
||||
return DateTime.Parse(endTime);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,7 @@
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:view="clr-namespace:BeWo.View"
|
||||
Title="Chat View" Height="800" Width="800" WindowStartupLocation="CenterScreen" WindowStyle="None"
|
||||
Title="Chat View" Height="800" Width="800" WindowStartupLocation="CenterScreen" WindowStyle="None"
|
||||
AllowsTransparency="True"
|
||||
Background="Transparent"
|
||||
ResizeMode="NoResize">
|
||||
@@ -18,8 +18,17 @@
|
||||
</TextBox.Resources>
|
||||
</TextBox>
|
||||
|
||||
<TextBox x:Name="Chatbox" HorizontalAlignment="Left" Margin="204,720,0,10" TextWrapping="Wrap"
|
||||
VerticalContentAlignment="Center" Width="432" Height="25" ToolTip="Schreiben Sie hier eine Nachricht hinein" KeyDown="OnKeyDownHandler" GotFocus="OnFocus" Text="Nachricht schreiben" Foreground="DarkGray" >
|
||||
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<TextBox x:Name="Chatbox" HorizontalAlignment="Left" Margin="239,720,0,10" TextWrapping="Wrap" Text="Nachricht schreiben"
|
||||
VerticalContentAlignment="Center" Width="415" MinHeight="25" ToolTip="Schreiben Sie hier eine Nachricht hinein" KeyDown="OnKeyDownHandler" GotFocus="OnFocus" Foreground="DarkGray" >
|
||||
<TextBox.Resources>
|
||||
<Style TargetType="{x:Type Border}">
|
||||
<Setter Property="CornerRadius" Value="3"/>
|
||||
@@ -27,8 +36,11 @@
|
||||
</Style>
|
||||
</TextBox.Resources>
|
||||
</TextBox>
|
||||
|
||||
<ListBox x:Name="Chat" HorizontalAlignment="Left" Height="630" Margin="204,64,0,0" VerticalAlignment="Top" Width="581" VirtualizingStackPanel.IsVirtualizing="True" VirtualizingStackPanel.VirtualizationMode="Recycling" SelectionMode="Multiple" >
|
||||
|
||||
</Grid>
|
||||
<!-- -->
|
||||
|
||||
<ListBox x:Name="Chat" HorizontalAlignment="Left" Height="630" Margin="204,64,0,0" VerticalAlignment="Top" Width="581" VirtualizingStackPanel.IsVirtualizing="True" VirtualizingStackPanel.VirtualizationMode="Recycling" SelectionMode="Extended" MouseRightButtonDown="OnRightClickEvent" >
|
||||
<ListBox.ItemContainerStyle>
|
||||
<Style TargetType="ListBoxItem">
|
||||
<!--<Setter Property="IsEnabled" Value="False" />
|
||||
@@ -50,7 +62,7 @@
|
||||
<TextBlock Text="{Binding Username}" FontWeight="Bold" Width="150" TextAlignment="Left"/>
|
||||
<TextBlock Text="{Binding SendTime}" Margin="2" Width="350" HorizontalAlignment="Right" TextAlignment="Right"/>
|
||||
</WrapPanel>
|
||||
<TextBlock Text="{Binding UserMessage}" Width="500" TextWrapping="Wrap" VerticalAlignment="Center" />
|
||||
<TextBlock VerticalAlignment="Center" Text="{Binding UserMessage}" Width="500" TextWrapping="Wrap" />
|
||||
</DockPanel>
|
||||
</Border>
|
||||
</DataTemplate>
|
||||
@@ -59,21 +71,19 @@
|
||||
<ItemsPanelTemplate>
|
||||
<StackPanel VerticalAlignment="Bottom"/>
|
||||
</ItemsPanelTemplate>
|
||||
</ListBox.ItemsPanel>-->
|
||||
</ListBox.ItemsPanel> MouseRightButtonDown="OnRightClickEvent" MouseLeftButtonDown="OnLeftClickEvent" aus Textblock wird richtextbox-->
|
||||
</ListBox>
|
||||
|
||||
|
||||
|
||||
<!--###################################### Liste aller User mit Chat Berechtigung ######################################################-->
|
||||
|
||||
<ListView x:Name="Clientlist" HorizontalAlignment="Left" Height="680" Margin="10,64,0,0" VerticalAlignment="Top" Width="189" 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="190" SelectionChanged="ListBoxSelectedIndexChanged" Style="{DynamicResource ResourceKey=styleListBox}" ItemTemplate="{DynamicResource DataTemplate1}">
|
||||
<ListView.Resources>
|
||||
<DataTemplate x:Key="DataTemplate1">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="50"/>
|
||||
<ColumnDefinition Width="100"/>
|
||||
<ColumnDefinition Width="10"/>
|
||||
<ColumnDefinition Width="22"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<Ellipse Width='30' Height='30'>
|
||||
@@ -135,7 +145,7 @@
|
||||
|
||||
</Grid>
|
||||
</GroupBox>
|
||||
<!-- Online | Offline | Beschäftigt -->
|
||||
<!-- Online | Offline | Beschäftigt -->
|
||||
<ComboBox x:Name="StatusSetting" HorizontalAlignment="Left" Margin="17,53,0,0" VerticalAlignment="Top" Width="100" SelectionChanged="ComboBox_SelectionChanged"/>
|
||||
|
||||
<ListBox x:Name="AktChatUser" HorizontalAlignment="Left" Background="Transparent" BorderBrush="Transparent" Height="50" Margin="175,52,0,0" VerticalAlignment="Top" Width="365" ItemTemplate="{DynamicResource DataTemplate2}">
|
||||
@@ -166,10 +176,13 @@
|
||||
</ListBox>
|
||||
|
||||
|
||||
<Button Style="{DynamicResource IconButtonStyle}" x:Name="ButtonAlarmLabel" Background="Transparent" BorderBrush="Transparent" Click="ReConnect" HorizontalAlignment="Left" Height="20" Margin="725,10,0,0" VerticalAlignment="Top" Width="20" Visibility="Collapsed" >
|
||||
<Button Style="{DynamicResource IconButtonStyle}" x:Name="ButtonAlarmLabel" Background="Transparent" BorderBrush="Transparent" HorizontalAlignment="Left" Height="20" Margin="725,10,0,0" VerticalAlignment="Top" Width="20" Visibility="Collapsed" >
|
||||
<Image x:Name="AlarmLabel" ToolTip="Zurzeit nicht Verbunden" Source="" />
|
||||
</Button>
|
||||
|
||||
<Button HorizontalAlignment="Left" x:Name="EmojiButton" Margin="212,756,0,0" VerticalAlignment="Top" Width="25" Height="25" Click="SmileyButton_OnClick">
|
||||
<Image x:Name="Smiley" ToolTip="Zurzeit nicht zurechnungsfähig" Source="/BeWoPlaner;component/Ressources/Icons/trauriges-smiley.png" />
|
||||
</Button>
|
||||
<!-- -->
|
||||
</Grid>
|
||||
</Window>
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -54,7 +54,7 @@
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
<!--<ComboBox x:Name="customerComboBox" IsSynchronizedWithCurrentItem="True" AlternationCount="-1" ItemTemplate="{DynamicResource CustomerComboBoxItemTemplate}" SelectionChanged="customerComboBox_SelectionChanged" Height="62" ItemsPanel="{DynamicResource CustomerComboBoxItemsPanelTemplate}" Background="{DynamicResource SupportConceptListBrush}" HorizontalContentAlignment="Stretch" Style="{DynamicResource ObjectComboBoxStyle}" />-->
|
||||
<localViewControls:SingleSupportConceptSelectionControl x:Name="supportConceptSelectionControl"
|
||||
<localViewControls:SingleSupportConceptSelectionControl x:Name="supportConceptSelectionControl"
|
||||
ItemSelected="supportConceptSelectionControl_ItemSelected" Height="62" VerticalAlignment="Top"
|
||||
HorizontalContentAlignment="Stretch" />
|
||||
<!--Grid Grid.Row="1" Margin="0,0,0,0" >
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System.Collections.Generic;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Windows;
|
||||
using System.Windows.Input;
|
||||
|
||||
@@ -81,6 +82,23 @@ namespace BeWo.View.Detail
|
||||
public void InitView(ServiceRecordListVM pListViewModel, ServiceRecordVM pSCViewModel, bool hideCustomerCombo)
|
||||
{
|
||||
InitializeComponent();
|
||||
if (!hideCustomerCombo)
|
||||
{
|
||||
supportConceptSelectionControl.Loaded += (s, e) => SetSelectedCustomerNode();
|
||||
|
||||
combobox_services.SelectionChanged += (s, e) =>
|
||||
{
|
||||
if (combobox_services.SelectedIndex == -1)
|
||||
combobox_services.SelectedIndex = 0;
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
supportConceptSelectionControl.Visibility = Visibility.Collapsed;
|
||||
customerComboColumn.Width = new GridLength(0);
|
||||
}
|
||||
|
||||
|
||||
if (!BeWoApp.LoggedOnUser.HasRight(UserRightType.ServiceRecord_AllowCreationForOtherEmployees) && !BeWoApp.LoggedOnUser.HasRight(UserRightType.ServiceRecord_AllowCreationForOtherTeamMember))
|
||||
{
|
||||
lblEmployee.Visibility = Visibility.Collapsed;
|
||||
@@ -113,7 +131,7 @@ namespace BeWo.View.Detail
|
||||
FlatSupportConceptTreeNodeDC node = SupportConceptService.CreateFlatSupportConceptItem(pSCViewModel.SupportConcept, pSCViewModel.CostBearer);
|
||||
_OriginalNode = node;
|
||||
_ServiceRecordVM.ChoosenNode = node;
|
||||
supportConceptSelectionControl.SearchText = node.CustomerName;
|
||||
SetSearchText(node.CustomerName);
|
||||
}
|
||||
|
||||
if (BeWoApp.AppSettings.ShowMarker)
|
||||
@@ -138,21 +156,7 @@ namespace BeWo.View.Detail
|
||||
//pListViewModel.SelectedVMForEditing = clone;
|
||||
ViewModel = pListViewModel;
|
||||
|
||||
if (!hideCustomerCombo)
|
||||
{
|
||||
supportConceptSelectionControl.Loaded += (s, e) => SetSelectedCustomerNode();
|
||||
|
||||
combobox_services.SelectionChanged += (s, e) =>
|
||||
{
|
||||
if (combobox_services.SelectedIndex == -1)
|
||||
combobox_services.SelectedIndex = 0;
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
supportConceptSelectionControl.Visibility = Visibility.Collapsed;
|
||||
customerComboColumn.Width = new GridLength(0);
|
||||
}
|
||||
|
||||
|
||||
Focus();
|
||||
TextboxNotice.Focus();
|
||||
@@ -165,6 +169,24 @@ namespace BeWo.View.Detail
|
||||
isEndDateVisible();
|
||||
}
|
||||
|
||||
public void SetSearchText(string text)
|
||||
{
|
||||
supportConceptSelectionControl.SearchText = text;
|
||||
}
|
||||
|
||||
//public void SetStartTimeEndTime(DateTime start, DateTime end)
|
||||
//{
|
||||
// startTime.Text = start.TimeOfDay.ToString();
|
||||
// endTime.Text = end.TimeOfDay.ToString();
|
||||
// //popupedit_employee
|
||||
|
||||
//}
|
||||
|
||||
public void SetLoggedOnEmployee()
|
||||
{
|
||||
popupedit_employee.Text = BeWoApp.LoggedOnUser.Employee.ToString();
|
||||
}
|
||||
|
||||
private void isEndDateVisible()
|
||||
{
|
||||
|
||||
@@ -296,8 +318,15 @@ namespace BeWo.View.Detail
|
||||
|
||||
var list = new List<ServiceRecordDC> {lDC};
|
||||
|
||||
ServiceFacade.DoOperationsServiceSync(s => s.UpdateServiceRecords(list));
|
||||
|
||||
if (lDC.ServiceRecordOid.HasValue)
|
||||
{
|
||||
ServiceFacade.DoOperationsServiceSync(s => s.UpdateServiceRecords(list));
|
||||
}
|
||||
else
|
||||
{
|
||||
ServiceFacade.DoOperationsServiceSync(s => s.InsertNewServiceRecords(list));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -426,5 +455,23 @@ namespace BeWo.View.Detail
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//public void initViewforChat(/*long? employeeOid*/long? mitoid,string stime)
|
||||
//{
|
||||
// InitializeComponent();
|
||||
|
||||
// //ServiceRecordVM SRVM;
|
||||
|
||||
|
||||
|
||||
// // ita.SingleOrDefault(r => r.EmpfaengerOid == idKlientspeicher[0] && r.TypeChat == ChatType.Klienten
|
||||
// //popupedit_employee.;
|
||||
// popupedit_employee.Text = BeWoApp.LoggedOnUser.Employee.ToString();
|
||||
|
||||
// // supportConceptSelectionControl.SetValue();
|
||||
// // startTime.Text = stime;
|
||||
// //SetSelectedSupportConceptOid(21);
|
||||
|
||||
//}
|
||||
}
|
||||
}
|
||||
@@ -207,7 +207,7 @@
|
||||
</TextBlock>
|
||||
|
||||
<!-- ########################################## Achtung Chat Verlinkung ########################################################################################### -->
|
||||
<TextBlock x:Name="txtChangePassword2" VerticalAlignment="Center" Foreground="{DynamicResource MainGroupBoxForegroundBrush}" Margin="5,3,3,3">
|
||||
<TextBlock x:Name="BewoChat" VerticalAlignment="Center" Foreground="{DynamicResource MainGroupBoxForegroundBrush}" Margin="5,3,3,3">
|
||||
<Hyperlink RequestNavigate="ChatLinkOnRequestNavigate" NavigateUri="#" Foreground="{DynamicResource MainGroupBoxForegroundBrush}">
|
||||
<TextBlock Text="BeWo Chat" HorizontalAlignment="Center" Foreground="{DynamicResource MainGroupBoxForegroundBrush}" FontSize="12" VerticalAlignment="Center" />
|
||||
</Hyperlink>
|
||||
|
||||
@@ -32,11 +32,22 @@ using DevExpress.Xpf.Core;
|
||||
using DevExpress.Xpf.Editors.Helpers;
|
||||
using System.Net.Sockets;
|
||||
using System.Collections;
|
||||
using System.Drawing;
|
||||
using System.IO;
|
||||
using System.Net;
|
||||
using System.Text;
|
||||
|
||||
using System.Windows.Forms;
|
||||
using BS.Shared.Core;
|
||||
using Newtonsoft.Json;
|
||||
using Brushes = System.Windows.Media.Brushes;
|
||||
using Button = System.Windows.Controls.Button;
|
||||
using Color = System.Windows.Media.Color;
|
||||
using Control = System.Windows.Controls.Control;
|
||||
using Image = System.Windows.Controls.Image;
|
||||
using ListBox = System.Windows.Controls.ListBox;
|
||||
using MessageBox = System.Windows.MessageBox;
|
||||
using ScrollBar = System.Windows.Controls.Primitives.ScrollBar;
|
||||
using TextBox = System.Windows.Controls.TextBox;
|
||||
|
||||
namespace BeWo.View
|
||||
{
|
||||
@@ -53,14 +64,18 @@ namespace BeWo.View
|
||||
protected TextBox ServerStats = new TextBox();
|
||||
protected TextBox chat = new TextBox();
|
||||
|
||||
protected MiniChatView pav;
|
||||
protected ChatView chatpav;
|
||||
protected MiniChatView miniChatView = null;
|
||||
protected ChatView chatView = null;
|
||||
|
||||
Dictionary<long, MiniChatView> pavlist = new Dictionary<long, MiniChatView>();
|
||||
Dictionary<long, MiniChatView> miniChatViewList = new Dictionary<long, MiniChatView>();
|
||||
|
||||
//---- änderungen ----
|
||||
Dictionary<long, Packet> SaveAnkommendeServerMeldungen = new Dictionary<long, Packet>();
|
||||
protected long zaehler = 1;
|
||||
//--------------------
|
||||
|
||||
|
||||
|
||||
//Neue Version : Version 0.75
|
||||
//Neue Version : Version 0.80
|
||||
public TcpClient clientSocket = new TcpClient();
|
||||
NetworkStream serverStream;
|
||||
protected Thread asx;
|
||||
@@ -69,6 +84,8 @@ namespace BeWo.View
|
||||
|
||||
protected bool threadstop = false;
|
||||
|
||||
protected bool berechtigt = false;
|
||||
|
||||
//################################################################
|
||||
|
||||
public HomeDragPanelView()
|
||||
@@ -106,12 +123,26 @@ namespace BeWo.View
|
||||
MessageBox.Show("Verbindung geglückt.", "Info", MessageBoxButton.OK,MessageBoxImage.Information);
|
||||
});*/
|
||||
|
||||
asx = new Thread(ConnectWithServer);
|
||||
asx.Start();
|
||||
|
||||
chatpav = new ChatView("BeWo Chat", chat.Text, clientSocket);
|
||||
var berechtigung = ServiceFacade.DoEmployeeServiceSync(s => s.GetAllChatActiveEmployeesCompact());
|
||||
foreach (var list in berechtigung)
|
||||
{
|
||||
if (list.PersonOid == BeWoApp.LoggedOnUser.Employee.PersonOid)
|
||||
{
|
||||
berechtigt = true;
|
||||
}
|
||||
}
|
||||
|
||||
chatpav.Visibility = Visibility.Collapsed;
|
||||
|
||||
if (berechtigt)
|
||||
{
|
||||
asx = new Thread(ConnectWithServer);
|
||||
asx.Start();
|
||||
}
|
||||
else
|
||||
{
|
||||
BewoChat.Visibility = Visibility.Hidden;
|
||||
}
|
||||
}
|
||||
|
||||
private void PreparePanels()
|
||||
@@ -1167,9 +1198,57 @@ namespace BeWo.View
|
||||
|
||||
private void ChatLinkOnRequestNavigate(object sender, RequestNavigateEventArgs e)
|
||||
{
|
||||
chatpav.Visibility = Visibility.Visible;
|
||||
chatpav.AktualisiereChatKontakt();
|
||||
|
||||
if (chatView == null) //#################### neu ########## <--
|
||||
{
|
||||
chatView = new ChatView("BeWo Chat", chat.Text, clientSocket);
|
||||
|
||||
if (clientSocket.Connected)
|
||||
{
|
||||
Dispatcher.Invoke(
|
||||
DispatcherPriority.Normal,
|
||||
(ThreadStart) delegate
|
||||
{
|
||||
chatView.SetServerStats("Verbunden");
|
||||
|
||||
chatView.StatusSetting.SelectedIndex = 0;
|
||||
chatView.ButtonAlarmLabel.Visibility = Visibility.Collapsed;
|
||||
});
|
||||
|
||||
if (SaveAnkommendeServerMeldungen.Count > 0)
|
||||
{
|
||||
foreach (var dateiverarbeitung in SaveAnkommendeServerMeldungen)
|
||||
{
|
||||
ChatBuilder(dateiverarbeitung.Value);
|
||||
}
|
||||
|
||||
SaveAnkommendeServerMeldungen.Clear();
|
||||
zaehler = 1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Dispatcher.Invoke(
|
||||
DispatcherPriority.Normal,
|
||||
(ThreadStart) delegate
|
||||
{
|
||||
chatView.SetServerStats("Zurzeit nicht Verbunden");
|
||||
chatView.StatusSetting.SelectedIndex = 1;
|
||||
});
|
||||
}
|
||||
chatView.Visibility = Visibility.Visible;
|
||||
} //#################### neu ########## <--
|
||||
else
|
||||
{
|
||||
if(chatView.Visibility == Visibility.Collapsed){
|
||||
chatView.Visibility = Visibility.Visible;
|
||||
chatView.AktualisiereChatKontakt();
|
||||
chatView.Activate();
|
||||
}
|
||||
else
|
||||
{
|
||||
chatView.Visibility = Visibility.Collapsed;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1262,42 +1341,34 @@ namespace BeWo.View
|
||||
}
|
||||
}
|
||||
|
||||
//################################## Connection with Server ##########################
|
||||
//####### Connection with Server ###########
|
||||
private void ConnectWithServer()
|
||||
{
|
||||
try
|
||||
{
|
||||
Dispatcher.Invoke(
|
||||
DispatcherPriority.Normal,
|
||||
(ThreadStart) delegate
|
||||
{
|
||||
chatpav.SetServerStats("Zurzeit nicht Verbunden");
|
||||
chatpav.StatusSetting.SelectedIndex = 1;
|
||||
});
|
||||
|
||||
var test = BeWoApp.SiteOfOrigin;
|
||||
|
||||
//var ipAdresse = "app4.bewoplaner.de"; // "138.201.22.81"; //3 |9
|
||||
|
||||
//var ipAdresse = test; // "138.201.22.81"; //3 |9
|
||||
{
|
||||
var ipAdresse = "192.168.1.109"; //3 |9 || 192.168.1.103"app4.bewoplaner.de"
|
||||
var port = 5000;
|
||||
|
||||
clientSocket.Connect(test.Host, port);
|
||||
var uri = BeWoApp.SiteOfOrigin;
|
||||
|
||||
clientSocket.Connect(uri.Host, port);
|
||||
|
||||
Dispatcher.Invoke(
|
||||
DispatcherPriority.Normal,
|
||||
(ThreadStart) delegate
|
||||
{
|
||||
chatpav.SetServerStats("Verbunden");
|
||||
|
||||
chatpav.ButtonAlarmLabel.Visibility = Visibility.Collapsed;
|
||||
|
||||
if (isReconnect)
|
||||
if (chatView != null)
|
||||
{
|
||||
MessageBox.Show("Die Verbindung konnte wieder Hergestellt werden. ", "", MessageBoxButton.OK);
|
||||
}
|
||||
chatView.SetServerStats("Verbunden");
|
||||
|
||||
isReconnect = false;
|
||||
chatView.ButtonAlarmLabel.Visibility = Visibility.Collapsed;
|
||||
|
||||
if (isReconnect)
|
||||
{
|
||||
// MessageBox.Show("Die Verbindung konnte wieder Hergestellt werden. ", "", MessageBoxButton.OK);
|
||||
}
|
||||
|
||||
isReconnect = false;
|
||||
}
|
||||
});
|
||||
|
||||
Thread prf = new Thread(PruefeServerDisconection);
|
||||
@@ -1313,19 +1384,24 @@ namespace BeWo.View
|
||||
if (!isReconnect)
|
||||
MessageBox.Show("Verbindung zum Chat-Server konnte nicht aufgebaut werden.", "Fehler: 2010 ",
|
||||
MessageBoxButton.OK);
|
||||
|
||||
if(!threadstop){
|
||||
Dispatcher.Invoke(
|
||||
DispatcherPriority.Normal,
|
||||
(ThreadStart) delegate
|
||||
{
|
||||
if (chatView != null)
|
||||
{
|
||||
chatView.StatusSetting.SelectedIndex = 1;
|
||||
chatView.setConnectionLostIcon();
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
Dispatcher.Invoke(
|
||||
DispatcherPriority.Normal,
|
||||
(ThreadStart) delegate
|
||||
{
|
||||
|
||||
chatpav.StatusSetting.SelectedIndex = 1;
|
||||
chatpav.setConnectionLostIcon();
|
||||
});
|
||||
|
||||
Thread.Sleep(5000);
|
||||
|
||||
ReConnectAfterLoseConnection();
|
||||
Thread.Sleep(5000);
|
||||
|
||||
ReConnectAfterLoseConnection();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1345,21 +1421,11 @@ namespace BeWo.View
|
||||
|
||||
serverStream.Write(outStream, 0, outStream.Length);
|
||||
serverStream.Flush();
|
||||
|
||||
Dispatcher.Invoke(
|
||||
DispatcherPriority.Normal,
|
||||
(ThreadStart)delegate
|
||||
{
|
||||
|
||||
chatpav.StatusSetting.SelectedIndex = 0;
|
||||
|
||||
});
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
MessageBox.Show("Anmeldung am Server zurzeit nicht möglich.", "Fehler: 2020 ", MessageBoxButton.OK);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1379,99 +1445,32 @@ namespace BeWo.View
|
||||
|
||||
ErhalteDatenFromString(data);
|
||||
|
||||
long persoid = messagePaket.SenderPersonOid;
|
||||
|
||||
|
||||
if (persoid != 0)
|
||||
if (chatView == null)
|
||||
{
|
||||
|
||||
List<long> x = new List<long>();
|
||||
x.Add(messagePaket.SenderPersonOid);
|
||||
|
||||
var person = ServiceFacade.DoCustomerServiceSync(s => s.GetPersonsById(x));
|
||||
|
||||
switch (messagePaket.DataIdentifier)
|
||||
{
|
||||
case DataIdentifier.StatusNotificationLoginBroadcast:
|
||||
|
||||
String[] oids = messagePaket.ChatMessage.Split(',');
|
||||
|
||||
foreach (var oid in oids)
|
||||
{
|
||||
int result = Convert.ToInt32(oid);
|
||||
if (!chatpav.CompareWithListItem(result))
|
||||
{
|
||||
ErstelleChatViews(result);
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case DataIdentifier.StatusNotificationLogin:
|
||||
|
||||
if (!chatpav.CompareWithListItem(persoid))
|
||||
{
|
||||
ErstelleChatViews(persoid);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case DataIdentifier.StatusNotificationBeschäftigt:
|
||||
|
||||
if (chatpav.CompareWithListItem(persoid))
|
||||
{
|
||||
AktualisiereStatus(persoid, messagePaket.DataIdentifier);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case DataIdentifier.StatusNotificationOnline:
|
||||
|
||||
if (chatpav.CompareWithListItem(persoid))
|
||||
{
|
||||
AktualisiereStatus(persoid, messagePaket.DataIdentifier);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case DataIdentifier.StatusNotificationOffline:
|
||||
|
||||
if (chatpav.CompareWithListItem(persoid))
|
||||
{
|
||||
AktualisiereStatus(persoid, messagePaket.DataIdentifier);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case DataIdentifier.StatusNotificationLogout:
|
||||
|
||||
DeleteLoggedOffUsers(person[0].FirstName + " " + person[0].LastName, persoid);
|
||||
|
||||
break;
|
||||
|
||||
case DataIdentifier.Message:
|
||||
|
||||
UebergebeNachricht(messagePaket.ChatMessage, person[0].FirstName + " " + person[0].LastName,
|
||||
persoid, messagePaket.DataIdentifier, messagePaket.RecipientPersonOid);
|
||||
|
||||
break;
|
||||
|
||||
case DataIdentifier.Team:
|
||||
|
||||
UebergebeNachricht(messagePaket.ChatMessage, person[0].FirstName + " " + person[0].LastName,
|
||||
persoid, messagePaket.DataIdentifier, messagePaket.RecipientPersonOid);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
WaitForMsFromServer();
|
||||
|
||||
//#### Bei Fehlern alter Code wieder Hinzufügen
|
||||
//#### und Switch/Case dann weg.
|
||||
//######################################
|
||||
SaveAnkommendeServerMeldungen.Add(zaehler, messagePaket); // muss noch ordnungsgemäß gesetzt werden
|
||||
zaehler++;
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
if (SaveAnkommendeServerMeldungen.Count > 0)
|
||||
{
|
||||
foreach (var dateiverarbeitung in SaveAnkommendeServerMeldungen)
|
||||
{
|
||||
ChatBuilder(dateiverarbeitung.Value);
|
||||
}
|
||||
|
||||
SaveAnkommendeServerMeldungen.Clear();
|
||||
zaehler = 1;
|
||||
WaitForMsFromServer();
|
||||
}
|
||||
else
|
||||
{
|
||||
ChatBuilder(messagePaket);
|
||||
zaehler = 1;
|
||||
WaitForMsFromServer();
|
||||
}
|
||||
//original
|
||||
}
|
||||
WaitForMsFromServer();
|
||||
}
|
||||
}
|
||||
@@ -1483,6 +1482,102 @@ namespace BeWo.View
|
||||
}
|
||||
}
|
||||
|
||||
public void ChatBuilder(Packet paket)
|
||||
{
|
||||
try
|
||||
{
|
||||
long persoid = paket.SenderPersonOid;
|
||||
|
||||
if (persoid != 0)
|
||||
{
|
||||
|
||||
List<long> x = new List<long>();
|
||||
x.Add(paket.SenderPersonOid);
|
||||
|
||||
var person = ServiceFacade.DoCustomerServiceSync(s => s.GetPersonsById(x));
|
||||
|
||||
switch (paket.DataIdentifier)
|
||||
{
|
||||
case DataIdentifier.StatusNotificationLoginBroadcast:
|
||||
|
||||
String[] oids = paket.ChatMessage.Split(',');
|
||||
|
||||
foreach (var oid in oids)
|
||||
{
|
||||
int result = Convert.ToInt32(oid);
|
||||
if (!chatView.CompareWithListItem(result))
|
||||
{
|
||||
ErstelleChatViews(result);
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case DataIdentifier.StatusNotificationLogin:
|
||||
|
||||
if (!chatView.CompareWithListItem(persoid))
|
||||
{
|
||||
ErstelleChatViews(persoid);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case DataIdentifier.StatusNotificationBeschäftigt:
|
||||
|
||||
if (chatView.CompareWithListItem(persoid))
|
||||
{
|
||||
AktualisiereStatus(persoid, paket.DataIdentifier);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case DataIdentifier.StatusNotificationOnline:
|
||||
|
||||
if (chatView.CompareWithListItem(persoid))
|
||||
{
|
||||
AktualisiereStatus(persoid, paket.DataIdentifier);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case DataIdentifier.StatusNotificationOffline:
|
||||
|
||||
if (chatView.CompareWithListItem(persoid))
|
||||
{
|
||||
AktualisiereStatus(persoid, paket.DataIdentifier);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case DataIdentifier.StatusNotificationLogout:
|
||||
|
||||
DeleteLoggedOffUsers(person[0].FirstName + " " + person[0].LastName, persoid);
|
||||
|
||||
break;
|
||||
|
||||
case DataIdentifier.Message:
|
||||
|
||||
UebergebeNachricht(paket.ChatMessage, person[0].FirstName + " " + person[0].LastName,
|
||||
persoid, paket.DataIdentifier, paket.RecipientPersonOid);
|
||||
|
||||
break;
|
||||
|
||||
case DataIdentifier.Team:
|
||||
|
||||
UebergebeNachricht(paket.ChatMessage, person[0].FirstName + " " + person[0].LastName,
|
||||
persoid, paket.DataIdentifier, paket.RecipientPersonOid);
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception edf)
|
||||
{
|
||||
MessageBox.Show("Beim Sortieren von Nachrichten ist ein Fehler aufgetreten. " + edf.Message + "\n" + edf.StackTrace , "Fehler",
|
||||
MessageBoxButton.OK);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public void ErhalteDatenFromString(String message)
|
||||
{
|
||||
@@ -1503,7 +1598,7 @@ namespace BeWo.View
|
||||
{
|
||||
try
|
||||
{
|
||||
chatpav.SetUserBeschäftigt(oid,type);
|
||||
chatView.SetUserBeschäftigt(oid, type);
|
||||
}
|
||||
catch (Exception edf)
|
||||
{
|
||||
@@ -1516,7 +1611,7 @@ namespace BeWo.View
|
||||
{
|
||||
try
|
||||
{
|
||||
if(chatpav.CompareWithListItem(oid))
|
||||
if (chatView.CompareWithListItem(oid))
|
||||
{
|
||||
DeleteLoggedOffUsers(name,oid);
|
||||
}
|
||||
@@ -1536,86 +1631,81 @@ namespace BeWo.View
|
||||
DispatcherPriority.Normal,
|
||||
(ThreadStart) delegate
|
||||
{
|
||||
if (pavlist.ContainsKey(personoid) && team != DataIdentifier.Team)
|
||||
if (miniChatViewList.ContainsKey(personoid) && team != DataIdentifier.Team)
|
||||
{
|
||||
if (chatpav.AktChatUser.Items.Count > 0)
|
||||
if (chatView.AktChatUser.Items.Count > 0)
|
||||
{
|
||||
KontaktlistBuilder curItem = (KontaktlistBuilder)chatpav.AktChatUser.Items[0];
|
||||
KontaktlistBuilder curItem = (KontaktlistBuilder)chatView.AktChatUser.Items[0];
|
||||
|
||||
if (chatpav.Visibility == Visibility.Collapsed &&
|
||||
pavlist[personoid].Visibility == Visibility.Collapsed)
|
||||
if (chatView.Visibility == Visibility.Collapsed &&
|
||||
miniChatViewList[personoid].Visibility == Visibility.Collapsed)
|
||||
{
|
||||
pavlist[personoid].Visibility = Visibility.Visible;
|
||||
pavlist[personoid].SetText(text, 1);
|
||||
miniChatViewList[personoid].Visibility = Visibility.Visible;
|
||||
miniChatViewList[personoid].SetText(text, 1);
|
||||
}
|
||||
else if (pavlist[personoid].Visibility == Visibility.Collapsed && chatpav.Visibility == Visibility.Visible && curItem.EmpfaengerOid.Equals(personoid))
|
||||
else if (miniChatViewList[personoid].Visibility == Visibility.Collapsed && chatView.Visibility == Visibility.Visible && curItem.EmpfaengerOid.Equals(personoid))
|
||||
{
|
||||
chatpav.SetText(text, name, personoid);
|
||||
chatView.SetText(text, name, personoid);
|
||||
}
|
||||
else if (pavlist[personoid].Visibility == Visibility.Collapsed && !curItem.EmpfaengerOid.Equals(personoid))
|
||||
else if (miniChatViewList[personoid].Visibility == Visibility.Collapsed && !curItem.EmpfaengerOid.Equals(personoid))
|
||||
{
|
||||
pavlist[personoid].Visibility = Visibility.Visible;
|
||||
pavlist[personoid].SetText(text, 1);
|
||||
miniChatViewList[personoid].Visibility = Visibility.Visible;
|
||||
miniChatViewList[personoid].SetText(text, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
pavlist[personoid].AppendTextwhileViewOpen(text, 1);
|
||||
miniChatViewList[personoid].AppendTextwhileViewOpen(text, 1);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (chatpav.Visibility == Visibility.Collapsed &&
|
||||
pavlist[personoid].Visibility == Visibility.Collapsed)
|
||||
if (chatView.Visibility == Visibility.Collapsed &&
|
||||
miniChatViewList[personoid].Visibility == Visibility.Collapsed)
|
||||
{
|
||||
pavlist[personoid].Visibility = Visibility.Visible;
|
||||
pavlist[personoid].SetText(text, 1);
|
||||
miniChatViewList[personoid].Visibility = Visibility.Visible;
|
||||
miniChatViewList[personoid].SetText(text, 1);
|
||||
}
|
||||
else if (pavlist[personoid].Visibility == Visibility.Collapsed && chatpav.Visibility == Visibility.Visible)
|
||||
else if (miniChatViewList[personoid].Visibility == Visibility.Collapsed && chatView.Visibility == Visibility.Visible)
|
||||
{
|
||||
pavlist[personoid].Visibility = Visibility.Visible;
|
||||
pavlist[personoid].SetText(text, 1);
|
||||
miniChatViewList[personoid].Visibility = Visibility.Visible;
|
||||
miniChatViewList[personoid].SetText(text, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
pavlist[personoid].AppendTextwhileViewOpen(text, 1);
|
||||
miniChatViewList[personoid].AppendTextwhileViewOpen(text, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (chatpav.AktChatUser.Items.Count > 0)
|
||||
if (chatView.AktChatUser.Items.Count > 0)
|
||||
{
|
||||
KontaktlistBuilder curItem = (KontaktlistBuilder) chatpav.AktChatUser.Items[0];
|
||||
KontaktlistBuilder curItem = (KontaktlistBuilder)chatView.AktChatUser.Items[0];
|
||||
|
||||
if (team == DataIdentifier.Team && curItem.TypeChat == ChatType.Team && curItem.EmpfaengerOid.Equals(empfaenger))
|
||||
{
|
||||
var zugehorigkeit = ServiceFacade.DoEmployeeServiceSync(s => s.GetTeamOidsByEmployee(personoid));
|
||||
var zugehorigkeit = ServiceFacade.DoEmployeeServiceSync(s => s.GetTeamOidsByEmployee(BeWoApp.LoggedOnUser.Employee.PersonOid));
|
||||
|
||||
foreach (var dc in zugehorigkeit)
|
||||
{
|
||||
if (dc.TeamOid == curItem.EmpfaengerOid)
|
||||
{
|
||||
chatpav.SetText(text, name, dc.TeamOid);
|
||||
chatView.SetText(text, name, dc.TeamOid);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(team == DataIdentifier.Team && (!curItem.EmpfaengerOid.Equals(empfaenger)))
|
||||
{
|
||||
var zugehorigkeit = ServiceFacade.DoEmployeeServiceSync(s => s.GetTeamOidsByEmployee(personoid));
|
||||
var zugehorigkeit = ServiceFacade.DoEmployeeServiceSync(s => s.GetTeamOidsByEmployee(BeWoApp.LoggedOnUser.Employee.PersonOid));
|
||||
|
||||
foreach (var dc in zugehorigkeit)
|
||||
{
|
||||
if (dc.TeamOid == empfaenger)
|
||||
{
|
||||
chatpav.SetTeamAnzahlErhalteneNachricht(dc.TeamOid, ChatType.Team);
|
||||
chatView.SetTeamAnzahlErhalteneNachricht(dc.TeamOid, ChatType.Team);
|
||||
}
|
||||
}
|
||||
}
|
||||
/* else
|
||||
{
|
||||
if (curItem.EmpfaengerOid.Equals(personoid))
|
||||
chatpav.SetText(text, name, personoid);
|
||||
}*/
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -1627,7 +1717,6 @@ namespace BeWo.View
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void DeleteLoggedOffUsers(String personname,long personoid)
|
||||
{
|
||||
try
|
||||
@@ -1636,10 +1725,10 @@ namespace BeWo.View
|
||||
DispatcherPriority.Normal,
|
||||
(ThreadStart)delegate
|
||||
{
|
||||
chatpav.RemoveListItem(personoid);
|
||||
chatpav.SetServerStats(personname + " Disconnected ! ");
|
||||
|
||||
pavlist.Remove(personoid);
|
||||
chatView.RemoveListItem(personoid);
|
||||
chatView.SetServerStats(personname + " Disconnected ! ");
|
||||
|
||||
miniChatViewList.Remove(personoid);
|
||||
|
||||
|
||||
});
|
||||
@@ -1650,6 +1739,27 @@ namespace BeWo.View
|
||||
}
|
||||
}
|
||||
|
||||
public void ÜbergebeEmojiAnChatView(String Emojicode, String EmojiPfad)
|
||||
{
|
||||
try
|
||||
{
|
||||
Dispatcher.Invoke(
|
||||
DispatcherPriority.Normal,
|
||||
(ThreadStart)delegate
|
||||
{
|
||||
chatView.Chatbox.Focus();
|
||||
chatView.Chatbox.Text += " " + Emojicode ;
|
||||
//chatView.Chatbox.Controls.Add(pic);
|
||||
chatView.Chatbox.SelectionStart = chatView.Chatbox.Text.Length;
|
||||
});
|
||||
}
|
||||
catch (Exception edf)
|
||||
{
|
||||
MessageBox.Show("Es ist ein Fehler aufgetreten, bei dem versucht wurde User aus der Onlineanzeige zu entfernen", "Fehler: ", MessageBoxButton.OK);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void PruefeServerDisconection()
|
||||
{
|
||||
@@ -1659,23 +1769,32 @@ namespace BeWo.View
|
||||
{
|
||||
if (clientSocket.Connected == false)
|
||||
{
|
||||
MessageBox.Show("Die verbindung zum Server wurde seitens dem Server unterbrochen", "Info", MessageBoxButton.OK);
|
||||
clientSocket.Close();
|
||||
|
||||
if (!threadstop)
|
||||
{
|
||||
MessageBox.Show("Die verbindung zum Server wurde seitens dem Server unterbrochen", "Info", MessageBoxButton.OK);
|
||||
clientSocket.Client.Disconnect(true);
|
||||
clientSocket.Client.Close();
|
||||
clientSocket = null;
|
||||
clientSocket = new TcpClient();
|
||||
|
||||
|
||||
this.Dispatcher.BeginInvoke(
|
||||
DispatcherPriority.Normal,
|
||||
(Action) delegate
|
||||
{
|
||||
chatpav.ButtonAlarmLabel.Visibility = Visibility.Visible;
|
||||
chatpav.SetAllUserOfflineIfNoInet();
|
||||
{
|
||||
if(chatView != null){
|
||||
chatView.UpdateTcp(clientSocket);
|
||||
chatView.ButtonAlarmLabel.Visibility = Visibility.Visible;
|
||||
chatView.SetAllUserOfflineIfNoInet();
|
||||
|
||||
chatpav.StatusSetting.SelectedIndex = 1;
|
||||
chatpav.SetServerStats("Verbindung zum Server Unterbrochen");
|
||||
});
|
||||
|
||||
if (!threadstop)
|
||||
chatView.StatusSetting.SelectedIndex = 1;
|
||||
chatView.SetServerStats("Verbindung zum Server Unterbrochen");
|
||||
}
|
||||
});
|
||||
|
||||
ReConnectAfterLoseConnection();
|
||||
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -1685,30 +1804,30 @@ namespace BeWo.View
|
||||
MessageBox.Show("Es ist ein Fehler mit der Verbindung aufgetreten", "Fehler: 2080 ", MessageBoxButton.OK);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
private void ReConnectAfterLoseConnection()
|
||||
{
|
||||
try
|
||||
{
|
||||
if (clientSocket.Connected == false)
|
||||
{
|
||||
if (clientSocket.Connected)
|
||||
{
|
||||
isReconnect = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
asx = new Thread(ConnectWithServer);
|
||||
asx.Start();
|
||||
isReconnect = true;
|
||||
}
|
||||
}
|
||||
if (clientSocket.Client != null)
|
||||
{
|
||||
if (clientSocket.Client.Connected)
|
||||
{
|
||||
isReconnect = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
asx = new Thread(ConnectWithServer);
|
||||
asx.Start();
|
||||
isReconnect = true;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
MessageBox.Show("Fehler, Siehe fehlercode", "Fehler: 2120 ", MessageBoxButton.OK);
|
||||
MessageBox.Show("Fehler, Siehe fehlercode."+ e.Message + "\n" + e.StackTrace , "Fehler: 2120 ", MessageBoxButton.OK);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1725,20 +1844,21 @@ namespace BeWo.View
|
||||
x.Add(personOid);
|
||||
|
||||
var person = ServiceFacade.DoCustomerServiceSync(s => s.GetPersonsById(x));
|
||||
|
||||
chatpav.SetList(person[0].FirstName + " " + person[0].LastName, personOid);
|
||||
chatpav.SetServerStats(person[0].FirstName + " " + person[0].LastName + " Connected");
|
||||
|
||||
chatView.SetList(person[0].FirstName + " " + person[0].LastName, personOid);
|
||||
chatView.SetServerStats(person[0].FirstName + " " + person[0].LastName + " Connected");
|
||||
|
||||
if(person[0].Type == PersonType.Customer)
|
||||
pav = new MiniChatView(person[0].FirstName + " " + person[0].LastName, "", chatpav, personOid, ChatType.Klienten);
|
||||
miniChatView = new MiniChatView(person[0].FirstName + " " + person[0].LastName, "", chatView, personOid, ChatType.Klienten);
|
||||
else if (person[0].Type == PersonType.Employee)
|
||||
pav = new MiniChatView(person[0].FirstName + " " + person[0].LastName, "", chatpav, personOid,ChatType.Mitarbeiter);
|
||||
miniChatView = new MiniChatView(person[0].FirstName + " " + person[0].LastName, "", chatView, personOid, ChatType.Mitarbeiter);
|
||||
else if(person[0].Type == PersonType.Others)
|
||||
pav = new MiniChatView(person[0].FirstName + " " + person[0].LastName, "", chatpav, personOid, ChatType.Team);
|
||||
miniChatView = new MiniChatView(person[0].FirstName + " " + person[0].LastName, "", chatView, personOid, ChatType.Team);
|
||||
|
||||
pav.Visibility = Visibility.Collapsed;
|
||||
miniChatView.Visibility = Visibility.Collapsed;
|
||||
|
||||
pavlist.Add(personOid, pav);
|
||||
if(!miniChatViewList.ContainsKey(personOid))
|
||||
miniChatViewList.Add(personOid, miniChatView);
|
||||
});
|
||||
}
|
||||
catch (Exception e)
|
||||
@@ -1753,6 +1873,7 @@ namespace BeWo.View
|
||||
{
|
||||
if (clientSocket != null)
|
||||
{
|
||||
threadstop = true;
|
||||
clientSocket.Close();
|
||||
}
|
||||
|
||||
@@ -1761,48 +1882,26 @@ namespace BeWo.View
|
||||
serverStream.Close();
|
||||
}
|
||||
|
||||
if (asx.IsAlive)
|
||||
if (asx != null)
|
||||
{
|
||||
asx.Join();
|
||||
asx = null;
|
||||
if (asx.IsAlive)
|
||||
{
|
||||
asx.Join();
|
||||
// asx.Abort();
|
||||
asx = null;
|
||||
|
||||
threadstop = true;
|
||||
}
|
||||
threadstop = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
catch (Exception edf)
|
||||
{
|
||||
MessageBox.Show("Beim Versuch ,die verbindung mit dem Server zu trennen, ist ein Fehler unterlaufen ", "Fehler: 2100 ", MessageBoxButton.OK);
|
||||
MessageBox.Show("Beim Versuch ,die verbindung mit dem Server zu trennen, ist ein Fehler unterlaufen. " + edf.Message +"\n"+edf.StackTrace, "Fehler: 2100 ", MessageBoxButton.OK);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void ReconnectServer()
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!clientSocket.Connected)
|
||||
{
|
||||
asx = new Thread(ConnectWithServer);
|
||||
asx.Start();
|
||||
isReconnect = true;
|
||||
}
|
||||
|
||||
if (clientSocket.Connected)
|
||||
{
|
||||
this.Dispatcher.BeginInvoke(
|
||||
DispatcherPriority.Normal,
|
||||
(Action) delegate
|
||||
{
|
||||
chatpav.ButtonAlarmLabel.Visibility = Visibility.Collapsed;
|
||||
});
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
MessageBox.Show("Beim Versuch ,die verbindung erneut aufzubauen, ist ein Fehler unterlaufen ", "Fehler: 2110 ", MessageBoxButton.OK);
|
||||
}
|
||||
}
|
||||
//---------------------------------------------------------------------------------------------------------------------------
|
||||
//---------------------------------------------------------------------------------------------------------------------------
|
||||
}
|
||||
|
||||
public class TaskDateDescriptionConverter : IValueConverter
|
||||
|
||||
@@ -1595,6 +1595,7 @@ namespace BeWo.ViewModel
|
||||
pDataContract.Medication = _Medication;
|
||||
pDataContract.Environment = _Environment;
|
||||
pDataContract.AssessmentSheetCategoryDCs = _AssessmentSheetCategories.Where(i => i.IsSelected).ToList();
|
||||
pDataContract.Type = PersonType.Customer;
|
||||
|
||||
if(_Medikamentenverordnungslisten != null)
|
||||
{
|
||||
|
||||
@@ -1173,8 +1173,8 @@ namespace BeWo.ViewModel
|
||||
pDataContract.Notice2 = _Notice2;
|
||||
pDataContract.EmployeeColor = _EmployeeColor;
|
||||
pDataContract.EmployeeImage = _EmployeeImage;
|
||||
|
||||
pDataContract.ActivationType = _IsArchived ? ActivationTypeId.Archived : ActivationTypeId.Active;
|
||||
pDataContract.Type = PersonType.Employee;
|
||||
pDataContract.ActivationType = _IsArchived ? ActivationTypeId.Archived : ActivationTypeId.Active;
|
||||
//pDataContract.CancellationPeriod = this._CancellationPeriod;
|
||||
//pDataContract.EntryDate = this._EntryDate;
|
||||
//pDataContract.ProbationPeriod = this._ProbationPeriod;
|
||||
|
||||
@@ -680,6 +680,7 @@ namespace BeWo.ViewModel
|
||||
|
||||
pDataContract.Title = this._Title;
|
||||
pDataContract.Function = this._Function;
|
||||
pDataContract.Type = PersonType.Others;
|
||||
|
||||
return pDataContract;
|
||||
}
|
||||
|
||||
@@ -258,7 +258,7 @@ namespace BeWoChatServer
|
||||
var chatMessage = new ChatMessage
|
||||
{
|
||||
SenderPersonOid = dataPacket.SenderPersonOid,
|
||||
ChatText = dataPacket.ChatMessage,
|
||||
ChatText = Encoding.Default.GetBytes(dataPacket.ChatMessage),
|
||||
EmpfängerPersonOid = dataPacket.RecipientPersonOid,
|
||||
Uhrzeit = DateTime.Now,
|
||||
InsUser = dataPacket.ClientName,
|
||||
@@ -338,7 +338,7 @@ namespace BeWoChatServer
|
||||
var chatMessage = new ChatMessage
|
||||
{
|
||||
SenderPersonOid = dataPacket.SenderPersonOid,
|
||||
ChatText = dataPacket.ChatMessage,
|
||||
ChatText = System.Text.Encoding.Default.GetBytes(dataPacket.ChatMessage),
|
||||
EmpfängerPersonOid = dataPacket.RecipientPersonOid,
|
||||
Uhrzeit = dataPacket.MessageTimeStamp,
|
||||
InsUser = dataPacket.ClientName,
|
||||
|
||||
Binary file not shown.
File diff suppressed because one or more lines are too long
@@ -20,7 +20,7 @@ namespace BeWo.Data.Entities
|
||||
|
||||
public static string PropertyName_IstGelesen = "IstGelesen";
|
||||
|
||||
private string _ChatText;
|
||||
private byte[] _ChatText;
|
||||
|
||||
private DateTime _Uhrzeit;
|
||||
|
||||
@@ -39,7 +39,7 @@ namespace BeWo.Data.Entities
|
||||
_Tid = TableID.ChatMessage;
|
||||
}
|
||||
|
||||
public virtual string ChatText
|
||||
public virtual byte[] ChatText
|
||||
{
|
||||
get
|
||||
{
|
||||
|
||||
@@ -16,6 +16,6 @@
|
||||
<property name="Notice" />
|
||||
<property name="CustomerCode" column="CustomerCode" />
|
||||
<property name="CustomerCodeGenDate" column="CustomerCodeGenDate" />
|
||||
<property name="IsChatAktiv" column="IsChatAktiv" />
|
||||
<property name="IsChatAktiv" column="IsChatActive" />
|
||||
</class>
|
||||
</hibernate-mapping>
|
||||
26
Model/Changes_12_09_2016.txt
Normal file
26
Model/Changes_12_09_2016.txt
Normal file
@@ -0,0 +1,26 @@
|
||||
CREATE TABLE `chatmessages` (
|
||||
`Oid` bigint(19) NOT NULL AUTO_INCREMENT,
|
||||
|
||||
`SenderPersonOid` bigint(19) DEFAULT NULL,
|
||||
`EmpfaengerPersonOid` bigint(19)
|
||||
DEFAULT NULL,
|
||||
`Tid` int(10) DEFAULT NULL,
|
||||
`Notice` varchar(1024) DEFAULT NULL,
|
||||
|
||||
`InsTs` datetime DEFAULT NULL,
|
||||
`InsUser` varchar(1024) DEFAULT NULL,
|
||||
`Version` bigint(19) DEFAULT NULL,
|
||||
|
||||
`UdpUser` varchar(256) DEFAULT NULL,
|
||||
`isActive` tinyint(4) DEFAULT NULL,
|
||||
`SystemEntryID` int(10) DEFAULT NULL,
|
||||
|
||||
`ChatText` longblob,
|
||||
`Uhrzeit` datetime DEFAULT NULL,
|
||||
`IstZugestellt` tinyint(4) DEFAULT NULL,
|
||||
|
||||
`IstGelesen` tinyint(4) DEFAULT NULL,
|
||||
|
||||
`TeamOid` bigint(19) DEFAULT NULL,
|
||||
PRIMARY KEY (`Oid`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=327 DEFAULT CHARSET=latin1;
|
||||
@@ -8,26 +8,26 @@ namespace BeWo.Service.DCEntityMapper
|
||||
{
|
||||
public override ChatMessageDC MergeWithDC(ChatMessage pEntity, ChatMessageDC pDataContract)
|
||||
{
|
||||
pDataContract.SenderPersonOid = pEntity.SenderPersonOid;
|
||||
pDataContract.SenderPersonOid = pEntity.SenderPersonOid;
|
||||
pDataContract.EmpfängerPersonOid = pEntity.EmpfängerPersonOid;
|
||||
pDataContract.ChatText = pEntity.ChatText;
|
||||
pDataContract.Uhrzeit = pEntity.Uhrzeit;
|
||||
pDataContract.IsDelivered = pEntity.IsDelivered;
|
||||
pDataContract.IstGelesen = pEntity.IstGelesen;
|
||||
pDataContract.TeamOid = pEntity.TeamOid;
|
||||
pDataContract.ChatText = System.Text.Encoding.UTF8.GetString(pEntity.ChatText);
|
||||
pDataContract.Uhrzeit = pEntity.Uhrzeit;
|
||||
pDataContract.IsDelivered = pEntity.IsDelivered;
|
||||
pDataContract.IstGelesen = pEntity.IstGelesen;
|
||||
pDataContract.TeamOid = pEntity.TeamOid;
|
||||
|
||||
return pDataContract;
|
||||
}
|
||||
|
||||
public override ChatMessage MergeWithEntity(ChatMessageDC pDataContract, ChatMessage pEntity)
|
||||
{
|
||||
pEntity.SenderPersonOid = pDataContract.SenderPersonOid;
|
||||
pEntity.SenderPersonOid = pDataContract.SenderPersonOid;
|
||||
pEntity.EmpfängerPersonOid = pDataContract.EmpfängerPersonOid;
|
||||
pEntity.Uhrzeit = pDataContract.Uhrzeit;
|
||||
pEntity.ChatText = pDataContract.ChatText;
|
||||
pEntity.IsDelivered = pDataContract.IsDelivered;
|
||||
pEntity.IstGelesen = pDataContract.IstGelesen;
|
||||
pEntity.TeamOid = pDataContract.TeamOid;
|
||||
pEntity.Uhrzeit = pDataContract.Uhrzeit;
|
||||
pEntity.IsDelivered = pDataContract.IsDelivered;
|
||||
pEntity.ChatText = System.Text.Encoding.Default.GetBytes(pDataContract.ChatText);
|
||||
pEntity.IstGelesen = pDataContract.IstGelesen;
|
||||
pEntity.TeamOid = pDataContract.TeamOid;
|
||||
|
||||
return pEntity;
|
||||
}
|
||||
|
||||
@@ -3132,23 +3132,29 @@ namespace BeWo.Service.ServiceImplementations
|
||||
{
|
||||
try
|
||||
{
|
||||
ChatMessage newCode = new ChatMessage();
|
||||
newCode.EmpfängerPersonOid = empfängerOid;
|
||||
newCode.SenderPersonOid = senderOid;
|
||||
newCode.Uhrzeit = DateTime.Now;
|
||||
newCode.ChatText = message;
|
||||
newCode.IsDelivered = isDeliverd;
|
||||
newCode.IstGelesen = 0;
|
||||
var chatMessage = new ChatMessage
|
||||
{
|
||||
EmpfängerPersonOid = empfängerOid,
|
||||
SenderPersonOid = senderOid,
|
||||
Uhrzeit = DateTime.Now,
|
||||
IsDelivered = isDeliverd,
|
||||
ChatText = Encoding.UTF8.GetBytes(message),
|
||||
IstGelesen = 0
|
||||
};
|
||||
|
||||
if (teamid != 0)
|
||||
newCode.TeamOid = teamid;
|
||||
{
|
||||
chatMessage.TeamOid = teamid;
|
||||
}
|
||||
else
|
||||
newCode.TeamOid = null;
|
||||
{
|
||||
chatMessage.TeamOid = null;
|
||||
}
|
||||
|
||||
|
||||
DAOFactory.GenericDAO.Insert(newCode);
|
||||
DAOFactory.GenericDAO.Insert(chatMessage);
|
||||
|
||||
var ChatMEssagesDC = MapperFactory.ChatMessagesDC_ChatMessages.MapToNewDC(newCode);
|
||||
var ChatMEssagesDC = MapperFactory.ChatMessagesDC_ChatMessages.MapToNewDC(chatMessage);
|
||||
|
||||
return ChatMEssagesDC;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user