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 8f3dc9c43..93a7903c2 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,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";
+ }
}