Merge branch 'master' of ssh://float.beyondsoft.de/git/beyondSoft/BeWo
This commit is contained in:
@@ -2401,6 +2401,24 @@
|
||||
<ItemGroup>
|
||||
<Resource Include="Ressources\Icons\trauriges-smiley.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="Ressources\Icons\mitarbeiter-team-avatar.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="Ressources\Icons\klient-avatar.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="Ressources\Icons\mitarbeiter-avatar.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="Ressources\Icons\sortiert.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="Ressources\Icons\unsortiert.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="Ressources\Icons\glucklicher.png" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<PropertyGroup>
|
||||
<PostBuildEvent>
|
||||
|
||||
BIN
BeWo/Ressources/Icons/glucklicher.png
Normal file
BIN
BeWo/Ressources/Icons/glucklicher.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.3 KiB |
BIN
BeWo/Ressources/Icons/klient-avatar.png
Normal file
BIN
BeWo/Ressources/Icons/klient-avatar.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 159 KiB |
BIN
BeWo/Ressources/Icons/mitarbeiter-avatar.png
Normal file
BIN
BeWo/Ressources/Icons/mitarbeiter-avatar.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 159 KiB |
BIN
BeWo/Ressources/Icons/mitarbeiter-team-avatar.png
Normal file
BIN
BeWo/Ressources/Icons/mitarbeiter-team-avatar.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 159 KiB |
BIN
BeWo/Ressources/Icons/sortiert.png
Normal file
BIN
BeWo/Ressources/Icons/sortiert.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 316 B |
BIN
BeWo/Ressources/Icons/unsortiert.png
Normal file
BIN
BeWo/Ressources/Icons/unsortiert.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 292 B |
File diff suppressed because it is too large
Load Diff
@@ -5,44 +5,45 @@
|
||||
Title="Chat View" Height="800" Width="800" WindowStartupLocation="CenterScreen" WindowStyle="None"
|
||||
AllowsTransparency="True"
|
||||
Background="Transparent"
|
||||
ResizeMode="NoResize"
|
||||
ResizeMode="CanResizeWithGrip"
|
||||
x:Name="ChatViewName">
|
||||
<Grid >
|
||||
<GroupBox Header="Chat" x:Name="rootGroupBox" Style="{DynamicResource MainContentGroupBoxWithoutMaximizeBtnStyle}" MouseLeftButtonDown="RootGroupBox_OnMouseLeftButtonDown">
|
||||
<Grid >
|
||||
<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" VerticalContentAlignment="Center">
|
||||
|
||||
<!--<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>-->
|
||||
|
||||
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<TextBox x:Name="Chatbox" HorizontalAlignment="Left" Margin="221,720,0,10" TextWrapping="Wrap" Text="Nachricht schreiben" TextChanged="Chatbox_OnTextChanged" VerticalScrollBarVisibility="Auto" MaxLines="5" MaxHeight="70"
|
||||
VerticalContentAlignment="Center" Width="416" MinHeight="25" ToolTip="Schreiben Sie hier eine Nachricht hinein" KeyDown="OnKeyDownHandler" GotFocus="OnFocus" Foreground="DarkGray" >
|
||||
VerticalContentAlignment="Center" Width="416" 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"/>
|
||||
<Setter Property="Padding" Value="10,0,0,0" />
|
||||
</Style>
|
||||
<Setter Property="Padding" Value="10,0,0,0" />
|
||||
</Style>
|
||||
</TextBox.Resources>
|
||||
</TextBox>
|
||||
<Button HorizontalAlignment="Left" x:Name="EmojiButton" Margin="642,720,-18,0" VerticalAlignment="Top" Width="23" Height="25" Click="SmileyButton_OnClick">
|
||||
<Image x:Name="Smiley" ToolTip="Smiley einfügen" Source="/BeWoPlaner;component/Ressources/Icons/trauriges-smiley.png" />
|
||||
<Button HorizontalAlignment="Left" x:Name="EmojiButton" Margin="642,720,-18,0" VerticalAlignment="Top" Width="25" Height="25" Click="SmileyButton_OnClick">
|
||||
<Image x:Name="Smiley" ToolTip="Smiley einfügen" Source="/BeWoPlaner;component/Ressources/Icons/glucklicher.png" Stretch="UniformToFill" VerticalAlignment="Center" HorizontalAlignment="Center" RenderOptions.BitmapScalingMode="HighQuality" />
|
||||
</Button>
|
||||
|
||||
</Grid>
|
||||
|
||||
|
||||
|
||||
|
||||
<ListBox x:Name="Chat" HorizontalAlignment="Left" Height="630" Margin="221,64,0,0" VerticalAlignment="Top" Width="564" VirtualizingStackPanel.IsVirtualizing="True" VirtualizingStackPanel.VirtualizationMode="Recycling" SelectionMode="Extended" MouseRightButtonDown="OnRightClickEvent" >
|
||||
@@ -78,7 +79,7 @@
|
||||
</Border>
|
||||
</DataTemplate>
|
||||
</ListBox.ItemTemplate>
|
||||
<!-- <ListBox.ItemsPanel> falls der Text von unten kommen soll
|
||||
<!-- <ListBox.ItemsPanel> der Text kommt von unten und die neuste nachricht steht immer oben
|
||||
<ItemsPanelTemplate>
|
||||
|
||||
<StackPanel VerticalAlignment="Bottom"/>
|
||||
@@ -86,46 +87,51 @@
|
||||
</ListBox.ItemsPanel>-->
|
||||
</ListBox>
|
||||
|
||||
|
||||
|
||||
<!--###################################### Liste aller User mit Chat Berechtigung ######################################################-->
|
||||
|
||||
|
||||
<!--###################################### Liste aller User mit Chat Berechtigung ###################################################### -->
|
||||
<ListView x:Name="Clientlist" HorizontalAlignment="Left" Height="680" Margin="10,64,0,0" VerticalAlignment="Top" Width="206" SelectionChanged="ListBoxSelectedIndexChanged" Style="{DynamicResource ResourceKey=styleListBox}" ItemTemplate="{DynamicResource DataTemplate1}">
|
||||
<ListView.Resources>
|
||||
<DataTemplate x:Key="DataTemplate1">
|
||||
<Grid Margin="15,0,0,0">
|
||||
<Grid Margin="7,0,0,0" x:Name="GridMargin">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="35"/>
|
||||
<ColumnDefinition Width="15"/>
|
||||
<ColumnDefinition Width="7"/>
|
||||
<ColumnDefinition Width="100"/>
|
||||
<ColumnDefinition Width="20"/>
|
||||
<ColumnDefinition Width="25"/>
|
||||
<ColumnDefinition Width="12"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<Border BorderThickness="0.25" CornerRadius="3" Grid.RowSpan="2" Grid.ColumnSpan="4" Background="White" >
|
||||
<Border BorderThickness="0.25" CornerRadius="3" Grid.RowSpan="2" Grid.ColumnSpan="5" Background="White" >
|
||||
<Border.BorderBrush>
|
||||
<SolidColorBrush Color="Black" />
|
||||
</Border.BorderBrush>
|
||||
</Border>
|
||||
|
||||
<Ellipse Width='30' Height='30'>
|
||||
<Ellipse Width='30' Height='30' RenderOptions.BitmapScalingMode="HighQuality">
|
||||
<Ellipse.Fill>
|
||||
<ImageBrush ImageSource='{Binding Image}' Stretch='Fill' />
|
||||
<ImageBrush ImageSource='{Binding Image}' Stretch='Fill' RenderOptions.BitmapScalingMode="HighQuality" />
|
||||
</Ellipse.Fill>
|
||||
</Ellipse>
|
||||
|
||||
<StackPanel Grid.Column="1" Height="30" >
|
||||
<Ellipse Width='15' Height='15' Fill="{Binding Path=Color}" Margin="0,6,0,0" VerticalAlignment="Center" HorizontalAlignment="Center" Stretch="Fill" />
|
||||
<Ellipse Width='7' Height='7' Fill="{Binding Path=Color}" Margin="-23,0,0,0" VerticalAlignment="Center" HorizontalAlignment="Center" Stretch="Fill" />
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Grid.Column="2" Margin="5" >
|
||||
<StackPanel Orientation="Horizontal" TextBlock.FontWeight="Bold" >
|
||||
<TextBlock Text="{Binding Path=Name, FallbackValue=FirstName}" />
|
||||
</StackPanel>
|
||||
<TextBlock Text="{Binding Path=StatusTyp, FallbackValue=Message}" />
|
||||
<!-- <TextBlock Text="{Binding Path=StatusTyp, FallbackValue=Message}" />-->
|
||||
</StackPanel>
|
||||
|
||||
<!--Für die anzeige der anzahl ungelesener Nachrichten Height="30"-->
|
||||
<StackPanel Grid.Column="3" Margin="5">
|
||||
<TextBlock Text="{Binding Path=Receivems}" FontWeight="Bold" Foreground="DarkRed" />
|
||||
<TextBlock Text="{Binding Path=Receivems}" FontWeight="Bold" Foreground="Black" />
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Grid.Column="4" Margin="7,0,0,0">
|
||||
<Rectangle Fill="{Binding Path=ColorType}" Stretch="Fill" Height="30" Width="2" />
|
||||
</StackPanel>
|
||||
|
||||
</Grid>
|
||||
@@ -143,9 +149,9 @@
|
||||
<ControlTemplate>
|
||||
<Expander IsExpanded="True">
|
||||
<Expander.Header>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock Text="{Binding Name}" FontWeight="Bold" Foreground="Black" FontSize="18" VerticalAlignment="Bottom" />
|
||||
<TextBlock Text="{Binding ItemCount}" FontSize="12" Foreground="OrangeRed" FontWeight="Bold" FontStyle="Italic" Margin="10,0,0,0" VerticalAlignment="Bottom" />
|
||||
<StackPanel Orientation="Horizontal" >
|
||||
<TextBlock Text="{Binding Name}" FontWeight="Bold" Foreground="Black" FontSize="18" VerticalAlignment="Bottom" Width="148" />
|
||||
<TextBlock Text="{Binding ItemCount}" FontSize="12" Foreground="Black" FontWeight="Bold" Margin="10,0,0,1" VerticalAlignment="Bottom" HorizontalAlignment="Right" />
|
||||
|
||||
</StackPanel>
|
||||
</Expander.Header>
|
||||
@@ -160,18 +166,50 @@
|
||||
</ListView.GroupStyle>
|
||||
|
||||
</ListView>
|
||||
<!--###################################### Ende Liste #######################################################-->
|
||||
|
||||
|
||||
|
||||
|
||||
<Button x:Name="SendButton" Content="Senden" HorizontalAlignment="Left" Margin="672,720,0,0" VerticalAlignment="Top" Width="111" Click="SendButton_Click" Height="25"/>
|
||||
<Label Content="Aktuelle Liste:" HorizontalAlignment="Left" Margin="10,41,0,0" VerticalAlignment="Top" RenderTransformOrigin="-0.622,0.045" Width="132"/>
|
||||
|
||||
|
||||
|
||||
<Grid Margin="10,13,574,691" Width="206" Height="50">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="25"/>
|
||||
<RowDefinition Height="20"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="206"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<StackPanel Grid.Row="0" Orientation="Horizontal" VerticalAlignment="Center" Width="180" HorizontalAlignment="Left" >
|
||||
<Label Content="Mein Status: " Width="80"/>
|
||||
<RadioButton GroupName="status" x:Name="RadioButtonOnline" BorderBrush="Green" Width="15" ToolTip="Online" VerticalAlignment="Center" Checked="ComboBox_SelectionChanged" Foreground="Green"/>
|
||||
<RadioButton GroupName="status" x:Name="RadioButtonOffline" BorderBrush="Red" Width="15" ToolTip="Offline" VerticalAlignment="Center" Checked="ComboBox_SelectionChanged" Foreground="Red"/>
|
||||
<RadioButton GroupName="status" x:Name="RadioButtonBeschaeftigt" BorderBrush="DarkOrange" Width="15" ToolTip="Beschäftigt" VerticalAlignment="Center" Checked="ComboBox_SelectionChanged" Foreground="DarkOrange"/>
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Grid.Row="0" Width="20" HorizontalAlignment="Right" Orientation="Horizontal" >
|
||||
<Button Style="{DynamicResource IconButtonStyle}" x:Name="ButtonSortLabel" Background="Transparent" BorderBrush="Transparent" HorizontalAlignment="Right" VerticalAlignment="Center" Width="20" Height="20" Click="ButtonSortLabel_OnClick" >
|
||||
<Image x:Name="SortLabel" ToolTip="Sortierung ändern" Source="pack://application:,,,/Ressources/icons/unsortiert.png" />
|
||||
</Button>
|
||||
</StackPanel>
|
||||
|
||||
<TextBox x:Name="Suche" Grid.Column="1" VerticalContentAlignment="Center" KeyDown="Suche_OnKeyDown" Grid.Row="1" TextChanged="Suche_OnTextChanged" LostFocus="Suche_OnLostFocus">
|
||||
<TextBox.Resources>
|
||||
<Style TargetType="{x:Type Border}">
|
||||
<Setter Property="CornerRadius" Value="3"/>
|
||||
<Setter Property="Padding" Value="5,0,0,0" />
|
||||
</Style>
|
||||
</TextBox.Resources>
|
||||
</TextBox>
|
||||
</Grid>
|
||||
|
||||
|
||||
</Grid>
|
||||
</GroupBox>
|
||||
<!-- 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="228,52,0,0" VerticalAlignment="Top" Width="312" ItemTemplate="{DynamicResource DataTemplate2}">
|
||||
<ListBox.Resources>
|
||||
<DataTemplate x:Key="DataTemplate2">
|
||||
@@ -180,20 +218,23 @@
|
||||
<ColumnDefinition Width="50"/>
|
||||
<ColumnDefinition Width="100"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="50" />
|
||||
</Grid.RowDefinitions>
|
||||
<!-- <Border Margin="5" BorderBrush="DarkGray" BorderThickness="1"> -->
|
||||
<Ellipse Width='30' Height='30'>
|
||||
<Ellipse.Fill>
|
||||
<ImageBrush ImageSource='{Binding Image}' Stretch='Fill' />
|
||||
<Ellipse Width='30' Height='30' VerticalAlignment="Center" RenderOptions.BitmapScalingMode="HighQuality">
|
||||
<Ellipse.Fill >
|
||||
<ImageBrush ImageSource='{Binding Image}' Stretch='Fill'/>
|
||||
</Ellipse.Fill>
|
||||
</Ellipse>
|
||||
<!-- <Image Source="{Binding Path=Image}" Stretch="Fill" Width="30" Height="30" />-->
|
||||
<!-- </Border> -->
|
||||
<StackPanel Grid.Column="1" Margin="5">
|
||||
<StackPanel Grid.Column="1" Margin="5" VerticalAlignment="Center">
|
||||
<StackPanel Orientation="Horizontal" TextBlock.FontWeight="Bold" >
|
||||
|
||||
<TextBlock Text="{Binding Path=Name, FallbackValue=FirstName}" />
|
||||
</StackPanel>
|
||||
<TextBlock Text="{Binding Path=StatusTyp, FallbackValue=Message}" />
|
||||
<!-- <TextBlock Text="{Binding Path=StatusTyp, FallbackValue=Message}" />-->
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
|
||||
@@ -64,6 +64,9 @@ namespace BeWo.View
|
||||
protected PropertyGroupDescription groupDescription;
|
||||
protected bool isOnFocus = false;
|
||||
|
||||
|
||||
protected bool sortLabelSwitch = false;
|
||||
|
||||
protected ContextMenu context;
|
||||
|
||||
public ChatView(String nameinf, String Chatinf, TcpClient tcpClient)
|
||||
@@ -77,11 +80,11 @@ namespace BeWo.View
|
||||
CloseWindow();
|
||||
LoadallChatKontakts();
|
||||
ErstelleContextMenue();
|
||||
SetChatSetting();
|
||||
// SetChatSetting();
|
||||
|
||||
}
|
||||
|
||||
private void SetChatSetting()
|
||||
/*private void SetChatSetting()
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -97,7 +100,7 @@ namespace BeWo.View
|
||||
{
|
||||
MessageBox.Show("Das Aufbauen der Chat-Settings ist fehlgeschlagen. " + edf.Message + "\n" + edf.StackTrace, "Fehler: 2200 ", MessageBoxButton.OK);
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
public void UpdateTcp(TcpClient tcpClient)
|
||||
{
|
||||
@@ -212,6 +215,36 @@ namespace BeWo.View
|
||||
}
|
||||
}
|
||||
|
||||
public void SetAnzahlErhalteneNachricht(long personoid)
|
||||
{
|
||||
try
|
||||
{
|
||||
foreach (var abc in ita)
|
||||
{
|
||||
|
||||
if (abc.EmpfaengerOid == personoid && abc.TypeChat != ChatType.Team)
|
||||
{
|
||||
int x;
|
||||
bool wasdrin = int.TryParse(abc.Receivems, out x);
|
||||
|
||||
if (wasdrin)
|
||||
{
|
||||
x++;
|
||||
abc.Receivems = x.ToString();
|
||||
|
||||
}
|
||||
else
|
||||
abc.Receivems = 1.ToString();
|
||||
}
|
||||
}
|
||||
view.Refresh();
|
||||
}
|
||||
catch (Exception edf)
|
||||
{
|
||||
MessageBox.Show("Beim Setzen der Anzahl angekommender Nachrichten ist ein Fehler aufgetreten. " + edf.Message + "\n" + edf.StackTrace, "Fehler 2391", MessageBoxButton.OK);
|
||||
}
|
||||
}
|
||||
|
||||
public void RefreshViewModel()
|
||||
{
|
||||
view.Refresh();
|
||||
@@ -233,7 +266,7 @@ namespace BeWo.View
|
||||
{
|
||||
var mitarbeiter = ServiceFacade.DoEmployeeServiceSync(s => s.GetEmployeeWithPersonOid(personoid));
|
||||
|
||||
KontaktlistBuilder konbuild = new KontaktlistBuilder(clientname,StatusType.Online, BuildImg(mitarbeiter.EmployeeImage), personoid, ChatType.Mitarbeiter);//"Online"
|
||||
KontaktlistBuilder konbuild = new KontaktlistBuilder(clientname,StatusType.Online, BuildImg(mitarbeiter.EmployeeImage,ChatType.Mitarbeiter), personoid, ChatType.Mitarbeiter);//"Online"
|
||||
|
||||
var zugehorigkeit = ServiceFacade.DoEmployeeServiceSync(s => s.GetTeamOidsByEmployee(personoid));
|
||||
|
||||
@@ -253,7 +286,14 @@ namespace BeWo.View
|
||||
}
|
||||
}
|
||||
}
|
||||
view.Refresh();
|
||||
// if (SortCheckBox.IsChecked.Value)
|
||||
// {
|
||||
view.Refresh();
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// ChatViewName.RefreshUI();
|
||||
// }
|
||||
}
|
||||
else if (a == PersonType.Customer)
|
||||
{
|
||||
@@ -268,7 +308,7 @@ namespace BeWo.View
|
||||
customerCompact.LastName = klienten.LastName;
|
||||
customerCompact.DateOfBirth = klienten.DateOfBirth;
|
||||
|
||||
KontaktlistBuilder konbuild = new KontaktlistBuilder(clientname, StatusType.Online, BuildImg(klienten.CustomerImage), personoid, ChatType.Klienten, customerCompact);//"Online"
|
||||
KontaktlistBuilder konbuild = new KontaktlistBuilder(clientname, StatusType.Online, BuildImg(klienten.CustomerImage,ChatType.Klienten), personoid, ChatType.Klienten, customerCompact);//"Online"
|
||||
|
||||
foreach (var variable in ita)
|
||||
{
|
||||
@@ -413,7 +453,7 @@ namespace BeWo.View
|
||||
|
||||
public void SetServerStats(String servstats)
|
||||
{
|
||||
ServerStats.Text = servstats;
|
||||
//ServerStats.Text = servstats;
|
||||
}
|
||||
|
||||
private void SendButton_Click(object sender, RoutedEventArgs e)
|
||||
@@ -510,25 +550,19 @@ namespace BeWo.View
|
||||
try
|
||||
{
|
||||
var employeeteamoids = ServiceFacade.DoEmployeeServiceSync(s => s.GetTeamOidsByEmployee(BeWoApp.LoggedOnUser.Employee.EmployeeOid));
|
||||
var offmitarbeiter =
|
||||
ServiceFacade.DoEmployeeServiceSync(s => s.GetAllChatActiveEmployeesCompact());
|
||||
var offklienten = ServiceFacade.DoCustomerServiceSync(s => s.GetAllChatActiveCustomersCompact(BeWoApp.LoggedOnUser.Employee.EmployeeOid)); // dieser code muss erweitert werden
|
||||
|
||||
/* var employee = ServiceFacade.DoEmployeeServiceSync(
|
||||
s => s.GetEmployeeWithPersonOid(BeWoApp.LoggedOnUser.Employee.EmployeeOid));
|
||||
|
||||
employee.Employee2CustomerList.Select(s => s.CustomerOid.Value);*/
|
||||
var offmitarbeiter = ServiceFacade.DoEmployeeServiceSync(s => s.GetAllChatActiveEmployeesCompact());
|
||||
var offklienten = ServiceFacade.DoCustomerServiceSync(s => s.GetAllChatActiveCustomersCompact(BeWoApp.LoggedOnUser.Employee.EmployeeOid));
|
||||
|
||||
foreach (var team in employeeteamoids)
|
||||
{
|
||||
Clientlist.Items.Add(new KontaktlistBuilder(team.Name, StatusType.Offline, BuildImg(null), team.TeamOid, ChatType.Team));
|
||||
Clientlist.Items.Add(new KontaktlistBuilder(team.Name, StatusType.Offline, BuildImg(null,ChatType.Team), team.TeamOid, ChatType.Team));
|
||||
}
|
||||
|
||||
foreach (var list in offmitarbeiter)
|
||||
{
|
||||
if(list.PersonOid != BeWoApp.LoggedOnUser.Employee.PersonOid){
|
||||
Clientlist.Items.Add(new KontaktlistBuilder(list.FirstName + " " + list.LastName, StatusType.Offline,
|
||||
BuildImg(ServiceFacade.DoEmployeeServiceSync(s => s.GetEmployeeImage(list.EmployeeOid))),
|
||||
BuildImg(ServiceFacade.DoEmployeeServiceSync(s => s.GetEmployeeImage(list.EmployeeOid)),ChatType.Mitarbeiter),
|
||||
list.PersonOid, ChatType.Mitarbeiter));
|
||||
}
|
||||
}
|
||||
@@ -536,7 +570,7 @@ namespace BeWo.View
|
||||
{
|
||||
|
||||
Clientlist.Items.Add(new KontaktlistBuilder(list.FirstName + " " + list.LastName, StatusType.Offline,
|
||||
BuildImg(ServiceFacade.DoCustomerServiceSync(s => s.GetCustomerImage(list.CustomerOid))),
|
||||
BuildImg(ServiceFacade.DoCustomerServiceSync(s => s.GetCustomerThumbnail(list.CustomerOid)), ChatType.Klienten),
|
||||
list.PersonOid, ChatType.Klienten,list));
|
||||
}
|
||||
|
||||
@@ -552,8 +586,16 @@ namespace BeWo.View
|
||||
Clientlist.ItemsSource = ita;
|
||||
|
||||
view = (CollectionView)CollectionViewSource.GetDefaultView(Clientlist.ItemsSource);
|
||||
groupDescription = new PropertyGroupDescription("TypeChat");
|
||||
view.GroupDescriptions.Add(groupDescription);
|
||||
view.SortDescriptions.Add(new SortDescription("Receivems", ListSortDirection.Descending));
|
||||
view.SortDescriptions.Add(new SortDescription("StatusType", ListSortDirection.Descending));
|
||||
view.Filter = UserFilter;
|
||||
|
||||
|
||||
if (sortLabelSwitch == true)
|
||||
{
|
||||
groupDescription = new PropertyGroupDescription("TypeChat");
|
||||
view.GroupDescriptions.Add(groupDescription);
|
||||
}
|
||||
}
|
||||
catch (Exception edf)
|
||||
{
|
||||
@@ -593,7 +635,7 @@ namespace BeWo.View
|
||||
{
|
||||
if (!idteamspeicher.Contains(var.TeamOid) && idteamspeicher.Count <= employeeteamoids.Count)
|
||||
{
|
||||
ita.Add(new KontaktlistBuilder(var.Name,StatusType.Offline, BuildImg(null), var.TeamOid, ChatType.Team));
|
||||
ita.Add(new KontaktlistBuilder(var.Name,StatusType.Offline, BuildImg(null,ChatType.Team), var.TeamOid, ChatType.Team));
|
||||
view.Refresh();
|
||||
}
|
||||
|
||||
@@ -606,7 +648,7 @@ namespace BeWo.View
|
||||
if (!idMitarbeitspeicher.Contains(var.PersonOid) && idMitarbeitspeicher.Count <= offmitarbeiter.Count && var.PersonOid != BeWoApp.LoggedOnUser.Employee.PersonOid)
|
||||
{
|
||||
ita.Add(new KontaktlistBuilder(var.FirstName + " " + var.LastName,StatusType.Offline,
|
||||
BuildImg(ServiceFacade.DoEmployeeServiceSync(s => s.GetEmployeeImage(var.EmployeeOid))),
|
||||
BuildImg(ServiceFacade.DoEmployeeServiceSync(s => s.GetEmployeeImage(var.EmployeeOid)),ChatType.Mitarbeiter),
|
||||
var.PersonOid, ChatType.Mitarbeiter));
|
||||
view.Refresh();
|
||||
}
|
||||
@@ -620,7 +662,7 @@ namespace BeWo.View
|
||||
if (!idKlientspeicher.Contains(var.PersonOid) && idKlientspeicher.Count <= offklienten.Count)
|
||||
{
|
||||
ita.Add(new KontaktlistBuilder(var.FirstName + " " + var.LastName, StatusType.Offline,
|
||||
BuildImg(ServiceFacade.DoCustomerServiceSync(s => s.GetCustomerImage(var.CustomerOid))),
|
||||
BuildImg(ServiceFacade.DoCustomerServiceSync(s => s.GetCustomerThumbnail(var.CustomerOid)), ChatType.Klienten),
|
||||
var.PersonOid, ChatType.Klienten,var));
|
||||
view.Refresh();
|
||||
}
|
||||
@@ -658,6 +700,21 @@ namespace BeWo.View
|
||||
|
||||
view.Refresh();
|
||||
}
|
||||
|
||||
if (sortLabelSwitch == true)
|
||||
{
|
||||
view.GroupDescriptions.Clear();
|
||||
groupDescription = new PropertyGroupDescription("TypeChat");
|
||||
view.GroupDescriptions.Add(groupDescription);
|
||||
view.Refresh();
|
||||
}
|
||||
else
|
||||
{
|
||||
view.GroupDescriptions.Clear();
|
||||
view.Refresh();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
catch (Exception edf)
|
||||
{
|
||||
@@ -672,7 +729,7 @@ namespace BeWo.View
|
||||
list.StatusTyp = StatusType.Offline;
|
||||
}
|
||||
|
||||
view.Refresh();
|
||||
view.Refresh();
|
||||
}
|
||||
|
||||
public void SetUserBeschäftigt(long oid, DataIdentifier type)
|
||||
@@ -768,60 +825,62 @@ namespace BeWo.View
|
||||
}
|
||||
|
||||
|
||||
private void ComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||
private void ComboBox_SelectionChanged(object sender, RoutedEventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
switch (StatusSetting.SelectedIndex)
|
||||
{
|
||||
case 0:
|
||||
if (RadioButtonOnline.IsChecked.Value)
|
||||
{
|
||||
if (tcpClient == null)
|
||||
{
|
||||
StatusSetting.SelectedIndex = 1;
|
||||
RadioButtonOffline.IsChecked = true;
|
||||
}
|
||||
else if (!tcpClient.Connected)
|
||||
{
|
||||
StatusSetting.SelectedIndex = 1;
|
||||
RadioButtonOffline.IsChecked = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
SendUserStatus(DataIdentifier.StatusNotificationOnline);
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 1:
|
||||
|
||||
if (RadioButtonOffline.IsChecked.Value)
|
||||
{
|
||||
if (tcpClient == null)
|
||||
{
|
||||
StatusSetting.SelectedIndex = 1;
|
||||
RadioButtonOffline.IsChecked = true;
|
||||
}
|
||||
else if (!tcpClient.Connected)
|
||||
{
|
||||
StatusSetting.SelectedIndex = 1;
|
||||
RadioButtonOffline.IsChecked = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
{
|
||||
SendUserStatus(DataIdentifier.StatusNotificationOffline);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case 2:
|
||||
if (RadioButtonBeschaeftigt.IsChecked.Value)
|
||||
{
|
||||
if (tcpClient == null)
|
||||
{
|
||||
StatusSetting.SelectedIndex = 1;
|
||||
RadioButtonOffline.IsChecked = true;
|
||||
}
|
||||
else if (!tcpClient.Connected)
|
||||
{
|
||||
StatusSetting.SelectedIndex = 1;
|
||||
RadioButtonOffline.IsChecked = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
SendUserStatus(DataIdentifier.StatusNotificationBeschäftigt);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
catch (Exception edf)
|
||||
{
|
||||
@@ -918,40 +977,47 @@ namespace BeWo.View
|
||||
|
||||
AktChatUser.Items.Clear();
|
||||
|
||||
if (!curItem.Receivems.Equals(""))
|
||||
{
|
||||
curItem.Receivems = "";
|
||||
}
|
||||
|
||||
if (curItem.TypeChat == ChatType.Klienten)
|
||||
{
|
||||
AktChatUser.Items.Add(new KontaktlistBuilder(curItem.Name, curItem.StatusTyp, curItem.Image, curItem.EmpfaengerOid, curItem.TypeChat, curItem.Customer));
|
||||
}
|
||||
else
|
||||
{
|
||||
AktChatUser.Items.Add(new KontaktlistBuilder(curItem.Name, curItem.StatusTyp, curItem.Image, curItem.EmpfaengerOid, curItem.TypeChat));
|
||||
}
|
||||
if(curItem != null){
|
||||
|
||||
if (!curItem.Receivems.Equals(""))
|
||||
{
|
||||
curItem.Receivems = "";
|
||||
}
|
||||
|
||||
if (curItem.TypeChat == ChatType.Klienten)
|
||||
{
|
||||
AktChatUser.Items.Add(new KontaktlistBuilder(curItem.Name, curItem.StatusTyp, curItem.Image, curItem.EmpfaengerOid, curItem.TypeChat, curItem.Customer));
|
||||
}
|
||||
else
|
||||
{
|
||||
AktChatUser.Items.Add(new KontaktlistBuilder(curItem.Name, curItem.StatusTyp, curItem.Image, curItem.EmpfaengerOid, curItem.TypeChat));
|
||||
}
|
||||
|
||||
|
||||
LoadChatMessagefromDB(BeWoApp.LoggedOnEmployee.PersonOid.Value, curItem.EmpfaengerOid, curItem);
|
||||
Chat.Items.MoveCurrentToLast();
|
||||
Chat.ScrollIntoView(Chat.Items.CurrentItem);
|
||||
view.Refresh();
|
||||
|
||||
LoadChatMessagefromDB(BeWoApp.LoggedOnEmployee.PersonOid.Value, curItem.EmpfaengerOid, curItem);
|
||||
Chat.Items.MoveCurrentToLast();
|
||||
Chat.ScrollIntoView(Chat.Items.CurrentItem);
|
||||
|
||||
if (curItem.TypeChat == ChatType.Klienten)
|
||||
{
|
||||
context.Visibility = Visibility.Visible;
|
||||
Chat.SelectionMode = SelectionMode.Extended;
|
||||
Chat.Focusable = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
context.Visibility = Visibility.Collapsed;
|
||||
Chat.SelectionMode = SelectionMode.Single;
|
||||
Chat.Focusable = false;
|
||||
}
|
||||
|
||||
Suche.Text = "";
|
||||
|
||||
view.Refresh();
|
||||
|
||||
|
||||
if (curItem.TypeChat == ChatType.Klienten)
|
||||
{
|
||||
context.Visibility = Visibility.Visible;
|
||||
Chat.SelectionMode = SelectionMode.Extended;
|
||||
Chat.Focusable = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
context.Visibility = Visibility.Collapsed;
|
||||
Chat.SelectionMode = SelectionMode.Single;
|
||||
Chat.Focusable = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception s)
|
||||
@@ -961,7 +1027,7 @@ namespace BeWo.View
|
||||
}
|
||||
}
|
||||
|
||||
public ImageSource BuildImg(Byte[] c)
|
||||
public ImageSource BuildImg(Byte[] c ,ChatType x)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -983,12 +1049,40 @@ namespace BeWo.View
|
||||
{
|
||||
//return null;
|
||||
//return new BitmapImage(new Uri(@"..\..\Ressources\Icons\UserHomeBoyDisabled.png", UriKind.Relative));
|
||||
BitmapImage bi = new BitmapImage();
|
||||
bi.BeginInit();
|
||||
bi.UriSource = new Uri("pack://application:,,,/Ressources/icons/UserHomeBoyDisabled.png");
|
||||
bi.EndInit();
|
||||
return bi;
|
||||
|
||||
if (x == ChatType.Klienten)
|
||||
{
|
||||
BitmapImage bix = new BitmapImage();
|
||||
bix.BeginInit();
|
||||
bix.UriSource = new Uri("pack://application:,,,/Ressources/icons/klient-avatar.png");
|
||||
bix.EndInit();
|
||||
return bix;
|
||||
}else
|
||||
if (x == ChatType.Mitarbeiter)
|
||||
{
|
||||
BitmapImage biy = new BitmapImage();
|
||||
biy.BeginInit();
|
||||
biy.UriSource = new Uri("pack://application:,,,/Ressources/icons/mitarbeiter-avatar.png");
|
||||
biy.EndInit();
|
||||
return biy;
|
||||
}else
|
||||
if (x == ChatType.Team)
|
||||
{
|
||||
BitmapImage biz = new BitmapImage();
|
||||
biz.BeginInit();
|
||||
biz.UriSource = new Uri("pack://application:,,,/Ressources/icons/mitarbeiter-team-avatar.png");
|
||||
biz.EndInit();
|
||||
return biz;
|
||||
}
|
||||
else
|
||||
{
|
||||
BitmapImage bi = new BitmapImage();
|
||||
bi.BeginInit();
|
||||
bi.UriSource = new Uri("pack://application:,,,/Ressources/icons/UserHomeBoyDisabled.png");
|
||||
bi.EndInit();
|
||||
return bi;
|
||||
}
|
||||
|
||||
//return new ImageSource new BitmapImage(new Uri(@"..\..\Ressources\Icons\UserHomeBoyDisabled.png", UriKind.Relative));
|
||||
|
||||
//(ImageSource)
|
||||
@@ -1042,7 +1136,7 @@ namespace BeWo.View
|
||||
serverStream.Write(outStream, 0, outStream.Length);
|
||||
serverStream.Flush();
|
||||
|
||||
ServerStats.Text = "Nachricht erfolgreich gesendet";
|
||||
// ServerStats.Text = "Nachricht erfolgreich gesendet";
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1056,7 +1150,7 @@ namespace BeWo.View
|
||||
MessageBox.Show("Beim Senden einer Nachricht zum Server ist ein Fehler aufgetreten. " + xe.Message + "\n" + xe.StackTrace,
|
||||
"Fehler: 2300 ", MessageBoxButton.OK);
|
||||
|
||||
ServerStats.Text = "Fehler: Die Nachricht konnte nicht gesendet werden.";
|
||||
//ServerStats.Text = "Fehler: Die Nachricht konnte nicht gesendet werden.";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1174,12 +1268,6 @@ namespace BeWo.View
|
||||
{
|
||||
if (list.TeamOid == null || list.TeamOid == 0)
|
||||
{
|
||||
/* if (i == 0)
|
||||
{
|
||||
Chat.Items.Add(new KontakMessageBuilder("", "------------------------ Ungelesene Nachrichten -----------------------", "", 0));
|
||||
i++;
|
||||
}*/
|
||||
|
||||
if (list.SenderPersonOid == senderoid)
|
||||
{
|
||||
Chat.Items.Add(new KontakMessageBuilder(person[0].FirstName, list.ChatText,
|
||||
@@ -1208,7 +1296,6 @@ namespace BeWo.View
|
||||
}
|
||||
}
|
||||
|
||||
//placeholder
|
||||
private void OnFocus(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
@@ -1237,7 +1324,7 @@ namespace BeWo.View
|
||||
}
|
||||
|
||||
|
||||
//Rechte Maus Taste an dem Chat
|
||||
|
||||
public void OnRightClickEvent(object sender, RoutedEventArgs e)
|
||||
{
|
||||
e.Handled = true;
|
||||
@@ -1296,49 +1383,125 @@ namespace BeWo.View
|
||||
{
|
||||
try
|
||||
{
|
||||
var x = ServiceFacade.DoOperationsServiceSync(s => s.FindUnreadChatMessagesForRecipient(BeWoApp.LoggedOnEmployee.PersonOid.Value));
|
||||
|
||||
foreach (var ChatMessage in x)
|
||||
{
|
||||
foreach (var aktChatPersons in ita)
|
||||
ServiceFacade.DoOperationsServiceAsync(
|
||||
s => s.FindUnreadChatMessagesForRecipient(BeWoApp.LoggedOnEmployee.PersonOid.Value),
|
||||
m =>
|
||||
{
|
||||
if (aktChatPersons.EmpfaengerOid == ChatMessage.SenderPersonOid && aktChatPersons.TypeChat != ChatType.Team)
|
||||
{
|
||||
int aktc;
|
||||
bool wasdrin = int.TryParse(aktChatPersons.Receivems, out aktc);
|
||||
|
||||
if (wasdrin)
|
||||
Dispatcher.Invoke(
|
||||
DispatcherPriority.Normal,
|
||||
(ThreadStart) delegate
|
||||
{
|
||||
aktc++;
|
||||
aktChatPersons.Receivems = aktc.ToString();
|
||||
foreach (var ChatMessage in m)
|
||||
{
|
||||
foreach (var aktChatPersons in ita)
|
||||
{
|
||||
if (aktChatPersons.EmpfaengerOid == ChatMessage.SenderPersonOid &&
|
||||
aktChatPersons.TypeChat != ChatType.Team)
|
||||
{
|
||||
int aktc;
|
||||
bool wasdrin = int.TryParse(aktChatPersons.Receivems, out aktc);
|
||||
|
||||
}
|
||||
else
|
||||
aktChatPersons.Receivems = 1.ToString();
|
||||
if (wasdrin)
|
||||
{
|
||||
aktc++;
|
||||
aktChatPersons.Receivems = aktc.ToString();
|
||||
|
||||
}else if(aktChatPersons.EmpfaengerOid == ChatMessage.TeamOid)
|
||||
{
|
||||
int aktt;
|
||||
bool wasdrin = int.TryParse(aktChatPersons.Receivems, out aktt);
|
||||
}
|
||||
else
|
||||
aktChatPersons.Receivems = 1.ToString();
|
||||
|
||||
if (wasdrin)
|
||||
{
|
||||
aktt++;
|
||||
aktChatPersons.Receivems = aktt.ToString();
|
||||
}
|
||||
else if (aktChatPersons.EmpfaengerOid == ChatMessage.TeamOid)
|
||||
{
|
||||
int aktt;
|
||||
bool wasdrin = int.TryParse(aktChatPersons.Receivems, out aktt);
|
||||
|
||||
}
|
||||
else
|
||||
aktChatPersons.Receivems = 1.ToString();
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
if (wasdrin)
|
||||
{
|
||||
aktt++;
|
||||
aktChatPersons.Receivems = aktt.ToString();
|
||||
|
||||
}
|
||||
else
|
||||
aktChatPersons.Receivems = 1.ToString();
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
MessageBox.Show("Fehler :" + e.Message + "\n" + e.StackTrace, "Info", MessageBoxButton.OK);
|
||||
}
|
||||
}
|
||||
|
||||
private void SortCheckBox_OnChecked(object sender, RoutedEventArgs e)
|
||||
{
|
||||
//AktualisiereChatKontakt();
|
||||
}
|
||||
|
||||
private void Suche_OnKeyDown(object sender, KeyEventArgs e)
|
||||
{
|
||||
if (e.Key == Key.Return)
|
||||
{
|
||||
Suche.Text = "";
|
||||
}
|
||||
}
|
||||
|
||||
private void Suche_OnTextChanged(object sender, TextChangedEventArgs e)
|
||||
{
|
||||
CollectionViewSource.GetDefaultView(Clientlist.ItemsSource).Refresh();
|
||||
}
|
||||
|
||||
private bool UserFilter(object item)
|
||||
{
|
||||
if (String.IsNullOrEmpty(Suche.Text))
|
||||
return true;
|
||||
else
|
||||
return ((item as KontaktlistBuilder).Name.IndexOf(Suche.Text, StringComparison.OrdinalIgnoreCase) >= 0);
|
||||
}
|
||||
|
||||
private void Suche_OnLostFocus(object sender, RoutedEventArgs e)
|
||||
{
|
||||
// Suche.Text = "";
|
||||
}
|
||||
|
||||
|
||||
private void ButtonSortLabel_OnClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
|
||||
//if() clicked dann immer wechseln + abfrage true und false ;
|
||||
|
||||
if (sortLabelSwitch == false)
|
||||
{
|
||||
BitmapImage biy = new BitmapImage();
|
||||
biy.BeginInit();
|
||||
biy.UriSource = new Uri("pack://application:,,,/Ressources/icons/sortiert.png");
|
||||
biy.EndInit();
|
||||
|
||||
SortLabel.Source = biy;
|
||||
|
||||
sortLabelSwitch = true;
|
||||
AktualisiereChatKontakt();
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
BitmapImage biy = new BitmapImage();
|
||||
biy.BeginInit();
|
||||
biy.UriSource = new Uri("pack://application:,,,/Ressources/icons/unsortiert.png");
|
||||
biy.EndInit();
|
||||
|
||||
SortLabel.Source = biy;
|
||||
sortLabelSwitch = false;
|
||||
AktualisiereChatKontakt();
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class KontaktlistBuilder : INotifyPropertyChanged
|
||||
@@ -1366,6 +1529,19 @@ namespace BeWo.View
|
||||
{
|
||||
this.Color = new SolidColorBrush(Colors.Orange);
|
||||
}
|
||||
|
||||
if (typeChat == ChatType.Team)
|
||||
{
|
||||
_colorType = new SolidColorBrush(Colors.DarkViolet);
|
||||
}
|
||||
else if (typeChat == ChatType.Klienten)
|
||||
{
|
||||
_colorType = new SolidColorBrush(Colors.Blue);
|
||||
}
|
||||
else
|
||||
{
|
||||
_colorType = new SolidColorBrush(Colors.Green);
|
||||
}
|
||||
}
|
||||
|
||||
public KontaktlistBuilder(string name, StatusType statustyp, ImageSource image, long empfaengerid, ChatType typeChat, CompactCustomerDC customer)
|
||||
@@ -1391,6 +1567,19 @@ namespace BeWo.View
|
||||
{
|
||||
this.Color = new SolidColorBrush(Colors.Orange);
|
||||
}
|
||||
|
||||
if (typeChat == ChatType.Team)
|
||||
{
|
||||
_colorType = new SolidColorBrush(Colors.DarkViolet);
|
||||
}
|
||||
else if (typeChat == ChatType.Klienten)
|
||||
{
|
||||
_colorType = new SolidColorBrush(Colors.Blue);
|
||||
}
|
||||
else
|
||||
{
|
||||
_colorType = new SolidColorBrush(Colors.Green);
|
||||
}
|
||||
}
|
||||
|
||||
public string Name { get; private set; }
|
||||
@@ -1446,7 +1635,33 @@ namespace BeWo.View
|
||||
//_color = value;
|
||||
OnPropertyChanged("Color"); }
|
||||
}
|
||||
|
||||
|
||||
private Brush _colorType;
|
||||
public Brush ColorType
|
||||
{
|
||||
get
|
||||
{
|
||||
return _colorType;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (TypeChat == ChatType.Team)
|
||||
{
|
||||
_colorType = new SolidColorBrush(Colors.DarkViolet);
|
||||
}
|
||||
else if (TypeChat == ChatType.Klienten)
|
||||
{
|
||||
_colorType = new SolidColorBrush(Colors.Blue);
|
||||
}
|
||||
else
|
||||
{
|
||||
_colorType = new SolidColorBrush(Colors.Green);
|
||||
}
|
||||
|
||||
//_color = value;
|
||||
OnPropertyChanged("ColorType");
|
||||
}
|
||||
}
|
||||
public CompactCustomerDC Customer { get; set; }
|
||||
|
||||
public event PropertyChangedEventHandler PropertyChanged;
|
||||
|
||||
@@ -183,6 +183,11 @@
|
||||
</dxg:GridColumn>
|
||||
<dxg:GridColumn AllowEditing="False" FieldName="Employee" Header="Betreuer(in)" Width="150" />
|
||||
<dxg:GridColumn x:Name="gridcolumn_employeerole" FieldName="Role" Header="Rolle" Width="200" />
|
||||
|
||||
<dxg:GridColumn x:Name="gridcolumn_employeechatpartner" Header="Chatpartner" Width="80" FieldName="Chatpartner">
|
||||
|
||||
</dxg:GridColumn>
|
||||
|
||||
<dxg:GridColumn FieldName="Notice" Header="Erläuterung" Width="250" />
|
||||
</dxg:GridControl.Columns>
|
||||
<dxg:GridControl.View>
|
||||
@@ -326,7 +331,7 @@
|
||||
|
||||
<GroupBox Grid.ColumnSpan="1" Header="Foto" Margin="8 8 0 0" Style="{StaticResource ObjectEditGroupBox}" Grid.Column="0">
|
||||
<Grid>
|
||||
<dxe:ImageEdit MinWidth="250" MaxWidth="300" Height="250" x:Name="Img" Stretch="Uniform" HorizontalAlignment="Center" />
|
||||
<dxe:ImageEdit MinWidth="250" MaxWidth="300" Height="250" x:Name="Img" Stretch="Uniform" HorizontalAlignment="Center" RenderOptions.BitmapScalingMode="HighQuality" />
|
||||
</Grid>
|
||||
<!--RenderOptions.BitmapScalingMode="Fant"-->
|
||||
</GroupBox>
|
||||
@@ -983,6 +988,7 @@
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
@@ -1005,10 +1011,12 @@
|
||||
<Label Content="Notiz" Grid.Row="2" Grid.Column="0" VerticalAlignment="Top" />
|
||||
<TextBox Grid.Row="2" Grid.Column="1" Height="50" Margin="3" Grid.ColumnSpan="2"
|
||||
Text="{Binding Path=EmployeeRelations.NewVM.Notice, UpdateSourceTrigger=PropertyChanged}" />
|
||||
<Button Grid.Row="3" Grid.Column="1" HorizontalAlignment="Right" VerticalAlignment="Bottom" Height="25"
|
||||
<Label Content="Chatpartner" Grid.Row="3" Grid.Column="0" VerticalAlignment="Center"/>
|
||||
<CheckBox Grid.Row="3" Grid.Column="2" IsChecked="{Binding Path=EmployeeRelations.NewVM.Chatpartner, UpdateSourceTrigger=PropertyChanged}" HorizontalAlignment="Right" Margin="3"/>
|
||||
<Button Grid.Row="4" Grid.Column="1" HorizontalAlignment="Right" VerticalAlignment="Bottom" Height="25"
|
||||
Margin="3" Content="Hinzufügen" x:Name="button_addEmployeeRelation"
|
||||
Click="button_addEmployeeRelation_Click" />
|
||||
<Button Grid.Row="3" Grid.Column="2" HorizontalAlignment="Stretch" VerticalAlignment="Bottom" Height="25"
|
||||
<Button Grid.Row="4" Grid.Column="2" HorizontalAlignment="Stretch" VerticalAlignment="Bottom" Height="25"
|
||||
Margin="3" Content="Abbrechen" x:Name="button_cancelEmployeeRelation"
|
||||
Click="button_cancelEmployeeRelation_Click" />
|
||||
</Grid>
|
||||
|
||||
@@ -80,7 +80,7 @@ namespace BeWo.View.Detail
|
||||
public CustomerView(CustomerVM pCustomerVM)
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
|
||||
BehinderungsartenSelection.CommandBindings.Add(new CommandBinding(ApplicationCommands.Close, (s, e) => this.Dispatch(() => { PopupBehinderungsarten.IsOpen = false; })));
|
||||
MerkzeichenSelection.CommandBindings.Add(new CommandBinding(ApplicationCommands.Close, (s, e) => this.Dispatch(() => { PopupMerkzeichen.IsOpen = false; })));
|
||||
|
||||
@@ -238,6 +238,9 @@ namespace BeWo.View.Detail
|
||||
}
|
||||
|
||||
Img.EditValueChanged += Image_EditValueChanged;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
void Image_EditValueChanged(object sender, DevExpress.Xpf.Editors.EditValueChangedEventArgs e)
|
||||
@@ -491,6 +494,12 @@ namespace BeWo.View.Detail
|
||||
{
|
||||
grid_EmployeeRelation.Columns["Role"].EditSettings = new ComboBoxEditSettings { ItemsSource = ViewModel.EmployeeRelations.PossibleRoles };
|
||||
}
|
||||
|
||||
if (!BeWoApp.LoggedOnUser.HasRight(UserRightType.ChatSettings))
|
||||
{
|
||||
grid_EmployeeRelation.Columns["Chatpartner"].Visible = false;
|
||||
}
|
||||
|
||||
}
|
||||
if (grid_TeamRelation == null)
|
||||
{
|
||||
|
||||
@@ -123,7 +123,7 @@
|
||||
|
||||
<GroupBox Header="Foto" Margin="8 0 8 8" Grid.RowSpan="3" Style="{StaticResource ObjectEditGroupBox}" Grid.Column="0">
|
||||
<Grid>
|
||||
<dxe:ImageEdit MinWidth="250" MaxWidth="300" Height="250" MaxHeight="300" x:Name="Img" Stretch="Uniform" HorizontalAlignment="Center" VerticalAlignment="Top" />
|
||||
<dxe:ImageEdit MinWidth="250" MaxWidth="300" Height="250" MaxHeight="300" x:Name="Img" Stretch="Uniform" HorizontalAlignment="Center" VerticalAlignment="Top" RenderOptions.BitmapScalingMode="HighQuality"/>
|
||||
</Grid>
|
||||
</GroupBox>
|
||||
|
||||
|
||||
@@ -67,19 +67,24 @@
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
<localView:CostRatePeriodControl Grid.ColumnSpan="2" CostRateType="{x:Static Shared:CostRatePeriodType.AmountOfMoney}"
|
||||
VM="{Binding NewVM.CostRatePeriods}" Foreground="#FF000000"
|
||||
ValueLabelText="Betrag (€)"
|
||||
ButtonTooltipText="Neuen Betrag hinzufügen" />
|
||||
|
||||
<Label Content="Position" Grid.Column="0" Grid.Row="1" HorizontalAlignment="Left" Margin="-2,0,0,0"/>
|
||||
<dxe:SpinEdit MinValue="0" Margin="3" IsFloatValue="False" Grid.Column="1" Grid.Row="1" Height="23" EditValue="{Binding Path=NewVM.Position, UpdateSourceTrigger=PropertyChanged}" />
|
||||
|
||||
|
||||
<Label Grid.Column="0"
|
||||
Grid.Row="1"
|
||||
Grid.Row="2"
|
||||
Content="Abrechnungsintervall" Margin="3,6,3,0" Padding="0"
|
||||
/>
|
||||
<ComboBox x:Name="combo_approvedIntervall"
|
||||
HorizontalAlignment="Stretch"
|
||||
Margin="3" Grid.Row="1"
|
||||
Margin="3" Grid.Row="2"
|
||||
ItemsSource="{x:Static core:EnumTranslations.AccountingInterval2Translations}"
|
||||
SelectedValue="{Binding NewVM.AccountingInterval, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
|
||||
SelectedValuePath="Key"
|
||||
@@ -99,6 +104,7 @@
|
||||
</DataTemplate>
|
||||
</dxg:GridColumn.CellTemplate>
|
||||
</dxg:GridColumn>
|
||||
<dxg:GridColumn x:Name="column_position" FieldName="Position" Header="Position" Width="70" />
|
||||
<dxg:GridColumn FieldName="Name" Header="Bezeichnung" Width="200" />
|
||||
<dxg:GridColumn FieldName="Abbreviation" Header="Kürzel" Width="100" />
|
||||
<dxg:GridColumn FieldName="Percentage" Header="max. Anteil (%)" Width="100" />
|
||||
@@ -113,7 +119,7 @@
|
||||
</ControlTemplate>
|
||||
</dxg:GridColumn.EditTemplate>
|
||||
</dxg:GridColumn>
|
||||
<dxg:GridColumn x:Name="column_interval" FieldName="AccountingInterval" Header="Abrechnungsintervall" Width="130" />
|
||||
<dxg:GridColumn x:Name="column_interval" FieldName="AccountingInterval" Header="Abrechnungsintervall" Width="130" />
|
||||
</dxg:GridControl.Columns>
|
||||
<dxg:GridControl.View>
|
||||
<dxg:TableView AutoWidth="true" ShowGroupPanel="False" ShowGroupedColumns="false" ShowTotalSummary="False" NavigationStyle="Cell" />
|
||||
|
||||
@@ -32,6 +32,11 @@ namespace BeWo.View.Detail
|
||||
// combo_approvedvisibility.SelectedIndex = 1;
|
||||
|
||||
column_interval.EditSettings = new ComboBoxEditSettings { ItemsSource = EnumTranslations.AccountingInterval2Translations, DisplayMember = "Value", ValueMember = "Key" };
|
||||
|
||||
if (pViewModel.VMList.Count > 0)
|
||||
{
|
||||
ViewModel.NewVM.Position = pViewModel.VMList.Max(s => s.Position) + 1;
|
||||
}
|
||||
}
|
||||
|
||||
public override bool IsDirty
|
||||
@@ -116,6 +121,11 @@ namespace BeWo.View.Detail
|
||||
if (ValidationTrigger.Validate(this))
|
||||
{
|
||||
ViewModel.AddNewVMToList();
|
||||
|
||||
if (ViewModel.VMList.Count > 0)
|
||||
{
|
||||
ViewModel.NewVM.Position = ViewModel.VMList.Max(s => s.Position) + 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -30,11 +30,12 @@
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
<Label Grid.Column="0" Grid.Row="0">Bezeichnung</Label>
|
||||
<TextBox Grid.Column="1" Grid.Row="0" Margin="3" Height="23" Text="{val:ValidationBinding Path=NewVM.Name, UpdateSourceTrigger=PropertyChanged}" />
|
||||
<Label Grid.Column="2" Grid.Row="0">Kategorie</Label>
|
||||
<ComboBox Name="combobox_categories" Grid.Column="3" Grid.Row="0" Height="23" ItemsSource="{Binding Path=PossibleCategories, Mode=OneWay}" Margin="3" SelectedItem="{val:ValidationBinding Path=NewVM.ServiceCategory}">
|
||||
<ComboBox Name="combobox_categories" Grid.Column="3" Grid.Row="0" Height="23" ItemsSource="{Binding Path=PossibleCategories, Mode=OneWay}" Margin="3" SelectedItem="{val:ValidationBinding Path=NewVM.ServiceCategory}" SelectionChanged="Combobox_categories_OnSelected">
|
||||
<ComboBox.Resources>
|
||||
<DataTemplate x:Key="DropDownItemTemplate">
|
||||
<Grid>
|
||||
@@ -58,7 +59,12 @@
|
||||
</Style>
|
||||
</ComboBox.ItemContainerStyle>
|
||||
</ComboBox>
|
||||
</Grid>
|
||||
|
||||
<Label Content="Position" Grid.Column="0" Grid.Row="1" HorizontalAlignment="Left"/>
|
||||
|
||||
<dxe:SpinEdit MinValue="0" Margin="3" IsFloatValue="False" Grid.Column="1" Grid.Row="1" Height="23" EditValue="{Binding Path=NewVM.Position, UpdateSourceTrigger=PropertyChanged}" />
|
||||
|
||||
</Grid>
|
||||
|
||||
<Border Grid.Row="0" Grid.Column="1" Margin="10,3,3,3" BorderThickness="1,0,0,0" BorderBrush="#FF888888" Padding="3,0,0,0">
|
||||
<Grid>
|
||||
@@ -100,18 +106,19 @@
|
||||
</DataTemplate>
|
||||
</dxg:GridColumn.CellTemplate>
|
||||
</dxg:GridColumn>
|
||||
<dxg:GridColumn FieldName="Position" Header="Position" Width="70" />
|
||||
<dxg:GridColumn FieldName="Name" Header="Bezeichnung" Width="200" />
|
||||
<dxg:GridColumn x:Name="column_category" FieldName="ServiceCategory" Header="Kategorie" Width="200" />
|
||||
<dxg:GridColumn x:Name="column_costrateperiods" FieldName="CurrentAmount.CostRateValue" Header="Betrag" Width="60" EditSettings="{dxe:TextSettings DisplayFormat=c, EditFormat=c}">
|
||||
<dxg:GridColumn.EditTemplate>
|
||||
<ControlTemplate>
|
||||
<Button x:Name="PART_Editor" BorderThickness="0" Style="{x:Null}" Height="20" HorizontalAlignment="Stretch" Click="PART_Editor_Click">
|
||||
<TextBlock Text="{Binding Value, Converter={StaticResource StringFormatConverter}, ConverterParameter='{}{0:c}'}" TextWrapping="Wrap" />
|
||||
</Button>
|
||||
</ControlTemplate>
|
||||
</dxg:GridColumn.EditTemplate>
|
||||
</dxg:GridColumn>
|
||||
<dxg:GridColumn x:Name="column_interval" FieldName="AccountingInterval" Header="Abrechnungsintervall" Width="130" />
|
||||
<dxg:GridColumn x:Name="column_category" FieldName="ServiceCategory" Header="Kategorie" Width="200" SortOrder="Ascending" />
|
||||
<dxg:GridColumn x:Name="column_costrateperiods" FieldName="CurrentAmount.CostRateValue" Header="Betrag" Width="60" EditSettings="{dxe:TextSettings DisplayFormat=c, EditFormat=c}">
|
||||
<dxg:GridColumn.EditTemplate>
|
||||
<ControlTemplate>
|
||||
<Button x:Name="PART_Editor" BorderThickness="0" Style="{x:Null}" Height="20" HorizontalAlignment="Stretch" Click="PART_Editor_Click">
|
||||
<TextBlock Text="{Binding Value, Converter={StaticResource StringFormatConverter}, ConverterParameter='{}{0:c}'}" TextWrapping="Wrap" />
|
||||
</Button>
|
||||
</ControlTemplate>
|
||||
</dxg:GridColumn.EditTemplate>
|
||||
</dxg:GridColumn>
|
||||
<dxg:GridColumn x:Name="column_interval" FieldName="AccountingInterval" Header="Abrechnungsintervall" Width="130" />
|
||||
</dxg:GridControl.Columns>
|
||||
<dxg:GridControl.View>
|
||||
<dxg:TableView AutoWidth="true" ShowGroupPanel="False" ShowGroupedColumns="false" ShowTotalSummary="False" NavigationStyle="Cell" />
|
||||
|
||||
@@ -125,5 +125,36 @@ namespace BeWo.View.Detail
|
||||
|
||||
popup_costrateperiods.IsOpen = false;
|
||||
}
|
||||
|
||||
private void Combobox_categories_OnSelected(object sender, RoutedEventArgs e)
|
||||
{
|
||||
|
||||
List<ServiceDescriptionVM> liste = new List<ServiceDescriptionVM>();
|
||||
|
||||
|
||||
string auswahl = combobox_categories.SelectedItem.ToString();
|
||||
|
||||
if (ViewModel.VMList.Count > 0)
|
||||
{
|
||||
foreach (var x in ViewModel.VMList)
|
||||
{
|
||||
if (auswahl.Equals(x.CategoryName))
|
||||
{
|
||||
liste.Add(x);
|
||||
}
|
||||
}
|
||||
|
||||
if(liste.Count > 0){
|
||||
var abx = liste.Max(s => s.Position)+1;
|
||||
|
||||
ViewModel.NewVM.Position = abx;
|
||||
}
|
||||
else
|
||||
{
|
||||
ViewModel.NewVM.Position = ViewModel.NewVM.Position + 1;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -666,7 +666,7 @@
|
||||
<Grid x:Name="grid_serviceaccountings">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="*" />
|
||||
<!--<RowDefinition Height="*" />-->
|
||||
<RowDefinition Height="Auto" />
|
||||
|
||||
</Grid.RowDefinitions>
|
||||
<GroupBox Header="Definierte Leistungen" Style="{DynamicResource ObjectEditGroupBox}">
|
||||
@@ -719,8 +719,24 @@
|
||||
</TreeView.Resources>
|
||||
</TreeView>
|
||||
</GroupBox>-->
|
||||
</Grid>
|
||||
</ScrollViewer>
|
||||
|
||||
<StackPanel Grid.Row="1" Orientation="Horizontal">
|
||||
<Button Margin="10 3 0 0"
|
||||
Name="button_checkAllLeistungen" Click="button_checkAllLeistungen_Click"
|
||||
HorizontalAlignment="Left">Alle auswählen</Button>
|
||||
<Button Margin="10 3 0 0"
|
||||
Name="button_uncheckAllLeistungen" Click="button_uncheckAllLeistungen_Click"
|
||||
HorizontalAlignment="Left">Alle abwählen</Button>
|
||||
<Button Margin="10 3 0 0"
|
||||
Name="button_aufklappenAllLeistungen" Click="button_aufklappenAllLeistungen_Click"
|
||||
HorizontalAlignment="Left">Alle aufklappen</Button>
|
||||
<Button Margin="10 3 0 0"
|
||||
Name="button_zuklappenAllLeistungen" Click="button_zuklappenAllLeistungen_Click"
|
||||
HorizontalAlignment="Left">Alle zuklappen</Button>
|
||||
</StackPanel>
|
||||
|
||||
</Grid>
|
||||
</ScrollViewer>
|
||||
</TabItem>
|
||||
<TabItem Header="Ziele" Name="tabitem_goals">
|
||||
<Grid>
|
||||
@@ -793,6 +809,12 @@
|
||||
<Button Margin="10 3 0 0"
|
||||
Name="button_uncheckAllGoals" Click="button_uncheckAllGoals_Click"
|
||||
HorizontalAlignment="Left">Alle abwählen</Button>
|
||||
<Button Margin="10 3 0 0"
|
||||
Name="button_aufklappenAllGoals" Click="button_aufklappenAllGoals_Click"
|
||||
HorizontalAlignment="Left">Alle aufklappen</Button>
|
||||
<Button Margin="10 3 0 0"
|
||||
Name="button_zuklappenAllGoals" Click="button_zuklappenAllGoals_Click"
|
||||
HorizontalAlignment="Left">Alle zuklappen</Button>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</TabItem>
|
||||
|
||||
@@ -1177,6 +1177,68 @@ namespace BeWo.View.Detail
|
||||
CheckAllGoalTreeItems(false);
|
||||
}
|
||||
|
||||
private void button_aufklappenAllGoals_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
SwitchAllGoalTreeItems(true);
|
||||
}
|
||||
|
||||
private void button_zuklappenAllGoals_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
SwitchAllGoalTreeItems(false);
|
||||
}
|
||||
|
||||
private void button_checkAllLeistungen_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
CheckAllLeistungTreeItems(true);
|
||||
}
|
||||
|
||||
private void button_uncheckAllLeistungen_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
CheckAllLeistungTreeItems(false);
|
||||
}
|
||||
|
||||
private void button_aufklappenAllLeistungen_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
SwitchAllLeistungTreeItems(true);
|
||||
}
|
||||
|
||||
private void button_zuklappenAllLeistungen_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
SwitchAllLeistungTreeItems(false);
|
||||
}
|
||||
|
||||
private void CheckAllLeistungTreeItems(bool check)
|
||||
{
|
||||
var allItems = treeview_serviceAccountings.ItemsSource as IList<ServiceCategoryTreeItem>;
|
||||
|
||||
foreach (var item in allItems)
|
||||
{
|
||||
item.IsChecked = check;
|
||||
}
|
||||
}
|
||||
|
||||
private void SwitchAllLeistungTreeItems(bool check)
|
||||
{
|
||||
Style stylee = new Style
|
||||
{
|
||||
TargetType = typeof(TreeViewItem)
|
||||
};
|
||||
|
||||
stylee.Setters.Add(new Setter(TreeViewItem.IsExpandedProperty,check));
|
||||
treeview_serviceAccountings.ItemContainerStyle = stylee;
|
||||
}
|
||||
|
||||
private void SwitchAllGoalTreeItems(bool check)
|
||||
{
|
||||
Style stylee = new Style
|
||||
{
|
||||
TargetType = typeof(TreeViewItem)
|
||||
};
|
||||
|
||||
stylee.Setters.Add(new Setter(TreeViewItem.IsExpandedProperty, check));
|
||||
treeview_Goals.ItemContainerStyle = stylee;
|
||||
}
|
||||
|
||||
private void CheckAllGoalTreeItems(bool check)
|
||||
{
|
||||
var allItems = treeview_Goals.ItemsSource as IList<SupportConceptGoalTreeItem>;
|
||||
@@ -1187,6 +1249,7 @@ namespace BeWo.View.Detail
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
private void button_openAddBetreuungsschluessel_Click(object sender, RoutedEventArgs e)
|
||||
|
||||
@@ -1210,8 +1210,8 @@ namespace BeWo.View
|
||||
(ThreadStart) delegate
|
||||
{
|
||||
chatView.SetServerStats("Verbunden");
|
||||
|
||||
chatView.StatusSetting.SelectedIndex = 0;
|
||||
|
||||
chatView.RadioButtonOnline.IsChecked = true;
|
||||
chatView.ButtonAlarmLabel.Visibility = Visibility.Collapsed;
|
||||
});
|
||||
|
||||
@@ -1233,7 +1233,7 @@ namespace BeWo.View
|
||||
(ThreadStart) delegate
|
||||
{
|
||||
chatView.SetServerStats("Zurzeit nicht Verbunden");
|
||||
chatView.StatusSetting.SelectedIndex = 1;
|
||||
chatView.RadioButtonOffline.IsChecked = true;
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1403,7 +1403,7 @@ namespace BeWo.View
|
||||
{
|
||||
if (chatView != null)
|
||||
{
|
||||
chatView.StatusSetting.SelectedIndex = 1;
|
||||
chatView.RadioButtonOffline.IsChecked = true;
|
||||
chatView.setConnectionLostIcon();
|
||||
}
|
||||
|
||||
@@ -1470,7 +1470,7 @@ namespace BeWo.View
|
||||
|
||||
if (chatView == null)
|
||||
{
|
||||
SaveAnkommendeServerMeldungen.Add(zaehler, messagePaket); // muss noch ordnungsgemäß gesetzt werden
|
||||
SaveAnkommendeServerMeldungen.Add(zaehler, messagePaket);
|
||||
zaehler++;
|
||||
}
|
||||
else
|
||||
@@ -1492,7 +1492,7 @@ namespace BeWo.View
|
||||
zaehler = 1;
|
||||
WaitForMsFromServer();
|
||||
}
|
||||
//original
|
||||
|
||||
}
|
||||
WaitForMsFromServer();
|
||||
}
|
||||
@@ -1580,15 +1580,13 @@ namespace BeWo.View
|
||||
|
||||
case DataIdentifier.Message:
|
||||
|
||||
UebergebeNachricht(paket.ChatMessage, person[0].FirstName,
|
||||
persoid, paket.DataIdentifier, paket.RecipientPersonOid);
|
||||
UebergebeNachricht(paket.ChatMessage, person[0].FirstName,persoid);
|
||||
|
||||
break;
|
||||
|
||||
case DataIdentifier.Team:
|
||||
|
||||
UebergebeNachricht(paket.ChatMessage, person[0].FirstName + " " + person[0].LastName,
|
||||
persoid, paket.DataIdentifier, paket.RecipientPersonOid);
|
||||
UebergebeTeamNachricht(paket.ChatMessage, person[0].FirstName + " " + person[0].LastName,paket.RecipientPersonOid);
|
||||
|
||||
break;
|
||||
}
|
||||
@@ -1646,91 +1644,37 @@ namespace BeWo.View
|
||||
}
|
||||
|
||||
|
||||
public void UebergebeNachricht(String text,String name, long personoid ,DataIdentifier team, long empfaenger)
|
||||
public void UebergebeNachricht(String text,String name, long personoid)
|
||||
{
|
||||
try
|
||||
{
|
||||
Dispatcher.Invoke(
|
||||
DispatcherPriority.Normal,
|
||||
(ThreadStart) delegate
|
||||
{
|
||||
if (miniChatViewList.ContainsKey(personoid) && team != DataIdentifier.Team)
|
||||
{
|
||||
if (chatView.AktChatUser.Items.Count > 0)
|
||||
{
|
||||
KontaktlistBuilder curItem = (KontaktlistBuilder)chatView.AktChatUser.Items[0];
|
||||
{
|
||||
if (chatView.AktChatUser.Items.Count > 0)
|
||||
{
|
||||
KontaktlistBuilder curItem = (KontaktlistBuilder)chatView.AktChatUser.Items[0];
|
||||
|
||||
if (chatView.Visibility == Visibility.Collapsed &&
|
||||
miniChatViewList[personoid].Visibility == Visibility.Collapsed)
|
||||
{
|
||||
miniChatViewList[personoid].Visibility = Visibility.Visible;
|
||||
miniChatViewList[personoid].SetText(text, 1);
|
||||
}
|
||||
else if (miniChatViewList[personoid].Visibility == Visibility.Collapsed && chatView.Visibility == Visibility.Visible && curItem.EmpfaengerOid.Equals(personoid))
|
||||
{
|
||||
chatView.SetText(text, name, personoid);
|
||||
}
|
||||
else if (miniChatViewList[personoid].Visibility == Visibility.Collapsed && !curItem.EmpfaengerOid.Equals(personoid))
|
||||
{
|
||||
miniChatViewList[personoid].Visibility = Visibility.Visible;
|
||||
miniChatViewList[personoid].SetText(text, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
miniChatViewList[personoid].AppendTextwhileViewOpen(text, 1);
|
||||
}
|
||||
if (chatView.Visibility == Visibility.Visible && curItem.EmpfaengerOid.Equals(personoid))
|
||||
{
|
||||
chatView.SetText(text, name, personoid);
|
||||
}
|
||||
else
|
||||
else if (!curItem.EmpfaengerOid.Equals(personoid))
|
||||
{
|
||||
if (chatView.Visibility == Visibility.Collapsed &&
|
||||
miniChatViewList[personoid].Visibility == Visibility.Collapsed)
|
||||
{
|
||||
miniChatViewList[personoid].Visibility = Visibility.Visible;
|
||||
miniChatViewList[personoid].SetText(text, 1);
|
||||
}
|
||||
else if (miniChatViewList[personoid].Visibility == Visibility.Collapsed && chatView.Visibility == Visibility.Visible)
|
||||
{
|
||||
miniChatViewList[personoid].Visibility = Visibility.Visible;
|
||||
miniChatViewList[personoid].SetText(text, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
miniChatViewList[personoid].AppendTextwhileViewOpen(text, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (chatView.AktChatUser.Items.Count > 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(BeWoApp.LoggedOnUser.Employee.PersonOid));
|
||||
|
||||
foreach (var dc in zugehorigkeit)
|
||||
{
|
||||
if (dc.TeamOid == curItem.EmpfaengerOid)
|
||||
{
|
||||
chatView.SetText(text, name, dc.TeamOid);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(team == DataIdentifier.Team && (!curItem.EmpfaengerOid.Equals(empfaenger)))
|
||||
{
|
||||
var zugehorigkeit = ServiceFacade.DoEmployeeServiceSync(s => s.GetTeamOidsByEmployee(BeWoApp.LoggedOnUser.Employee.PersonOid));
|
||||
|
||||
foreach (var dc in zugehorigkeit)
|
||||
{
|
||||
if (dc.TeamOid == empfaenger)
|
||||
{
|
||||
chatView.SetTeamAnzahlErhalteneNachricht(dc.TeamOid, ChatType.Team);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
chatView.SetAnzahlErhalteneNachricht(personoid);
|
||||
}
|
||||
else if(chatView.Visibility == Visibility.Collapsed && curItem.EmpfaengerOid.Equals(personoid))
|
||||
{
|
||||
//Christian hier muss dein Kramm hin du wolltest die nachricht ja speziell anzeigen lassen
|
||||
miniChatViewList[personoid].Visibility = Visibility.Visible;
|
||||
miniChatViewList[personoid].SetText(text, 1);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
chatView.SetAnzahlErhalteneNachricht(personoid);
|
||||
}
|
||||
});
|
||||
}
|
||||
catch (Exception e)
|
||||
@@ -1740,6 +1684,84 @@ namespace BeWo.View
|
||||
}
|
||||
|
||||
|
||||
public void UebergebeTeamNachricht(String text, String name , long empfaenger)
|
||||
{
|
||||
try
|
||||
{
|
||||
Dispatcher.Invoke(
|
||||
DispatcherPriority.Normal,
|
||||
(ThreadStart) delegate
|
||||
{
|
||||
if (chatView.AktChatUser.Items.Count > 0)
|
||||
{
|
||||
KontaktlistBuilder curItem = (KontaktlistBuilder) chatView.AktChatUser.Items[0];
|
||||
|
||||
if (curItem.TypeChat == ChatType.Team && curItem.EmpfaengerOid.Equals(empfaenger) && chatView.Visibility == Visibility.Visible)
|
||||
{
|
||||
var zugehorigkeit =
|
||||
ServiceFacade.DoEmployeeServiceSync(
|
||||
s => s.GetTeamOidsByEmployee(BeWoApp.LoggedOnUser.Employee.PersonOid));
|
||||
|
||||
foreach (var dc in zugehorigkeit)
|
||||
{
|
||||
if (dc.TeamOid == curItem.EmpfaengerOid)
|
||||
{
|
||||
chatView.SetText(text, name, dc.TeamOid);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(!curItem.EmpfaengerOid.Equals(empfaenger))
|
||||
{
|
||||
var zugehorigkeit =
|
||||
ServiceFacade.DoEmployeeServiceSync(
|
||||
s => s.GetTeamOidsByEmployee(BeWoApp.LoggedOnUser.Employee.PersonOid));
|
||||
|
||||
foreach (var dc in zugehorigkeit)
|
||||
{
|
||||
if (dc.TeamOid == empfaenger)
|
||||
{
|
||||
chatView.SetTeamAnzahlErhalteneNachricht(dc.TeamOid, ChatType.Team);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (chatView.Visibility == Visibility.Collapsed && curItem.EmpfaengerOid.Equals(empfaenger) && curItem.TypeChat == ChatType.Team)
|
||||
{
|
||||
var zugehorigkeit =
|
||||
ServiceFacade.DoEmployeeServiceSync(
|
||||
s => s.GetTeamOidsByEmployee(BeWoApp.LoggedOnUser.Employee.PersonOid));
|
||||
|
||||
foreach (var dc in zugehorigkeit)
|
||||
{
|
||||
if (dc.TeamOid == empfaenger)
|
||||
{
|
||||
//Christian hier muss dein Kramm hin du wolltest die nachricht ja speziell anzeigen lassen
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
var zugehorigkeit =
|
||||
ServiceFacade.DoEmployeeServiceSync(
|
||||
s => s.GetTeamOidsByEmployee(BeWoApp.LoggedOnUser.Employee.PersonOid));
|
||||
|
||||
foreach (var dc in zugehorigkeit)
|
||||
{
|
||||
if (dc.TeamOid == empfaenger)
|
||||
{
|
||||
chatView.SetTeamAnzahlErhalteneNachricht(dc.TeamOid, ChatType.Team);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
MessageBox.Show("Team Nachrichtenübermittlung fehlgeschlagen ", "Fehler: 2060 ", MessageBoxButton.OK);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void DeleteLoggedOffUsers(String personname,long personoid)
|
||||
{
|
||||
try
|
||||
@@ -1793,7 +1815,7 @@ namespace BeWo.View
|
||||
{
|
||||
if (!threadstop)
|
||||
{
|
||||
MessageBox.Show("Die verbindung zum Server wurde seitens dem Server unterbrochen", "Info", MessageBoxButton.OK);
|
||||
//MessageBox.Show("Die verbindung zum Server wurde seitens dem Server unterbrochen", "Info", MessageBoxButton.OK);
|
||||
clientSocket.Client.Disconnect(true);
|
||||
clientSocket.Client.Close();
|
||||
clientSocket = null;
|
||||
@@ -1809,7 +1831,7 @@ namespace BeWo.View
|
||||
chatView.ButtonAlarmLabel.Visibility = Visibility.Visible;
|
||||
chatView.SetAllUserOfflineIfNoInet();
|
||||
|
||||
chatView.StatusSetting.SelectedIndex = 1;
|
||||
chatView.RadioButtonOffline.IsChecked = true;
|
||||
chatView.SetServerStats("Verbindung zum Server Unterbrochen");
|
||||
}
|
||||
});
|
||||
@@ -1920,7 +1942,7 @@ namespace BeWo.View
|
||||
}
|
||||
catch (Exception edf)
|
||||
{
|
||||
MessageBox.Show("Beim Versuch ,die verbindung mit dem Server zu trennen, ist ein Fehler unterlaufen. " + edf.Message +"\n"+edf.StackTrace, "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);
|
||||
}
|
||||
}
|
||||
//---------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -20,6 +20,8 @@ namespace BeWo.ViewModel
|
||||
|
||||
public static string PropertyName_Role = "Role";
|
||||
|
||||
public static string PropertyName_Chatpartner = "Chatpartner";
|
||||
|
||||
private CompactCustomerDC _Customer;
|
||||
|
||||
private CompactEmployeeDC _Employee;
|
||||
@@ -28,6 +30,8 @@ namespace BeWo.ViewModel
|
||||
|
||||
private ValueListEntryDC _Role;
|
||||
|
||||
private bool _Chatpartner;
|
||||
|
||||
public CustomerEmployeeRelationVM(CustomerEmployeeRelationDC pDC) : base(pDC, pDC.Employee2CustomerOid == null)
|
||||
{
|
||||
}
|
||||
@@ -95,6 +99,20 @@ namespace BeWo.ViewModel
|
||||
}
|
||||
}
|
||||
|
||||
public bool Chatpartner
|
||||
{
|
||||
get { return _Chatpartner; }
|
||||
set
|
||||
{
|
||||
if (this.AreDifferent(this._Chatpartner, value))
|
||||
{
|
||||
_Chatpartner = value;
|
||||
this.StoreDirtyInformation(this.AreDifferent(this.DataContract.Chatpartner, value), PropertyName_Chatpartner);
|
||||
this.FirePropertyChanged(PropertyName_Chatpartner);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[Validation(ValidationRule = ValidationRules.NotNullOrStringEmpty)]
|
||||
public ValueListEntryDC Role
|
||||
{
|
||||
@@ -119,6 +137,7 @@ namespace BeWo.ViewModel
|
||||
this._Customer = pDataContract.Customer;
|
||||
this._Role = pDataContract.RelationRole;
|
||||
this._Notice = pDataContract.Notice;
|
||||
_Chatpartner = pDataContract.Chatpartner;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -128,6 +147,7 @@ namespace BeWo.ViewModel
|
||||
pDataContract.Customer = this._Customer;
|
||||
pDataContract.RelationRole = this._Role;
|
||||
pDataContract.Notice = this._Notice;
|
||||
pDataContract.Chatpartner = _Chatpartner;
|
||||
|
||||
return pDataContract;
|
||||
}
|
||||
|
||||
@@ -17,5 +17,6 @@ namespace BeWo.ViewModel.ListViewModel
|
||||
{
|
||||
get { return Comparer.ServiceCategoryVMComparer; }
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -120,6 +120,7 @@ namespace BeWo.ViewModel
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public int Position
|
||||
{
|
||||
get { return _Position; }
|
||||
|
||||
@@ -1520,6 +1520,15 @@ namespace BeWo.Data.Access
|
||||
return c2.List<Customer>();
|
||||
}
|
||||
|
||||
public IEnumerable<Employee2Customer> FindAllChatpartnerEmployee2Customer(long pRecipientOid)
|
||||
{
|
||||
var c = CreateCriteriaIsActive<Employee2Customer>()
|
||||
.Add(Restrictions.Eq(Employee2Customer.PropertyName_EmployeeOid, pRecipientOid))
|
||||
.Add(Restrictions.Eq(Employee2Customer.PropertyName_Chatpartner,true));
|
||||
|
||||
return c.List<Employee2Customer>();
|
||||
}
|
||||
|
||||
public IEnumerable<ChatMessage> FindAllChatMessages(long senderOid, long empfaengerOid)
|
||||
{
|
||||
var c = CreateCriteriaIsActive<ChatMessage>()
|
||||
|
||||
@@ -49,7 +49,8 @@ namespace BeWo.Data.Entities
|
||||
public static string PropertyName_CustomerAlias = "CustomerAlias";
|
||||
public static string PropertyName_Pflegegrad = "Pflegegrad";
|
||||
public static string Propertyname_CustomerImage = "CustomerImage";
|
||||
|
||||
public static string Propertyname_Thumbnail = "Thumbnail";
|
||||
|
||||
|
||||
private Auszahlungsintervall _Auszahlungsintervall;
|
||||
private IList<AbsenceTime> _AbsenceTimes;
|
||||
@@ -94,6 +95,7 @@ namespace BeWo.Data.Entities
|
||||
private string _CustomerAlias;
|
||||
private Pflegegrad? _Pflegegrad;
|
||||
private byte[] _CustomerImage;
|
||||
private byte[] _Thumbnail;
|
||||
|
||||
|
||||
|
||||
@@ -661,6 +663,20 @@ namespace BeWo.Data.Entities
|
||||
}
|
||||
}
|
||||
|
||||
public virtual Byte[] Thumbnail
|
||||
{
|
||||
get { return _Thumbnail; }
|
||||
|
||||
set
|
||||
{
|
||||
if (AreDifferent(_Thumbnail, value))
|
||||
{
|
||||
_Thumbnail = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -16,6 +16,8 @@ namespace BeWo.Data.Entities
|
||||
|
||||
public static string PropertyName_ValueList = "ValueList";
|
||||
|
||||
public static string PropertyName_Chatpartner = "Chatpartner";
|
||||
|
||||
private Customer _Customer;
|
||||
|
||||
private long? _CustomerOid;
|
||||
@@ -26,6 +28,8 @@ namespace BeWo.Data.Entities
|
||||
|
||||
private IList<ValueListEntry2Object> _ValueList;
|
||||
|
||||
private bool _Chatpartner;
|
||||
|
||||
public Employee2Customer()
|
||||
{
|
||||
this._Tid = TableID.Employee2Customer;
|
||||
@@ -128,5 +132,17 @@ namespace BeWo.Data.Entities
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public virtual bool Chatpartner
|
||||
{
|
||||
get { return _Chatpartner; }
|
||||
set
|
||||
{
|
||||
if (this.AreDifferent(_Chatpartner, value))
|
||||
{
|
||||
_Chatpartner = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -25,6 +25,7 @@
|
||||
<property column="DebitorNumber" type="String" name="DebitorNumber" />
|
||||
<property column="CostCenter" type="String" name="CostCenter" />
|
||||
<property column="IsAdvisedOrAttended" type="Boolean" name="IsAdvisedOrAttended" />
|
||||
|
||||
|
||||
<property column="DistanceInMeter" type="Int32" name="DistanceInMeter" />
|
||||
|
||||
@@ -42,6 +43,7 @@
|
||||
|
||||
<property column="Pflegegrad" type="BS.Shared.Pflegegrad, BS.Shared" name="Pflegegrad" />
|
||||
<property column="CustomerImage" name="CustomerImage" />
|
||||
<property column="Thumbnail" name="Thumbnail" />
|
||||
|
||||
<bag name="MerkzeichenListe" table="merkzeichen2customer" generic="true" cascade="all" batch-size="250" lazy="false">
|
||||
<key column="CustomerOid" />
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
<property column="SystemEntryID" type="BS.Shared.SystemEntryID, BS.Shared" name="SystemEntryID" />
|
||||
<property column="EmployeeOid" type="Int64" name="EmployeeOid" update="false" insert="false" />
|
||||
<property column="CustomerOid" type="Int64" name="CustomerOid" update="false" insert="false" />
|
||||
<property column="Chatpartner" name="Chatpartner" />
|
||||
|
||||
<many-to-one name="Employee" column="EmployeeOid" class="BeWo.Data.Entities.Employee,BeWo.Data" cascade="none" />
|
||||
<many-to-one name="Customer" column="CustomerOid" class="BeWo.Data.Entities.Customer,BeWo.Data" cascade="none" />
|
||||
|
||||
2
Model/Changes_26_09_2016.txt
Normal file
2
Model/Changes_26_09_2016.txt
Normal file
@@ -0,0 +1,2 @@
|
||||
ALTER TABLE `1234567890`.`employee2customer`
|
||||
ADD COLUMN `Chatpartner` TINYINT(4) NULL DEFAULT 0 COMMENT '' AFTER `SystemEntryID`;
|
||||
2
Model/Changes_29_09_2016.txt
Normal file
2
Model/Changes_29_09_2016.txt
Normal file
@@ -0,0 +1,2 @@
|
||||
ALTER TABLE `1234567890`.`customer`
|
||||
ADD COLUMN `Thumbnail` LONGBLOB NULL DEFAULT NULL COMMENT '' AFTER `CustomerImage`;
|
||||
@@ -1,6 +1,9 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Configuration;
|
||||
using System.Drawing;
|
||||
using System.Drawing.Drawing2D;
|
||||
using System.Drawing.Imaging;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Net;
|
||||
@@ -10,10 +13,13 @@ using System.ServiceModel;
|
||||
using System.ServiceModel.Channels;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Xml;
|
||||
using BeWo.Data.Entities;
|
||||
using BeWo.Service.ServiceContracts;
|
||||
using BeWo.Data;
|
||||
using DevExpress.XtraPrinting.Native;
|
||||
|
||||
namespace BeWo.Service.Core
|
||||
{
|
||||
@@ -176,5 +182,8 @@ namespace BeWo.Service.Core
|
||||
|
||||
return erg;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -181,7 +181,8 @@ namespace BeWo.Service.DCEntityMapper
|
||||
pEntity.MerkzeichenListe = pDataContract.MerkzeichenListe;
|
||||
pEntity.Pflegegrad = pDataContract.Pflegegrad;
|
||||
pEntity.CustomerImage = pDataContract.CustomerImage;
|
||||
|
||||
|
||||
pEntity.Thumbnail = Utils.ErstelleThumbnail(pDataContract.CustomerImage, 200, 200);
|
||||
|
||||
if (pDataContract.TerminationReason == null)
|
||||
{
|
||||
|
||||
@@ -20,6 +20,7 @@ namespace BeWo.Service.DCEntityMapper
|
||||
pDataContract.Employee2CustomerOid = pEntity.Oid;
|
||||
pDataContract.Employee2CustomerVersion = pEntity.Version;
|
||||
pDataContract.Notice = pEntity.Notice;
|
||||
pDataContract.Chatpartner = pEntity.Chatpartner;
|
||||
|
||||
return pDataContract;
|
||||
}
|
||||
@@ -42,6 +43,7 @@ namespace BeWo.Service.DCEntityMapper
|
||||
|
||||
pEntity.Oid = pDataContract.Employee2CustomerOid;
|
||||
pEntity.Notice = pDataContract.Notice;
|
||||
pEntity.Chatpartner = pDataContract.Chatpartner;
|
||||
|
||||
return pEntity;
|
||||
}
|
||||
|
||||
@@ -605,6 +605,10 @@ namespace BeWo.Service.ServiceContracts
|
||||
[OperationContract]
|
||||
Byte[] GetCustomerImage(long customerOid);
|
||||
|
||||
[FaultContract(typeof(BeWoFault))]
|
||||
[OperationContract]
|
||||
Byte[] GetCustomerThumbnail(long customerOid);
|
||||
|
||||
[FaultContract(typeof(BeWoFault))]
|
||||
[OperationContract]
|
||||
List<CustomerAPPCodeDC> GetAllCustomerAppCodes(long pCustomerOid);
|
||||
|
||||
@@ -3146,23 +3146,28 @@ namespace BeWo.Service.ServiceImplementations
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: CompactPersonDCs benutzen
|
||||
public List<CompactCustomerDC> GetAllChatActiveCustomersCompact(long personOid)
|
||||
{
|
||||
try
|
||||
{
|
||||
var customers = DAOFactory.SearchDAO.FindAllChatActiveCustomers();
|
||||
|
||||
var employee = DAOFactory.SearchDAO.FindEmployeeWithPersonOid(personOid);
|
||||
var chatpartner = DAOFactory.SearchDAO.FindAllChatpartnerEmployee2Customer(personOid);
|
||||
|
||||
var customeroids = employee.Employee2CustomerList.Select(s => s.CustomerOid.Value);
|
||||
List<Customer> customerpartner = new List<Customer>();
|
||||
|
||||
foreach (var x in customers)
|
||||
{
|
||||
foreach (var y in chatpartner)
|
||||
{
|
||||
if (x.Oid == y.CustomerOid)
|
||||
{
|
||||
customerpartner.Add(x);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return MapperFactory.CompactCustomerDC_Customer.MapToNewDCs(customers);
|
||||
return MapperFactory.CompactCustomerDC_Customer.MapToNewDCs(customerpartner);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
@@ -3204,7 +3209,7 @@ namespace BeWo.Service.ServiceImplementations
|
||||
{
|
||||
var messages = DAOFactory.SearchDAO.FindAllEmpfängerChatMessages(senderOid, empfaengerOid);
|
||||
|
||||
// var updateGelesen = MapperFactory.ChatMessagesDC_ChatMessages.MapToNewDCs(messages);
|
||||
// var updateGelesen = MapperFactory.ChatMessagesDC_ChatMessages.MapToNewDCs(messages);
|
||||
|
||||
foreach (var read in messages)
|
||||
{
|
||||
@@ -3253,6 +3258,21 @@ namespace BeWo.Service.ServiceImplementations
|
||||
}
|
||||
}
|
||||
|
||||
public Byte[] GetCustomerThumbnail(long customerOid)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
var customer = DAOFactory.GenericDAO.GetByID<Customer>(customerOid);
|
||||
|
||||
return customer.Thumbnail;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
throw Utils.CreateBeWoFaultException(e);
|
||||
}
|
||||
}
|
||||
|
||||
private static String SerializeObject(object obj)
|
||||
{
|
||||
return JsonConvert.SerializeObject(obj, Formatting.Indented, new JsonSerializerSettings { ContractResolver = new ShouldSerializeContractResolver(), ReferenceLoopHandling = ReferenceLoopHandling.Ignore });
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Drawing.Drawing2D;
|
||||
using System.Drawing.Imaging;
|
||||
using System.IO;
|
||||
using System.IO.Compression;
|
||||
using System.Linq;
|
||||
@@ -446,6 +449,93 @@ namespace BS.Shared.Core
|
||||
{
|
||||
return (int)(Object)e;
|
||||
}
|
||||
|
||||
public static byte[] ErstelleThumbnail(byte[] data, int width, int height)
|
||||
{
|
||||
var imageOriginal = CreateImageFromByteArray(data);
|
||||
if (imageOriginal == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
var originalW = imageOriginal.Width;
|
||||
var originalH = imageOriginal.Height;
|
||||
|
||||
DateTime? originRecordDateTime;
|
||||
|
||||
var smallImage = ResizeImage(imageOriginal, new Size(width, height));
|
||||
var smallData = CreateByteArrayFromImage(smallImage);
|
||||
|
||||
smallImage.Dispose();
|
||||
|
||||
return smallData;
|
||||
}
|
||||
|
||||
|
||||
public static Image CreateImageFromByteArray(byte[] data)
|
||||
{
|
||||
try
|
||||
{
|
||||
using (var ms = new MemoryStream(data))
|
||||
{
|
||||
ms.Position = 0;
|
||||
var image = Image.FromStream(ms);
|
||||
return image;
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public static Image ResizeImage(Image original, Size size)
|
||||
{
|
||||
var newSize = CalcSize(original.Width, original.Height, size.Width, size.Height);
|
||||
|
||||
var newImage = new Bitmap(newSize.Width, newSize.Height);
|
||||
|
||||
using (var graphicsHandle = Graphics.FromImage(newImage))
|
||||
{
|
||||
graphicsHandle.InterpolationMode = InterpolationMode.HighQualityBicubic;
|
||||
graphicsHandle.DrawImage(original, 0, 0, newSize.Width, newSize.Height);
|
||||
}
|
||||
return newImage;
|
||||
}
|
||||
|
||||
public static byte[] CreateByteArrayFromImage(Image image)
|
||||
{
|
||||
if (image != null)
|
||||
{
|
||||
using (var memoryStream = new MemoryStream())
|
||||
{
|
||||
image.Save(memoryStream, ImageFormat.Jpeg);
|
||||
return memoryStream.ToArray();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private static Size CalcSize(int originalWidth, int originalHeight, int desiredWidth, int desiredHeight)
|
||||
{
|
||||
var percentWidth = desiredWidth / (float)originalWidth;
|
||||
var percentHeight = desiredHeight / (float)originalHeight;
|
||||
var percent = percentHeight < percentWidth ? percentHeight : percentWidth;
|
||||
|
||||
var width = (int)Math.Round(originalWidth * percent, MidpointRounding.AwayFromZero);
|
||||
var height = (int)Math.Round(originalHeight * percent, MidpointRounding.AwayFromZero);
|
||||
if (width == 0)
|
||||
{
|
||||
width = 1;
|
||||
}
|
||||
if (height == 0)
|
||||
{
|
||||
height = 1;
|
||||
}
|
||||
|
||||
return new Size(width, height);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public struct NullCompareResult
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
namespace BS.Shared.DataContracts
|
||||
using System;
|
||||
|
||||
namespace BS.Shared.DataContracts
|
||||
{
|
||||
public partial class ServiceCategoryDC
|
||||
public partial class ServiceCategoryDC : IComparable
|
||||
{
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
@@ -25,10 +27,21 @@
|
||||
{
|
||||
return this.ServiceCategoryOid.HasValue ? this.GetType().Name.GetHashCode() ^ this.ServiceCategoryOid.GetHashCode() : base.GetHashCode();
|
||||
}
|
||||
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return this.Name;
|
||||
}
|
||||
|
||||
public int CompareTo(object obj)
|
||||
{
|
||||
var category2 = obj as ServiceCategoryDC;
|
||||
if (category2 == null || String.IsNullOrEmpty(category2.Name))
|
||||
return -1;
|
||||
if (String.IsNullOrEmpty(Name))
|
||||
return 1;
|
||||
return Name.CompareTo(category2.Name);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -24,5 +24,9 @@ namespace BS.Shared.DataContracts
|
||||
|
||||
[DataMember]
|
||||
public ValueListEntryDC RelationRole { get; set; }
|
||||
|
||||
[DataMember]
|
||||
public bool Chatpartner { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
@@ -99,6 +99,7 @@
|
||||
<Reference Include="System.Core">
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Runtime.Serialization">
|
||||
<RequiredTargetFramework>3.0</RequiredTargetFramework>
|
||||
</Reference>
|
||||
|
||||
Reference in New Issue
Block a user