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

This commit is contained in:
staccatomamba
2016-09-19 17:13:28 +02:00
2 changed files with 97 additions and 99 deletions

View File

@@ -24,11 +24,11 @@
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<TextBox x:Name="Chatbox" HorizontalAlignment="Left" Margin="205,720,0,10" TextWrapping="Wrap" Text="Nachricht schreiben"
VerticalContentAlignment="Center" Width="432" MinHeight="25" ToolTip="Schreiben Sie hier eine Nachricht hinein" KeyDown="OnKeyDownHandler" GotFocus="OnFocus" Foreground="DarkGray" >
<TextBox x:Name="Chatbox" HorizontalAlignment="Left" Margin="221,720,0,10" TextWrapping="Wrap" Text="Nachricht schreiben"
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"/>
@@ -41,14 +41,11 @@
</Button>
</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 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" >
<ListBox.ItemContainerStyle>
<Style TargetType="ListBoxItem">
<!--<Setter Property="IsEnabled" Value="False" />
<Setter Property="Foreground" Value="Black" />
<Setter Property="Focusable" Value="False"/>-->
<Setter Property="HorizontalAlignment" Value="{Binding Posi}" />
</Style>
</ListBox.ItemContainerStyle>
@@ -56,27 +53,26 @@
<Style TargetType="Border">
<Setter Property="CornerRadius" Value="3"/>
<Setter Property="Padding" Value="10,0,0,0" />
</Style>
</ListBox.Resources>
<ListBox.ItemTemplate>
<DataTemplate>
<Border BorderBrush="{Binding ChatColor}" BorderThickness="1,1,1,1" CornerRadius="8,8,8,8" Background="{Binding ChatColor}">
<DockPanel MinHeight="15" Margin="5" LastChildFill="True" Background="{Binding ChatColor}" >
<StackPanel DockPanel.Dock="Bottom" >
<TextBlock VerticalAlignment="Center" Text="{Binding UserMessage}" MinWidth="0" MaxWidth="500" TextWrapping="Wrap" />
</StackPanel>
<StackPanel DockPanel.Dock="Left" Margin="0,0,0,5">
<TextBlock Text="{Binding Username}" FontWeight="Bold" MaxWidth="150" HorizontalAlignment="Left" TextAlignment="Left" VerticalAlignment="Center"/>
</StackPanel>
<StackPanel DockPanel.Dock="Right" Margin="5,0,0,5">
<TextBlock Text="{Binding SendTime}" MaxWidth="350" HorizontalAlignment="Right" TextAlignment="Right" VerticalAlignment="Center"/>
</StackPanel>
</DockPanel>
<DockPanel MinHeight="15" Margin="5" LastChildFill="True" Background="{Binding ChatColor}" >
<StackPanel DockPanel.Dock="Bottom" >
<TextBlock VerticalAlignment="Center" Text="{Binding UserMessage}" MinWidth="0" MaxWidth="500" TextWrapping="Wrap" />
</StackPanel>
<StackPanel DockPanel.Dock="Left" Margin="0,0,0,5">
<TextBlock Text="{Binding Username}" FontWeight="Bold" MaxWidth="150" HorizontalAlignment="Left" TextAlignment="Left" VerticalAlignment="Center"/>
</StackPanel>
<StackPanel DockPanel.Dock="Right" Margin="5,0,0,5">
<TextBlock Text="{Binding SendTime}" MaxWidth="350" HorizontalAlignment="Right" TextAlignment="Right" VerticalAlignment="Center"/>
</StackPanel>
</DockPanel>
</Border>
</DataTemplate>
</ListBox.ItemTemplate>
@@ -85,42 +81,38 @@
<StackPanel VerticalAlignment="Bottom"/>
</ItemsPanelTemplate>
</ListBox.ItemsPanel>-->
</ListBox.ItemsPanel>-->
</ListBox>
<!--###################################### Liste aller User mit Chat Berechtigung ######################################################-->
<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>
<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.ColumnDefinitions>
<ColumnDefinition Width="35"/>
<ColumnDefinition Width="15"/>
<ColumnDefinition Width="100"/>
<ColumnDefinition Width="20"/>
</Grid.ColumnDefinitions>
<Border BorderThickness="1" CornerRadius="3" Grid.RowSpan="2" Grid.ColumnSpan="4" Background="White" >
<Border.BorderBrush>
<SolidColorBrush Color="Black" />
</Border.BorderBrush>
</Border>
</Grid.ColumnDefinitions>
<Border BorderThickness="0.25" CornerRadius="3" Grid.RowSpan="2" Grid.ColumnSpan="4" Background="White" >
<Border.BorderBrush>
<SolidColorBrush Color="Black" />
</Border.BorderBrush>
</Border>
<Ellipse Width='30' Height='30'>
<Ellipse.Fill>
<ImageBrush ImageSource='{Binding Image}' Stretch='Fill' />
</Ellipse.Fill>
</Ellipse>
<!--################################ Zu Test Zwecken ########################### -->
<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" />
</StackPanel>
<!--############################################################################ -->
<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" />
</StackPanel>
<StackPanel Grid.Column="2" Margin="5" >
<StackPanel Orientation="Horizontal" TextBlock.FontWeight="Bold" >
<TextBlock Text="{Binding Path=Name, FallbackValue=FirstName}" />
@@ -177,7 +169,7 @@
<!-- 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="211,52,0,0" VerticalAlignment="Top" Width="329" ItemTemplate="{DynamicResource DataTemplate2}">
<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">
<Grid>

View File

@@ -56,6 +56,7 @@ namespace BeWo.View
protected List<long> oidspeicher = new List<long>();
protected List<string> teamdc = new List<string>();
protected PropertyGroupDescription groupDescription;
protected bool isOnFocus = false;
protected ContextMenu context;
@@ -233,7 +234,7 @@ namespace BeWo.View
foreach (var variable in ita)
{
if (konbuild.Name.Equals(variable.Name))
variable.StatusTyp = StatusType.Online;// "Online";
variable.StatusTyp = StatusType.Online;
if (variable.TypeChat == ChatType.Team)
{
@@ -241,7 +242,7 @@ namespace BeWo.View
{
if (zug.SimpleDescription.Equals(variable.Name))
{
variable.StatusTyp = StatusType.Online;// "Online";
variable.StatusTyp = StatusType.Online;
}
}
}
@@ -266,7 +267,7 @@ namespace BeWo.View
foreach (var variable in ita)
{
if (konbuild.Name.Equals(variable.Name))
variable.StatusTyp = StatusType.Online; //"Online";
variable.StatusTyp = StatusType.Online;
}
view.Refresh();
@@ -278,7 +279,7 @@ namespace BeWo.View
if (curItem.EmpfaengerOid == personoid)
{
curItem.StatusTyp = StatusType.Online;// "Online";
curItem.StatusTyp = StatusType.Online;
view.Refresh();
}
}
@@ -298,7 +299,7 @@ namespace BeWo.View
{
if (abc.EmpfaengerOid == clientid)
{
abc.StatusTyp = StatusType.Offline;// "Offline";
abc.StatusTyp = StatusType.Offline;
}
}
@@ -313,7 +314,7 @@ namespace BeWo.View
if (curItem.EmpfaengerOid.Equals(clientid))
{
curItem.StatusTyp = StatusType.Offline;// "Offline";
curItem.StatusTyp = StatusType.Offline;
}
}
@@ -335,7 +336,7 @@ namespace BeWo.View
{
if (teamprof.TypeChat == ChatType.Mitarbeiter)
{
if (teamprof.StatusTyp == StatusType.Online) //("Online")
if (teamprof.StatusTyp == StatusType.Online)
{
oidspeicher.Add(teamprof.EmpfaengerOid);
}
@@ -348,7 +349,7 @@ namespace BeWo.View
{
if (tt.TypeChat == ChatType.Team)
{
tt.StatusTyp = StatusType.Offline; //"Offline";
tt.StatusTyp = StatusType.Offline;
}
}
}
@@ -369,7 +370,7 @@ namespace BeWo.View
{
if (tt.TypeChat == ChatType.Team && !teamdc.Contains(tt.Name))
{
tt.StatusTyp = StatusType.Offline;//"Offline";
tt.StatusTyp = StatusType.Offline;
}
}
}
@@ -413,7 +414,7 @@ namespace BeWo.View
{
try
{
if (!AktChatUser.Items.IsEmpty && !Chatbox.Text.Equals("") && !Chatbox.Text.Equals("Nachricht schreiben"))
if (!AktChatUser.Items.IsEmpty && !Chatbox.Text.Equals("") && isOnFocus)
{
KontaktlistBuilder curItem = (KontaktlistBuilder)AktChatUser.Items[0];
@@ -428,6 +429,7 @@ namespace BeWo.View
{
Chatbox.Text = "Nachricht schreiben";
Chatbox.Foreground = new SolidColorBrush(Colors.DarkGray);
isOnFocus = false;
}
}
else
@@ -439,6 +441,7 @@ namespace BeWo.View
{
Chatbox.Text = "Nachricht schreiben";
Chatbox.Foreground = new SolidColorBrush(Colors.DarkGray);
isOnFocus = false;
}
}
else if (Chatbox.Text.Equals(""))
@@ -448,6 +451,7 @@ namespace BeWo.View
{
Chatbox.Text = "Nachricht schreiben";
Chatbox.Foreground = new SolidColorBrush(Colors.DarkGray);
isOnFocus = false;
}
}
}
@@ -502,24 +506,22 @@ namespace BeWo.View
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());
var offklienten = ServiceFacade.DoCustomerServiceSync(s => s.GetAllChatActiveCustomersCompact()); // dieser code muss erweitert werden
/* var employee = ServiceFacade.DoEmployeeServiceSync(
s => s.GetEmployeeWithPersonOid(BeWoApp.LoggedOnUser.Employee.EmployeeOid));
employee.Employee2CustomerList.Select(s => s.CustomerOid.Value);*/
StatusType Goff = StatusType.Offline;//"Offline";
employee.Employee2CustomerList.Select(s => s.CustomerOid.Value);*/
foreach (var team in employeeteamoids)
{
Clientlist.Items.Add(new KontaktlistBuilder(team.Name, Goff, BuildImg(null), team.TeamOid, ChatType.Team));
Clientlist.Items.Add(new KontaktlistBuilder(team.Name, StatusType.Offline, BuildImg(null), 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, Goff,
Clientlist.Items.Add(new KontaktlistBuilder(list.FirstName + " " + list.LastName, StatusType.Offline,
BuildImg(ServiceFacade.DoEmployeeServiceSync(s => s.GetEmployeeImage(list.EmployeeOid))),
list.PersonOid, ChatType.Mitarbeiter));
}
@@ -527,7 +529,7 @@ namespace BeWo.View
foreach (var list in offklienten)
{
Clientlist.Items.Add(new KontaktlistBuilder(list.FirstName + " " + list.LastName, Goff,
Clientlist.Items.Add(new KontaktlistBuilder(list.FirstName + " " + list.LastName, StatusType.Offline,
BuildImg(ServiceFacade.DoCustomerServiceSync(s => s.GetCustomerImage(list.CustomerOid))),
list.PersonOid, ChatType.Klienten,list));
}
@@ -585,7 +587,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)); // "Offline"
ita.Add(new KontaktlistBuilder(var.Name,StatusType.Offline, BuildImg(null), var.TeamOid, ChatType.Team));
view.Refresh();
}
@@ -597,7 +599,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,// "Offline",
ita.Add(new KontaktlistBuilder(var.FirstName + " " + var.LastName,StatusType.Offline,
BuildImg(ServiceFacade.DoEmployeeServiceSync(s => s.GetEmployeeImage(var.EmployeeOid))),
var.PersonOid, ChatType.Mitarbeiter));
view.Refresh();
@@ -611,7 +613,7 @@ namespace BeWo.View
{
if (!idKlientspeicher.Contains(var.PersonOid) && idKlientspeicher.Count <= offklienten.Count)
{
ita.Add(new KontaktlistBuilder(var.FirstName + " " + var.LastName, StatusType.Offline,//"Offline",
ita.Add(new KontaktlistBuilder(var.FirstName + " " + var.LastName, StatusType.Offline,
BuildImg(ServiceFacade.DoCustomerServiceSync(s => s.GetCustomerImage(var.CustomerOid))),
var.PersonOid, ChatType.Klienten,var));
view.Refresh();
@@ -661,7 +663,7 @@ namespace BeWo.View
{
foreach (var list in ita)
{
list.StatusTyp = StatusType.Offline;// "Offline";
list.StatusTyp = StatusType.Offline;
}
view.Refresh();
@@ -1034,9 +1036,7 @@ namespace BeWo.View
serverStream.Write(outStream, 0, outStream.Length);
serverStream.Flush();
Dispatcher.Invoke(
DispatcherPriority.Normal,
(ThreadStart)delegate { ServerStats.Text = "Nachricht erfolgreich gesendet"; });
ServerStats.Text = "Nachricht erfolgreich gesendet";
}
else
{
@@ -1049,12 +1049,8 @@ namespace BeWo.View
{
MessageBox.Show("Beim Senden einer Nachricht zum Server ist ein Fehler aufgetreten. " + xe.Message + "\n" + xe.StackTrace,
"Fehler: 2300 ", MessageBoxButton.OK);
Dispatcher.Invoke(
DispatcherPriority.Normal,
(ThreadStart) // <--- Muss dass nicht Weg
delegate { ServerStats.Text = "Fehler: Die Nachricht konnte nicht gesendet werden."; });
ServerStats.Text = "Fehler: Die Nachricht konnte nicht gesendet werden.";
}
}
}
@@ -1074,7 +1070,7 @@ namespace BeWo.View
}
catch (InvalidOperationException e)
{
MessageBox.Show("Beim Speichern einer Nachricht in die Datenbank ist ein Fehler aufgetreten. " + e.Message + "\n" + e.StackTrace, "Fehler: 2310 ", MessageBoxButton.OK);
MessageBox.Show("Beim Speichern einer Nachricht in die Datenbank ist ein Fehler aufgetreten." + e.Message + "\n" + e.StackTrace, "Fehler: 2310 ", MessageBoxButton.OK);
}
}
@@ -1208,14 +1204,14 @@ namespace BeWo.View
try
{
if (Chatbox.Text.Equals("Nachricht schreiben")) // ----> Es muss geschaut werden, was man möchte
if (Chatbox.Text.Equals("Nachricht schreiben"))
{
Chatbox.Text = "";
Chatbox.Foreground = new SolidColorBrush(Colors.Black);
Chatbox.Foreground = new SolidColorBrush(Colors.Black);
isOnFocus = true;
}
if (emojiView != null)
{
if (emojiView.Visibility == Visibility.Visible)
@@ -1260,6 +1256,11 @@ namespace BeWo.View
else
{
emojiView.Visibility = Visibility.Visible;
var x = EmojiButton.PointToScreen(new Point(0, 0));
emojiView.Left = x.X;
emojiView.Top = x.Y - emojiView.Height - 5;
}
}
}
@@ -1280,8 +1281,8 @@ namespace BeWo.View
if (statustyp == StatusType.Online)
{
this.Color = new SolidColorBrush(Colors.LightGreen);
//Color.Opacity = 0.5;
this.Color = new SolidColorBrush(Colors.Green);
//Color.Opacity = 0.5;
}
else if (statustyp == StatusType.Offline)
{
@@ -1289,7 +1290,7 @@ namespace BeWo.View
}
else
{
this.Color = new SolidColorBrush(Colors.Orange); //"Beschäftigt"
this.Color = new SolidColorBrush(Colors.Orange);
}
}
@@ -1306,7 +1307,7 @@ namespace BeWo.View
if (statustyp == StatusType.Online)
{
this.Color = new SolidColorBrush(Colors.LightGreen);
this.Color = new SolidColorBrush(Colors.Green);
}
else if (statustyp == StatusType.Offline)
{
@@ -1314,7 +1315,7 @@ namespace BeWo.View
}
else
{
this.Color = new SolidColorBrush(Colors.Orange); //"Beschäftigt"
this.Color = new SolidColorBrush(Colors.Orange);
}
}
@@ -1325,7 +1326,7 @@ namespace BeWo.View
if (_statustyp == StatusType.Online)
{
_color = new SolidColorBrush(Colors.LightGreen);
_color = new SolidColorBrush(Colors.Green);
}
else if (_statustyp == StatusType.Offline)
{
@@ -1333,7 +1334,7 @@ namespace BeWo.View
}
else
{
_color = new SolidColorBrush(Colors.Orange); //"Beschäftigt"
_color = new SolidColorBrush(Colors.Orange); //Orange
}
OnPropertyChanged("Lastms"); } }
@@ -1357,7 +1358,7 @@ namespace BeWo.View
{
if (StatusTyp == StatusType.Online)
{
_color = new SolidColorBrush(Colors.LightGreen);
_color = new SolidColorBrush(Colors.Green);
}
else if (StatusTyp == StatusType.Offline)
{
@@ -1365,7 +1366,7 @@ namespace BeWo.View
}
else
{
_color = new SolidColorBrush(Colors.Orange); //"Beschäftigt"
_color = new SolidColorBrush(Colors.Orange);
}
//_color = value;
@@ -1392,16 +1393,21 @@ namespace BeWo.View
SendTime = sendtime;
MessagePersonOid = messagePersonOid;
if (isme)
if (isme && messagePersonOid == 0)
{
ChatColor = new SolidColorBrush(Colors.Orange);
Posi = "Right";
}
else
{
ChatColor = new SolidColorBrush(Colors.LightGray);
Posi = "Left";
}
ChatColor = new SolidColorBrush(Colors.DeepSkyBlue);
Posi = "Center";
}else
if (isme)
{
ChatColor = new SolidColorBrush(Colors.DarkOrange);
Posi = "Right";
}
else
{
ChatColor = new SolidColorBrush(Colors.LightGray);
Posi = "Left";
}
}