From 33556e254c0729fce6d54c2659154681c35a1db8 Mon Sep 17 00:00:00 2001 From: Waldi Date: Mon, 19 Sep 2016 08:42:35 +0200 Subject: [PATCH 1/3] update 19.09 --- BeWo/View/ChatView.xaml.cs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/BeWo/View/ChatView.xaml.cs b/BeWo/View/ChatView.xaml.cs index 5f7047ba9..a49ef81fb 100644 --- a/BeWo/View/ChatView.xaml.cs +++ b/BeWo/View/ChatView.xaml.cs @@ -507,19 +507,17 @@ namespace BeWo.View /* 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 +525,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)); } From 83a74dc0b1b20af0ebf280ba3f3453dac45c7365 Mon Sep 17 00:00:00 2001 From: Waldi Date: Mon, 19 Sep 2016 10:11:56 +0200 Subject: [PATCH 2/3] Ungelesene Nachrichten farblich aktzentuiert und bug gefixt --- BeWo/View/ChatView.xaml.cs | 77 ++++++++++++++++++++------------------ 1 file changed, 40 insertions(+), 37 deletions(-) diff --git a/BeWo/View/ChatView.xaml.cs b/BeWo/View/ChatView.xaml.cs index 0eb6bc200..451ec8bb6 100644 --- a/BeWo/View/ChatView.xaml.cs +++ b/BeWo/View/ChatView.xaml.cs @@ -56,6 +56,7 @@ namespace BeWo.View protected List oidspeicher = new List(); protected List teamdc = new List(); 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,7 +506,7 @@ 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)); @@ -583,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(); } @@ -595,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(); @@ -609,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(); @@ -659,7 +663,7 @@ namespace BeWo.View { foreach (var list in ita) { - list.StatusTyp = StatusType.Offline;// "Offline"; + list.StatusTyp = StatusType.Offline; } view.Refresh(); @@ -1032,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 { @@ -1047,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."; } } } @@ -1072,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); } } @@ -1206,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) @@ -1390,16 +1388,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.Orange); + Posi = "Right"; + } + else + { + ChatColor = new SolidColorBrush(Colors.LightGray); + Posi = "Left"; + } } From c99a9e4be3fece093d5c285105a71cf6487e8fea Mon Sep 17 00:00:00 2001 From: Waldi Date: Mon, 19 Sep 2016 14:21:21 +0200 Subject: [PATCH 3/3] Layout anpassungen --- BeWo/View/ChatView.xaml | 86 +++++++++++++++++--------------------- BeWo/View/ChatView.xaml.cs | 25 ++++++----- 2 files changed, 54 insertions(+), 57 deletions(-) diff --git a/BeWo/View/ChatView.xaml b/BeWo/View/ChatView.xaml index 63532b0cc..3a0a92d65 100644 --- a/BeWo/View/ChatView.xaml +++ b/BeWo/View/ChatView.xaml @@ -24,11 +24,11 @@ - + - + @@ -56,27 +53,26 @@ - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + @@ -85,42 +81,38 @@ - --> + --> + - - - - - + + + + - - - - - - - - + + + + + + + + - - - - - - - - + + + + @@ -177,7 +169,7 @@ - + diff --git a/BeWo/View/ChatView.xaml.cs b/BeWo/View/ChatView.xaml.cs index 451ec8bb6..93a7903c2 100644 --- a/BeWo/View/ChatView.xaml.cs +++ b/BeWo/View/ChatView.xaml.cs @@ -1256,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; } } } @@ -1276,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) { @@ -1285,7 +1290,7 @@ namespace BeWo.View } else { - this.Color = new SolidColorBrush(Colors.Orange); //"Beschäftigt" + this.Color = new SolidColorBrush(Colors.Orange); } } @@ -1302,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) { @@ -1310,7 +1315,7 @@ namespace BeWo.View } else { - this.Color = new SolidColorBrush(Colors.Orange); //"Beschäftigt" + this.Color = new SolidColorBrush(Colors.Orange); } } @@ -1321,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) { @@ -1329,7 +1334,7 @@ namespace BeWo.View } else { - _color = new SolidColorBrush(Colors.Orange); //"Beschäftigt" + _color = new SolidColorBrush(Colors.Orange); //Orange } OnPropertyChanged("Lastms"); } } @@ -1353,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) { @@ -1361,7 +1366,7 @@ namespace BeWo.View } else { - _color = new SolidColorBrush(Colors.Orange); //"Beschäftigt" + _color = new SolidColorBrush(Colors.Orange); } //_color = value; @@ -1395,7 +1400,7 @@ namespace BeWo.View }else if (isme) { - ChatColor = new SolidColorBrush(Colors.Orange); + ChatColor = new SolidColorBrush(Colors.DarkOrange); Posi = "Right"; } else