diff --git a/BeWo/BeWo.csproj b/BeWo/BeWo.csproj
index 11b0db6f4..ba1910b95 100644
--- a/BeWo/BeWo.csproj
+++ b/BeWo/BeWo.csproj
@@ -271,11 +271,11 @@
Designer
MSBuild:Compile
-
+
Designer
MSBuild:Compile
-
+
Designer
MSBuild:Compile
@@ -451,15 +451,15 @@
Designer
MSBuild:Compile
-
+
MSBuild:Compile
Designer
-
+
MSBuild:Compile
Designer
-
+
MSBuild:Compile
Designer
@@ -569,6 +569,7 @@
+
ProxyLoginView.xaml
@@ -672,6 +673,7 @@
+
@@ -737,10 +739,10 @@
BeWoWindow.xaml
-
+
ChatEmojiView.xaml
-
+
ChatView.xaml
@@ -872,13 +874,13 @@
TextModuleView.xaml
-
+
ChatServiceCustomer.xaml
-
+
ChatServiceEmployee.xaml
-
+
ChatDokumentationsView.xaml
@@ -1980,7 +1982,7 @@
-
+
{8a83c4dc-a0b1-4a51-ae1d-366d7a05b298}
ChatController
@@ -2535,6 +2537,7 @@
+
diff --git a/BeWo/BeWoApp.xaml.cs b/BeWo/BeWoApp.xaml.cs
index 9006428a3..3e74aa8bb 100644
--- a/BeWo/BeWoApp.xaml.cs
+++ b/BeWo/BeWoApp.xaml.cs
@@ -680,8 +680,10 @@ namespace BeWo
SetSettingValue(SettingsType.ApplicationSettings, "LastSelectedServiceRecordTimeInterval", ((int) _AppSettings.LastSelectedServiceRecordTimeInterval).ToString());
SetSettingValue(SettingsType.ApplicationSettings, "ShowAllClients", _AppSettings.ShowAllClients ? "1" : "0");
SetSettingValue(SettingsType.ApplicationSettings, "ShowOnlyMySupportConcepts", _AppSettings.ShowOnlyMySupportConcepts ? "1" : "0");
- SetSettingValue(SettingsType.ApplicationSettings, "ShowOnlyMyClients", _AppSettings.ShowOnlyMyClients ? "1" : "0");
- SetSettingValue(SettingsType.ApplicationSettings, "ShowExpiredSupportConcepts", _AppSettings.ShowExpiredSupportConcepts ? "1" : "0");
+ SetSettingValue(SettingsType.ApplicationSettings, "ShowOnlyTeamSupportConcepts", _AppSettings.ShowOnlyTeamSupportConcepts ? "1" : "0");
+ SetSettingValue(SettingsType.ApplicationSettings, "ShowOnlyMyClients", _AppSettings.ShowOnlyMyClients ? "1" : "0");
+ SetSettingValue(SettingsType.ApplicationSettings, "ShowOnlyTeamClients", _AppSettings.ShowOnlyTeamClients ? "1" : "0");
+ SetSettingValue(SettingsType.ApplicationSettings, "ShowExpiredSupportConcepts", _AppSettings.ShowExpiredSupportConcepts ? "1" : "0");
SetSettingValue(SettingsType.ApplicationSettings, "ShowServiceRecordGridControl", _AppSettings.ShowServiceRecordGridControl ? "1" : "0");
SetSettingValue(SettingsType.ApplicationSettings, "StartupPanelMaximized", _AppSettings.StartupPanelMaximized);
SetSettingValue(SettingsType.ApplicationSettings, "HideServiceRecordInsertedByAndInsertedOn", _AppSettings.HideServiceRecordInsertedByAndInsertedOn ? "1" : "0");
@@ -809,10 +811,16 @@ namespace BeWo
val = GetSettingValue(SettingsType.ApplicationSettings, "ShowOnlyMySupportConcepts");
_AppSettings.ShowOnlyMySupportConcepts = val != "0";
- val = GetSettingValue(SettingsType.ApplicationSettings, "ShowOnlyMyClients");
+ val = GetSettingValue(SettingsType.ApplicationSettings, "ShowOnlyTeamSupportConcepts");
+ _AppSettings.ShowOnlyTeamSupportConcepts = val != "0";
+
+ val = GetSettingValue(SettingsType.ApplicationSettings, "ShowOnlyMyClients");
_AppSettings.ShowOnlyMyClients = val == "1";
- val = GetSettingValue(SettingsType.ApplicationSettings, "ShowServiceRecordGridControl");
+ val = GetSettingValue(SettingsType.ApplicationSettings, "ShowOnlyTeamClients");
+ _AppSettings.ShowOnlyTeamClients = val == "1";
+
+ val = GetSettingValue(SettingsType.ApplicationSettings, "ShowServiceRecordGridControl");
_AppSettings.ShowServiceRecordGridControl = val == "1";
val = GetSettingValue(SettingsType.ApplicationSettings, "ShowExpiredSupportConcepts");
diff --git a/BeWo/Core/BeWoUtils.cs b/BeWo/Core/BeWoUtils.cs
index 480575699..f25125d75 100644
--- a/BeWo/Core/BeWoUtils.cs
+++ b/BeWo/Core/BeWoUtils.cs
@@ -43,6 +43,8 @@ using Image = System.Windows.Controls.Image;
using MessageBox = System.Windows.MessageBox;
using Panel = System.Windows.Controls.Panel;
using System.Windows.Media;
+using BeWo.ownChat;
+using BeWo.PasswortSecurity;
using DevExpress.Xpf.Bars;
using DevExpress.Xpf.DocumentViewer;
using DevExpress.Xpf.Printing.PreviewControl.Bars;
@@ -1861,75 +1863,12 @@ namespace BeWo.Core
BeWoApp.MainControl.EndWaiting();
}
+
public static PasswortSecurityStrength CheckPasswordSecurity(string paswd)
{
- const string zahlen = "0123456789";
- const string grossBuchstaben = "ABCDEFGHIJKLMNOPQRSTUVWXYZÄÖÜẞ";
- const string kleinBuchstaben = "abcdefghijklmnopqrstuvwxyzäöüß";
-
- const string sonderzeichenLevel1 = "\\\"\'µ@€!&/()=?+#*";
- const string sonderzeichenLevel2 = ",.-;:_><|§$%'{[]}´`^°~²³";
+ PasswortSicherheit pwS = new PasswortSicherheit();
- var punkte = 0;
-
- if (paswd.Any(x => grossBuchstaben.Contains(x)))
- {
- punkte++;
- }
-
- if (paswd.Any(x => kleinBuchstaben.Contains(x)))
- {
- punkte++;
- }
-
- if (paswd.Any(x => zahlen.Contains(x)))
- {
- punkte++;
- }
-
- if (paswd.Any(x => sonderzeichenLevel1.Contains(x)))
- {
- punkte++;
- }
-
- if (paswd.Any(x => sonderzeichenLevel2.Contains(x)))
- {
- punkte++;
- }
-
- //passwortlänge
- if (paswd.Length >= 4 && paswd.Length < 7)
- {
- punkte += 1;
- }
-
- if (paswd.Length >= 7 && paswd.Length < 10)
- {
- punkte += 2;
- }
-
- if (paswd.Length >= 10 && paswd.Length < 16)
- {
- punkte += 3;
- }
-
- if (paswd.Length >= 16)
- {
- punkte += 4;
- }
-
- //return rückgabe schwach mittel stark
- if (punkte > 7)
- {
- return PasswortSecurityStrength.Stark;
- }
-
- if (punkte > 5 && punkte <= 7)
- {
- return PasswortSecurityStrength.Mittelmass;
- }
-
- return PasswortSecurityStrength.Schwach;
+ return pwS.PasswortSecurityStaerke(paswd);
}
public static void ShowImageForm(ImageSource source)
diff --git a/BeWo/Core/Config/AppSettings.cs b/BeWo/Core/Config/AppSettings.cs
index a67d40407..d5aae2eb3 100644
--- a/BeWo/Core/Config/AppSettings.cs
+++ b/BeWo/Core/Config/AppSettings.cs
@@ -20,6 +20,8 @@ namespace BeWo.Core.Config
private bool mShowOnlyMySupportConcepts = true;
+ private bool mShowOnlyTeamSupportConcepts = true;
+
private WindowStateType mWindowStateType = WindowStateType.Default;
private ServiceRecordTimeInterval mLastSelectedServiceRecordTimeInterval = ServiceRecordTimeInterval.All;
@@ -148,6 +150,21 @@ namespace BeWo.Core.Config
}
}
+ private bool _showOnlyTeamClients;
+
+ public bool ShowOnlyTeamClients
+ {
+ get { return _showOnlyTeamClients; }
+ set
+ {
+ if (_showOnlyTeamClients != value)
+ {
+ _showOnlyTeamClients = value;
+ IsDirty = true;
+ }
+ }
+ }
+
private bool _showServiceRecordGridControl;
public bool ShowServiceRecordGridControl
@@ -179,6 +196,20 @@ namespace BeWo.Core.Config
}
}
+ public bool ShowOnlyTeamSupportConcepts
+ {
+ get { return mShowOnlyTeamSupportConcepts; }
+
+ set
+ {
+ if (mShowOnlyTeamSupportConcepts != value)
+ {
+ mShowOnlyTeamSupportConcepts = value;
+ IsDirty = true;
+ }
+ }
+ }
+
public bool ZeigeNurMeineTermine
{
get { return mZeigeNurMeineTermine; }
diff --git a/BeWo/PasswortSecurity/PasswortSicherheit.cs b/BeWo/PasswortSecurity/PasswortSicherheit.cs
new file mode 100644
index 000000000..356a7aed4
--- /dev/null
+++ b/BeWo/PasswortSecurity/PasswortSicherheit.cs
@@ -0,0 +1,404 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Media;
+using BS.Shared;
+using BS.Shared.Extensions;
+
+namespace BeWo.PasswortSecurity
+{
+ class PasswortSicherheit
+ {
+ #region Variablen
+
+ private const string zahlen = "0123456789";
+ private const string grossBuchstaben = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
+ private const string kleinBuchstaben = "abcdefghijklmnopqrstuvwxyz";
+
+ private const string grossBuchstabenSonderLevel = "ÄÖÜ";
+ private const string kleinBuchstabenSonderLevel = "äöüß";
+
+ private const string sonderzeichenLevel1 = "\\\"\'µ@€!";
+ private const string sonderzeichenLevel2 = "&/()=?+#*";
+ private const string sonderzeichenLevel3 = ",.-;:_><|";
+ private const string sonderzeichenLevel4 = "§$%'{[]}´";
+ private const string sonderzeichenLevel5 = "`^°~²³";
+
+ private string letztespw = "";
+ private bool retschalter = false;
+ private int distanz = 0;
+
+ int score = 0;
+ int letzterwert = 0;
+ bool schalter = false;
+ List letztewerte = new List();
+
+ #endregion
+
+ #region Passwort Stärke Ermitteln und Anzeigen
+ public Label ErmittleUndZeigePasswortStaerke(string s,Label lblPwAnzeige)
+ {
+ if (!s.IsNullOrEmpty())
+ {
+ string sx = "";
+
+ int i = -1;
+
+ foreach (var item in s)
+ {
+ sx += item.ToString();
+
+ if (sx.Length < letztespw.Length)
+ {
+ retschalter = true;
+ distanz = letztespw.Length - sx.Length;
+ }
+
+ if (!letztespw.Equals(sx))
+ letztespw = sx;
+
+ i = PasswortStaerkeErmittler(sx);
+ }
+
+ return ZeigePwStaerke(i, lblPwAnzeige);
+ }
+ else
+ {
+ score = 0;
+ letzterwert = 0;
+
+ return ZeigePwStaerke(-1, lblPwAnzeige);
+ }
+ }
+
+ private int PasswortStaerkeErmittler(string neuesPwBox)
+ {
+ int i = 0;
+ letzterwert = 0;
+ //############### Score System ############
+
+ if (retschalter == true)
+ {
+ if (distanz == 1)
+ {
+ score -= letztewerte.Last();
+ letztewerte.RemoveAt(letztewerte.Count - 1);
+ }
+ else
+ {
+ for (int s = 0; s < distanz; s++)
+ {
+ score -= letztewerte.Last();
+ letztewerte.RemoveAt(letztewerte.Count - 1);
+ }
+ }
+
+ retschalter = false;
+
+ //letzterwert = 0;
+ }
+ else
+ {
+ //Passwort Längen Bonus Punkte
+ //hier npwb gegen text austauschen und schauen wie es funktioniert
+ if (neuesPwBox.Length >= 6 && neuesPwBox.Length < 9)
+ {
+ score += 1;
+ letzterwert = 1;
+ schalter = true;
+ }
+
+ if (neuesPwBox.Length >= 9 && neuesPwBox.Length < 12)
+ {
+ score += 2;
+ letzterwert = 2;
+ schalter = true;
+ }
+
+ if (neuesPwBox.Length >= 12 && neuesPwBox.Length < 18)
+ {
+ score += 3;
+ letzterwert = 3;
+ schalter = true;
+ }
+
+ if (neuesPwBox.Length >= 18)
+ {
+ score += 4;
+ letzterwert = 4;
+ schalter = true;
+ }
+
+ //Zahlen und Buchstaben
+ if (neuesPwBox.Any(x => zahlen.Contains(x)))
+ {
+ score += 3;
+
+ if (schalter == true)
+ letzterwert += 3;
+ else
+ letzterwert = 3;
+ }
+
+ if (neuesPwBox.Any(x => grossBuchstaben.Contains(x)))
+ {
+ score += 3;
+
+ if (schalter == true)
+ letzterwert += 3;
+ else
+ letzterwert = 3;
+ }
+
+ if (neuesPwBox.Any(x => grossBuchstabenSonderLevel.Contains(x)))
+ {
+ score += 2;
+
+ if (schalter == true)
+ letzterwert += 2;
+ else
+ letzterwert = 2;
+ }
+
+ if (neuesPwBox.Any(x => kleinBuchstaben.Contains(x)))
+ {
+ score += 2;
+
+ if (schalter == true)
+ letzterwert += 2;
+ else
+ letzterwert = 2;
+ }
+
+ if (neuesPwBox.Any(x => kleinBuchstabenSonderLevel.Contains(x)))
+ {
+ score += 2;
+
+ if (schalter == true)
+ letzterwert += 2;
+ else
+ letzterwert = 2;
+ }
+
+ // Sonderzeichen
+
+ if (neuesPwBox.Any(x => sonderzeichenLevel1.Contains(x)))
+ {
+ score += 4;
+
+ if (schalter == true)
+ letzterwert += 4;
+ else
+ letzterwert = 4;
+ }
+
+ if (neuesPwBox.Any(x => sonderzeichenLevel2.Contains(x)))
+ {
+ score += 4;
+
+ if (schalter == true)
+ letzterwert += 4;
+ else
+ letzterwert = 4;
+ }
+
+ if (neuesPwBox.Any(x => sonderzeichenLevel3.Contains(x)))
+ {
+ score += 4;
+
+ if (schalter == true)
+ letzterwert += 4;
+ else
+ letzterwert = 4;
+ }
+
+ if (neuesPwBox.Any(x => sonderzeichenLevel4.Contains(x)))
+ {
+ score += 4;
+
+ if (schalter == true)
+ letzterwert += 4;
+ else
+ letzterwert = 4;
+ }
+
+ if (neuesPwBox.Any(x => sonderzeichenLevel5.Contains(x)))
+ {
+ score += 4;
+
+ if (schalter == true)
+ letzterwert += 4;
+ else
+ letzterwert = 4;
+ }
+
+ letztewerte.Add(letzterwert);
+ }
+
+ //#########################################
+
+ // ########################################### PasswortStärke Bereich ##########################
+ //Sehr Schwach
+ if (score <= 15)
+ {
+ i = 0;
+ }
+
+ //Schwach
+ if (score >= 16 && score <= 55)
+ {
+ i = 1;
+ }
+
+ //Mittelmäßig
+ if (score >= 56 && score <= 115)
+ {
+ i = 2;
+ }
+
+ //Stark
+ if (score >= 116 && score <= 155)
+ {
+ i = 3;
+ }
+
+ //Sehr Stark
+ if (score >= 156)
+ {
+ i = 4;
+ }
+
+ return i;
+ }
+
+ private Label ZeigePwStaerke(int i, Label passwortprüfer)
+ {
+ switch (i)
+ {
+ case -1:
+ passwortprüfer.Visibility = Visibility.Hidden;
+ passwortprüfer.Content = "";
+
+ break;
+ case 0:
+ passwortprüfer.Visibility = Visibility.Visible;
+ passwortprüfer.Foreground = new SolidColorBrush(Colors.Red);
+ passwortprüfer.Content = "Passwortstärke: Sehr schwach";
+
+ break;
+
+ case 1:
+ passwortprüfer.Visibility = Visibility.Visible;
+ passwortprüfer.Foreground = new SolidColorBrush(Colors.OrangeRed);
+ passwortprüfer.Content = "Passwortstärke: Schwach";
+
+ break;
+
+ case 2:
+ passwortprüfer.Visibility = Visibility.Visible;
+ passwortprüfer.Foreground = new SolidColorBrush(Colors.Yellow);
+ passwortprüfer.Content = "Passwortstärke: Mittel";
+
+ break;
+
+ case 3:
+ passwortprüfer.Visibility = Visibility.Visible;
+ passwortprüfer.Foreground = new SolidColorBrush(Colors.Green);
+ passwortprüfer.Content = "Passwortstärke: Stark";
+
+ break;
+
+ case 4:
+ passwortprüfer.Visibility = Visibility.Visible;
+ passwortprüfer.Foreground = new SolidColorBrush(Colors.Green);
+ passwortprüfer.Content = "Passwortstärke: Sehr stark";
+
+ break;
+ }
+
+ return passwortprüfer;
+
+ }
+ #endregion
+
+ #region PasswortStärke des Angemeldeten User Passworts
+ public PasswortSecurityStrength PasswortSecurityStaerke(string s)
+ {
+ if (!s.IsNullOrEmpty())
+ {
+ string sx = "";
+
+ int i = -1;
+
+ foreach (var item in s)
+ {
+ sx += item.ToString();
+
+ if (sx.Length < letztespw.Length)
+ {
+ retschalter = true;
+ distanz = letztespw.Length - sx.Length;
+ }
+
+ if (!letztespw.Equals(sx))
+ letztespw = sx;
+
+ i = PasswortStaerkeErmittler(sx);
+ }
+
+ return ZeigeSecutityStaerke(i);
+ }
+ else
+ {
+ score = 0;
+ letzterwert = 0;
+
+ return ZeigeSecutityStaerke(-1);
+ }
+ }
+
+ private PasswortSecurityStrength ZeigeSecutityStaerke(int i)
+ {
+ PasswortSecurityStrength pwsSec = PasswortSecurityStrength.SehrSchwach;
+
+ switch (i)
+ {
+ case -1:
+ pwsSec = PasswortSecurityStrength.SehrSchwach;
+ break;
+ case 0:
+ pwsSec = PasswortSecurityStrength.Schwach;
+
+ break;
+
+ case 1:
+ pwsSec = PasswortSecurityStrength.Schwach;
+
+ break;
+
+ case 2:
+ pwsSec = PasswortSecurityStrength.Mittelmass;
+
+ break;
+
+ case 3:
+ pwsSec = PasswortSecurityStrength.Stark;
+
+ break;
+
+ case 4:
+ pwsSec = PasswortSecurityStrength.SehrStark;
+
+ break;
+ }
+
+ return pwsSec;
+ }
+ #endregion
+
+ }
+}
diff --git a/BeWo/ServiceProxy/Generated.cs b/BeWo/ServiceProxy/Generated.cs
index 74ec02cd4..c5277dd15 100644
--- a/BeWo/ServiceProxy/Generated.cs
+++ b/BeWo/ServiceProxy/Generated.cs
@@ -174,6 +174,15 @@ namespace BeWo.ServiceProxy
[System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IEmployeeService/GetEmployeebyFullNameBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")]
BS.Shared.DataContracts.EmployeeDC GetEmployeebyFullName(string fullName);
+ [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IEmployeeService/CreateOrUpdateChatBewoMessageSync", ReplyAction="http://tempuri.org/IEmployeeService/CreateOrUpdateChatBewoMessageSyncResponse")]
+ [System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IEmployeeService/CreateOrUpdateChatBewoMessageSyncBeWoFaultFau" +
+ "lt", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")]
+ void CreateOrUpdateChatBewoMessageSync(System.Nullable eOid, string text);
+
+ [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IEmployeeService/GetChatBewoMessageSync", ReplyAction="http://tempuri.org/IEmployeeService/GetChatBewoMessageSyncResponse")]
+ [System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IEmployeeService/GetChatBewoMessageSyncBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")]
+ BS.Shared.DataContracts.ChatBewoMessageSyncDC GetChatBewoMessageSync(System.Nullable eOid);
+
[System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IEmployeeService/ArchiveEmployee", ReplyAction="http://tempuri.org/IEmployeeService/ArchiveEmployeeResponse")]
[System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IEmployeeService/ArchiveEmployeeBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")]
void ArchiveEmployee(long pOid, long pVersion);
@@ -581,6 +590,16 @@ namespace BeWo.ServiceProxy
return base.Channel.GetEmployeebyFullName(fullName);
}
+ public void CreateOrUpdateChatBewoMessageSync(System.Nullable eOid, string text)
+ {
+ base.Channel.CreateOrUpdateChatBewoMessageSync(eOid, text);
+ }
+
+ public BS.Shared.DataContracts.ChatBewoMessageSyncDC GetChatBewoMessageSync(System.Nullable eOid)
+ {
+ return base.Channel.GetChatBewoMessageSync(eOid);
+ }
+
public void ArchiveEmployee(long pOid, long pVersion)
{
base.Channel.ArchiveEmployee(pOid, pVersion);
@@ -1012,6 +1031,10 @@ namespace BeWo.ServiceProxy
public interface ICustomerService
{
+ [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/ICustomerService/GetAllActiveCustomers", ReplyAction="http://tempuri.org/ICustomerService/GetAllActiveCustomersResponse")]
+ [System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/ICustomerService/GetAllActiveCustomersBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")]
+ System.Collections.Generic.List GetAllActiveCustomers();
+
[System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/ICustomerService/GetCustomersById", ReplyAction="http://tempuri.org/ICustomerService/GetCustomersByIdResponse")]
[System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/ICustomerService/GetCustomersByIdBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")]
System.Collections.Generic.List GetCustomersById(System.Collections.Generic.List idList);
@@ -1325,7 +1348,6 @@ namespace BeWo.ServiceProxy
[System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/ICustomerService/GetPersonWithCustomerOid", ReplyAction="http://tempuri.org/ICustomerService/GetPersonWithCustomerOidResponse")]
[System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/ICustomerService/GetPersonWithCustomerOidBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")]
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.CustomerDC))]
- [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.WohnheimDC))]
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.EmployeeDC))]
BS.Shared.DataContracts.PersonDC GetPersonWithCustomerOid(long oid);
@@ -1596,7 +1618,6 @@ namespace BeWo.ServiceProxy
[System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/ICustomerService/InsertNewPerson", ReplyAction="http://tempuri.org/ICustomerService/InsertNewPersonResponse")]
[System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/ICustomerService/InsertNewPersonBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")]
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.CustomerDC))]
- [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.WohnheimDC))]
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.EmployeeDC))]
long InsertNewPerson(BS.Shared.DataContracts.PersonDC pPersonDC);
@@ -1619,7 +1640,6 @@ namespace BeWo.ServiceProxy
[System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/ICustomerService/LoadPerson", ReplyAction="http://tempuri.org/ICustomerService/LoadPersonResponse")]
[System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/ICustomerService/LoadPersonBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")]
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.CustomerDC))]
- [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.WohnheimDC))]
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.EmployeeDC))]
BS.Shared.DataContracts.PersonDC LoadPerson(long pPersonOid);
@@ -1647,6 +1667,10 @@ namespace BeWo.ServiceProxy
[System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/ICustomerService/UpdateAbsenceReasonsBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")]
void UpdateAbsenceReasons(System.Collections.Generic.List pAbsenceReasonDC);
+ [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/ICustomerService/AllowSavingCustomer", ReplyAction="http://tempuri.org/ICustomerService/AllowSavingCustomerResponse")]
+ [System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/ICustomerService/AllowSavingCustomerBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")]
+ string AllowSavingCustomer(BS.Shared.DataContracts.CustomerDC pCustomerDC);
+
[System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/ICustomerService/UpdateCustomer", ReplyAction="http://tempuri.org/ICustomerService/UpdateCustomerResponse")]
[System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/ICustomerService/UpdateCustomerBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")]
long UpdateCustomer(BS.Shared.DataContracts.CustomerDC pCustomerDC);
@@ -1662,7 +1686,6 @@ namespace BeWo.ServiceProxy
[System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/ICustomerService/UpdatePerson", ReplyAction="http://tempuri.org/ICustomerService/UpdatePersonResponse")]
[System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/ICustomerService/UpdatePersonBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")]
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.CustomerDC))]
- [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.WohnheimDC))]
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.EmployeeDC))]
long UpdatePerson(BS.Shared.DataContracts.PersonDC pPersonDC);
@@ -1741,10 +1764,6 @@ namespace BeWo.ServiceProxy
[System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/ICustomerService/ServiceRecordOutOfSupportConceptBeWoFaultFaul" +
"t", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")]
bool ServiceRecordOutOfSupportConcept(BS.Shared.DataContracts.SupportConceptDC pSupportConcept);
-
- [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/ICustomerService/GetAllActiveCustomers", ReplyAction="http://tempuri.org/ICustomerService/GetAllActiveCustomersResponse")]
- [System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/ICustomerService/GetAllActiveCustomersBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")]
- System.Collections.Generic.List GetAllActiveCustomers();
}
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
@@ -1781,6 +1800,11 @@ namespace BeWo.ServiceProxy
{
}
+ public System.Collections.Generic.List GetAllActiveCustomers()
+ {
+ return base.Channel.GetAllActiveCustomers();
+ }
+
public System.Collections.Generic.List GetCustomersById(System.Collections.Generic.List idList)
{
return base.Channel.GetCustomersById(idList);
@@ -2506,6 +2530,11 @@ namespace BeWo.ServiceProxy
base.Channel.UpdateAbsenceReasons(pAbsenceReasonDC);
}
+ public string AllowSavingCustomer(BS.Shared.DataContracts.CustomerDC pCustomerDC)
+ {
+ return base.Channel.AllowSavingCustomer(pCustomerDC);
+ }
+
public long UpdateCustomer(BS.Shared.DataContracts.CustomerDC pCustomerDC)
{
return base.Channel.UpdateCustomer(pCustomerDC);
@@ -2615,11 +2644,6 @@ namespace BeWo.ServiceProxy
{
return base.Channel.ServiceRecordOutOfSupportConcept(pSupportConcept);
}
-
- public System.Collections.Generic.List GetAllActiveCustomers()
- {
- return base.Channel.GetAllActiveCustomers();
- }
}
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
@@ -4247,7 +4271,7 @@ namespace BeWo.ServiceProxy
[System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IOperationsService/CreateNewCustomerAPPCodeDC", ReplyAction="http://tempuri.org/IOperationsService/CreateNewCustomerAPPCodeDCResponse")]
[System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IOperationsService/CreateNewCustomerAPPCodeDCBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")]
- BS.Shared.DataContracts.CustomerAPPCodeDC CreateNewCustomerAPPCodeDC(long customerOid, string kundennummer, string apikey, long userOid);
+ BS.Shared.DataContracts.CustomerAPPCodeDC CreateNewCustomerAPPCodeDC(long customerOid, string kundennummer, string apikey);
[System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IOperationsService/CreateNewChatMessagesDC", ReplyAction="http://tempuri.org/IOperationsService/CreateNewChatMessagesDCResponse")]
[System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IOperationsService/CreateNewChatMessagesDCBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")]
@@ -4271,7 +4295,7 @@ namespace BeWo.ServiceProxy
[System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IOperationsService/CreateNewEmployeeAPPCodeDC", ReplyAction="http://tempuri.org/IOperationsService/CreateNewEmployeeAPPCodeDCResponse")]
[System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IOperationsService/CreateNewEmployeeAPPCodeDCBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")]
- BS.Shared.DataContracts.EmployeeAPPCodeDC CreateNewEmployeeAPPCodeDC(long employeeOid, string kundennummer, string apikey, long userOid);
+ BS.Shared.DataContracts.EmployeeAPPCodeDC CreateNewEmployeeAPPCodeDC(long employeeOid, string kundennummer, string apikey);
[System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IOperationsService/UpdateIsChatActiveEmployeeAPPCodeDC", ReplyAction="http://tempuri.org/IOperationsService/UpdateIsChatActiveEmployeeAPPCodeDCResponse" +
"")]
@@ -4421,17 +4445,13 @@ namespace BeWo.ServiceProxy
[System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IOperationsService/GetLastVertreterBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")]
System.Collections.Generic.List GetLastVertreter(System.Nullable klientenOid);
- [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IOperationsService/GetHandOutPdfForChat", ReplyAction="http://tempuri.org/IOperationsService/GetHandOutPdfForChatResponse")]
- [System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IOperationsService/GetHandOutPdfForChatBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")]
- BS.Shared.DataContracts.PdfChatHandoutDC GetHandOutPdfForChat(string customerId, string apikey);
-
[System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IOperationsService/DeletEmloyeeChatCode", ReplyAction="http://tempuri.org/IOperationsService/DeletEmloyeeChatCodeResponse")]
[System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IOperationsService/DeletEmloyeeChatCodeBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")]
- bool DeletEmloyeeChatCode(string apikey, string kundennummer, long userOid);
+ bool DeletEmloyeeChatCode(string apikey, string kundennummer, long employeeoid);
[System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IOperationsService/DeletCustomerChatCode", ReplyAction="http://tempuri.org/IOperationsService/DeletCustomerChatCodeResponse")]
[System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IOperationsService/DeletCustomerChatCodeBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")]
- bool DeletCustomerChatCode(string apikey, string kundennummer, long userOid);
+ bool DeletCustomerChatCode(string apikey, string kundennummer, long customeroid);
[System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IOperationsService/GetTranslationDictionary", ReplyAction="http://tempuri.org/IOperationsService/GetTranslationDictionaryResponse")]
[System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IOperationsService/GetTranslationDictionaryBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")]
@@ -5057,9 +5077,9 @@ namespace BeWo.ServiceProxy
return base.Channel.InsertSignature(sig);
}
- public BS.Shared.DataContracts.CustomerAPPCodeDC CreateNewCustomerAPPCodeDC(long customerOid, string kundennummer, string apikey, long userOid)
+ public BS.Shared.DataContracts.CustomerAPPCodeDC CreateNewCustomerAPPCodeDC(long customerOid, string kundennummer, string apikey)
{
- return base.Channel.CreateNewCustomerAPPCodeDC(customerOid, kundennummer, apikey, userOid);
+ return base.Channel.CreateNewCustomerAPPCodeDC(customerOid, kundennummer, apikey);
}
public BS.Shared.DataContracts.ChatMessageDC CreateNewChatMessagesDC(long senderOid, long empfängerOid, string message, bool isDeliverd, long teamid, string messageid)
@@ -5082,9 +5102,9 @@ namespace BeWo.ServiceProxy
return base.Channel.FindUnreadChatMessagesForRecipient(personOid);
}
- public BS.Shared.DataContracts.EmployeeAPPCodeDC CreateNewEmployeeAPPCodeDC(long employeeOid, string kundennummer, string apikey, long userOid)
+ public BS.Shared.DataContracts.EmployeeAPPCodeDC CreateNewEmployeeAPPCodeDC(long employeeOid, string kundennummer, string apikey)
{
- return base.Channel.CreateNewEmployeeAPPCodeDC(employeeOid, kundennummer, apikey, userOid);
+ return base.Channel.CreateNewEmployeeAPPCodeDC(employeeOid, kundennummer, apikey);
}
public void UpdateIsChatActiveEmployeeAPPCodeDC(long employeeOid, int activeType)
@@ -5252,19 +5272,14 @@ namespace BeWo.ServiceProxy
return base.Channel.GetLastVertreter(klientenOid);
}
- public BS.Shared.DataContracts.PdfChatHandoutDC GetHandOutPdfForChat(string customerId, string apikey)
+ public bool DeletEmloyeeChatCode(string apikey, string kundennummer, long employeeoid)
{
- return base.Channel.GetHandOutPdfForChat(customerId, apikey);
+ return base.Channel.DeletEmloyeeChatCode(apikey, kundennummer, employeeoid);
}
- public bool DeletEmloyeeChatCode(string apikey, string kundennummer, long userOid)
+ public bool DeletCustomerChatCode(string apikey, string kundennummer, long customeroid)
{
- return base.Channel.DeletEmloyeeChatCode(apikey, kundennummer, userOid);
- }
-
- public bool DeletCustomerChatCode(string apikey, string kundennummer, long userOid)
- {
- return base.Channel.DeletCustomerChatCode(apikey, kundennummer, userOid);
+ return base.Channel.DeletCustomerChatCode(apikey, kundennummer, customeroid);
}
public System.Collections.Generic.Dictionary GetTranslationDictionary()
diff --git a/BeWo/View/Detail/CustomerView.xaml b/BeWo/View/Detail/CustomerView.xaml
index fe36f6662..4c143b020 100644
--- a/BeWo/View/Detail/CustomerView.xaml
+++ b/BeWo/View/Detail/CustomerView.xaml
@@ -1858,7 +1858,7 @@
-
+
diff --git a/BeWo/View/Detail/CustomerView.xaml.cs b/BeWo/View/Detail/CustomerView.xaml.cs
index 59c2b0ee9..bbde8b780 100644
--- a/BeWo/View/Detail/CustomerView.xaml.cs
+++ b/BeWo/View/Detail/CustomerView.xaml.cs
@@ -29,6 +29,7 @@ using DevExpress.Xpf.Editors.Settings;
using DevExpress.Xpf.Grid;
using System.Windows.Media.Imaging;
+using BeWo.ownChat;
using BS.Shared.Translation;
using DevExpress.XtraGrid;
using Binding = System.Windows.Data.Binding;
@@ -368,18 +369,16 @@ namespace BeWo.View.Detail
{
if (this.IsDirty)
{
+ CustomerDC cdc = ViewModel.CommitToDataContract();
+ var message = ServiceFacade.DoCustomerServiceSync(s => s.AllowSavingCustomer(cdc));
+ if (!String.IsNullOrEmpty(message))
+ {
+ MessageBox.Show(message, "Änderungen speichern", MessageBoxButton.OK, MessageBoxImage.Exclamation);
+ return false;
+ }
}
- var valid = base.DoSaveCheck();
-
- if (valid)
- {
- MessageBox.Show("Nix da", "Änderungen speichern", MessageBoxButton.OK, MessageBoxImage.Exclamation);
- return false;
- //ServiceFacade.DoCustomerServiceAsync(s => s.AllowSavingCustomer(cdc), AfterSave);
- }
-
- return valid;
+ return base.DoSaveCheck();
}
diff --git a/BeWo/View/Detail/EmployeeView.xaml b/BeWo/View/Detail/EmployeeView.xaml
index 9e9d4adfd..eabe86295 100644
--- a/BeWo/View/Detail/EmployeeView.xaml
+++ b/BeWo/View/Detail/EmployeeView.xaml
@@ -690,7 +690,7 @@
-
+
diff --git a/BeWo/View/Detail/EmployeeView.xaml.cs b/BeWo/View/Detail/EmployeeView.xaml.cs
index f261ded85..b067179d6 100644
--- a/BeWo/View/Detail/EmployeeView.xaml.cs
+++ b/BeWo/View/Detail/EmployeeView.xaml.cs
@@ -12,6 +12,7 @@ using System.Windows.Media;
using System.Windows.Media.Imaging;
using BeWo.Core;
using BeWo.Core.Service;
+using BeWo.ownChat;
using BeWo.ServiceProxy;
using BeWo.Validation;
using BeWo.ViewModel;
diff --git a/BeWo/View/Detail/UserView.xaml b/BeWo/View/Detail/UserView.xaml
index b4a8fd48a..dc4cd267a 100644
--- a/BeWo/View/Detail/UserView.xaml
+++ b/BeWo/View/Detail/UserView.xaml
@@ -188,6 +188,7 @@
+
@@ -195,11 +196,16 @@
+
-
+
-
+
+
+
+
+
diff --git a/BeWo/View/Detail/UserView.xaml.cs b/BeWo/View/Detail/UserView.xaml.cs
index 14da9e933..dbdce1c11 100644
--- a/BeWo/View/Detail/UserView.xaml.cs
+++ b/BeWo/View/Detail/UserView.xaml.cs
@@ -1,8 +1,12 @@
-using System.ServiceModel;
+using System.Collections.Generic;
+using System.Linq;
+using System.ServiceModel;
using System.Windows;
using System.Windows.Input;
+using System.Windows.Media;
using BeWo.Controls;
using BeWo.Core;
+using BeWo.PasswortSecurity;
using BeWo.ServiceProxy;
using BeWo.ViewModel;
using BS.Shared;
@@ -188,8 +192,8 @@ namespace BeWo.View.Detail
{
string oldPw = passwordbox_editOldPassword.Password;
string newPw = passwordbox_editPassword.Password;
-
- if (string.IsNullOrWhiteSpace(newPw))
+
+ if (string.IsNullOrWhiteSpace(newPw))
{
textblock_editFailures.Text = "Bitte geben Sie ein neues Passwort ein!";
MessageBox.Show(textblock_editFailures.Text, "Ändern des Passworts fehlgeschlagen", MessageBoxButton.OK, MessageBoxImage.Information);
@@ -202,8 +206,17 @@ namespace BeWo.View.Detail
MessageBox.Show(textblock_editFailures.Text, "Ändern des Passworts fehlgeschlagen", MessageBoxButton.OK, MessageBoxImage.Information);
return;
}
+
+ //neu
+ var pwStaerke = BeWoUtils.CheckPasswordSecurity(newPw);
+ if (BeWoApp.AppSettings.IsPasswordSecurityActiv && (pwStaerke == PasswortSecurityStrength.SehrSchwach || pwStaerke == PasswortSecurityStrength.Schwach))
+ {
+ textblock_editFailures.Text = "Das Passwort ist zu schwach!";
+ MessageBox.Show(textblock_editFailures.Text, "Ändern des Passworts fehlgeschlagen", MessageBoxButton.OK, MessageBoxImage.Information);
+ return;
+ }
- if (!BeWoApp.LoggedOnUser.HasRight(UserRightType.UserView_AllowChangePassword))
+ if (!BeWoApp.LoggedOnUser.HasRight(UserRightType.UserView_AllowChangePassword))
{
var result = ServiceFacade.DoUserServiceSync(s => s.CheckPassword(ViewModel.DataContract.UserOid.Value, oldPw, newPw));
@@ -281,5 +294,17 @@ namespace BeWo.View.Detail
() => BeWoUtils.OpenModalViewWindow(cb, this, () => this.Dispatch(
() => BeWoUtils.UpdateAllViews(ViewModel.Employee)))));
}
- }
+
+
+ #region Passwort - Sicherheits - Anzeige
+
+ PasswortSicherheit pwS = new PasswortSicherheit();
+
+ private void Passwordbox_editPassword_OnPasswordChanged(object sender, RoutedEventArgs e)
+ {
+ passwordbox_StaerkeAnzeige = pwS.ErmittleUndZeigePasswortStaerke(passwordbox_editPassword.Password, passwordbox_StaerkeAnzeige);
+ }
+
+ #endregion
+ }
}
\ No newline at end of file
diff --git a/BeWo/View/HomeDragPanelView.xaml b/BeWo/View/HomeDragPanelView.xaml
index e2d93bab1..2cb54bee8 100644
--- a/BeWo/View/HomeDragPanelView.xaml
+++ b/BeWo/View/HomeDragPanelView.xaml
@@ -220,7 +220,7 @@
-
+
diff --git a/BeWo/View/HomeDragPanelView.xaml.cs b/BeWo/View/HomeDragPanelView.xaml.cs
index 8823a85e3..93dd6b74d 100644
--- a/BeWo/View/HomeDragPanelView.xaml.cs
+++ b/BeWo/View/HomeDragPanelView.xaml.cs
@@ -40,6 +40,7 @@ using System.Net.NetworkInformation;
using System.Text;
using System.Text.RegularExpressions;
using System.Windows.Forms;
+using BeWo.ownChat;
using BS.Shared.Core;
using ChatController.HauptKlassen;
using Newtonsoft.Json;
@@ -136,7 +137,7 @@ namespace BeWo.View
private void PruefePasswortStaerke()
{
- if (BeWoApp.PasswortStrength == PasswortSecurityStrength.Schwach)
+ if ( BeWoApp.PasswortStrength == PasswortSecurityStrength.SehrSchwach)
{
PasswortSchloss.Foreground = new SolidColorBrush(Colors.Red);
@@ -146,17 +147,35 @@ namespace BeWo.View
{
if (BeWoApp.AppSettings.IsPasswordSecurityActiv)
{
- MessageBox.Show("Sie benutzen ein schwaches Passwort.\nBitte ändern Sie Ihr Passwort, indem Sie im Startbildschirm oben auf \"Passwort ändern\" klicken.", "Achtung!",
+ MessageBox.Show("Sie benutzen ein sehr schwaches Passwort.\nBitte ändern Sie Ihr Passwort, indem Sie im Startbildschirm oben auf \"Passwort ändern\" klicken.", "Achtung!",
MessageBoxButton.OK,MessageBoxImage.Information);
}
});
- }else if (BeWoApp.PasswortStrength == PasswortSecurityStrength.Mittelmass)
+ }else if (BeWoApp.PasswortStrength == PasswortSecurityStrength.Schwach)
{
- PasswortSchloss.Foreground = new SolidColorBrush(Colors.Yellow);
+ PasswortSchloss.Foreground = new SolidColorBrush(Colors.OrangeRed);
-
- }else if (BeWoApp.PasswortStrength == PasswortSecurityStrength.Stark)
+ this.Dispatcher.BeginInvoke(
+ DispatcherPriority.Normal,
+ (Action)delegate
+ {
+ if (BeWoApp.AppSettings.IsPasswordSecurityActiv)
+ {
+ MessageBox.Show("Sie benutzen ein schwaches Passwort.\nBitte ändern Sie Ihr Passwort, indem Sie im Startbildschirm oben auf \"Passwort ändern\" klicken.", "Achtung!",
+ MessageBoxButton.OK, MessageBoxImage.Information);
+ }
+ });
+ }
+ else if (BeWoApp.PasswortStrength == PasswortSecurityStrength.Mittelmass)
+ {
+ PasswortSchloss.Foreground = new SolidColorBrush(Colors.Yellow);
+ }
+ else if (BeWoApp.PasswortStrength == PasswortSecurityStrength.Stark)
+ {
+ PasswortSchloss.Foreground = new SolidColorBrush(Colors.Green);
+ }
+ else if (BeWoApp.PasswortStrength == PasswortSecurityStrength.SehrStark)
{
PasswortSchloss.Foreground = new SolidColorBrush(Colors.Green);
}
diff --git a/BeWo/View/Navigation/CustomerNavigationView.xaml.cs b/BeWo/View/Navigation/CustomerNavigationView.xaml.cs
index e1289a16e..35526603f 100644
--- a/BeWo/View/Navigation/CustomerNavigationView.xaml.cs
+++ b/BeWo/View/Navigation/CustomerNavigationView.xaml.cs
@@ -32,6 +32,7 @@ namespace BeWo.View.Navigation
public partial class CustomerNavigationView
{
private readonly CheckBox chkShowOnlyMyCustomers;
+ private readonly CheckBox chkShowOnlyTeamCustomers;
private IEnumerable objectList;
private IEnumerable recentList;
@@ -49,14 +50,22 @@ namespace BeWo.View.Navigation
{
FontSize = 12,
Margin = new Thickness(10, 0, 0, 0),
- Content = Translator.Translate("Nur meine Klienten anzeigen"),
+ Content = Translator.Translate("Meine Klienten"),
VerticalAlignment = VerticalAlignment.Center
};
+ chkShowOnlyTeamCustomers = new CheckBox
+ {
+ FontSize = 12,
+ Margin = new Thickness(10, 0, 0, 0),
+ Content = Translator.Translate("Klienten meines Teams"),
+ VerticalAlignment = VerticalAlignment.Center
+ };
var b = FindResource("MainGroupBoxForegroundBrush") as Brush;
if (b != null)
{
chkShowOnlyMyCustomers.Foreground = b;
+ chkShowOnlyTeamCustomers.Foreground = b;
}
if (!BeWoApp.LoggedOnUser.HasRight(UserRightType.CustomerView_View) &&
@@ -70,15 +79,33 @@ namespace BeWo.View.Navigation
chkShowOnlyMyCustomers.IsChecked = BeWoApp.AppSettings.ShowOnlyMyClients;
}
- chkShowOnlyMyCustomers.Click += chkShowOnlyMyCustomerss_Click;
+ if (!BeWoApp.LoggedOnUser.HasRight(UserRightType.CustomerView_View) &&
+ !BeWoApp.LoggedOnUser.HasRight(UserRightType.ViewAll))
+ {
+ chkShowOnlyTeamCustomers.IsChecked = true;
+ chkShowOnlyTeamCustomers.IsEnabled = false;
+ }
+ else
+ {
+ chkShowOnlyTeamCustomers.IsChecked = BeWoApp.AppSettings.ShowOnlyTeamClients;
+ }
+
+ chkShowOnlyMyCustomers.Click += chkShowOnlyMyCustomers_Click;
+ chkShowOnlyTeamCustomers.Click += chkShowOnlyMyCustomers_Click;
+
mainNavigationView.AddControlToSortPanel(chkShowOnlyMyCustomers);
+ mainNavigationView.AddControlToSortPanel(chkShowOnlyTeamCustomers);
UpdateCustomFilter();
}
private CustomFilter CreateNewCustomFilter()
{
- var filter = new CustomerNavigationFilter {ShowOnlyMyCustomers = chkShowOnlyMyCustomers.IsChecked != null && chkShowOnlyMyCustomers.IsChecked.Value};
+ var filter = new CustomerNavigationFilter
+ {
+ ShowOnlyMyCustomers = chkShowOnlyMyCustomers.IsChecked != null && chkShowOnlyMyCustomers.IsChecked.Value,
+ ShowOnlyTeamCustomers = chkShowOnlyTeamCustomers.IsChecked != null && chkShowOnlyTeamCustomers.IsChecked.Value,
+ };
return filter;
}
@@ -93,10 +120,12 @@ namespace BeWo.View.Navigation
mainNavigationView.CustomFilter = CreateNewCustomFilter();
}
- private void chkShowOnlyMyCustomerss_Click(object sender, RoutedEventArgs e)
+ private void chkShowOnlyMyCustomers_Click(object sender, RoutedEventArgs e)
{
if (chkShowOnlyMyCustomers.IsChecked != null)
BeWoApp.AppSettings.ShowOnlyMyClients = chkShowOnlyMyCustomers.IsChecked.Value;
+ if (chkShowOnlyTeamCustomers.IsChecked != null)
+ BeWoApp.AppSettings.ShowOnlyTeamClients = chkShowOnlyTeamCustomers.IsChecked.Value;
BeWoApp.SaveAppSettings();
UpdateCustomFilter();
diff --git a/BeWo/View/Navigation/Filter/CustomerNavigationFilter.cs b/BeWo/View/Navigation/Filter/CustomerNavigationFilter.cs
index 06a7ba23b..7852a840d 100644
--- a/BeWo/View/Navigation/Filter/CustomerNavigationFilter.cs
+++ b/BeWo/View/Navigation/Filter/CustomerNavigationFilter.cs
@@ -6,16 +6,37 @@ namespace BeWo.View.Navigation.Filter
public class CustomerNavigationFilter : CustomFilter
{
public bool ShowOnlyMyCustomers { get; set; }
+ public bool ShowOnlyTeamCustomers { get; set; }
public override bool IsValid(IFilterableDC dc)
{
var custDC = dc as CompactCustomerDC;
-
- if (ShowOnlyMyCustomers && custDC != null)
+ if (custDC != null)
{
- return custDC.IsRelatedToEmployee;
- }
+ if (ShowOnlyMyCustomers)
+ {
+ return custDC.IsRelatedToEmployee;
+ }
+ if (ShowOnlyTeamCustomers)
+ {
+ bool contains = false;
+
+ if (BeWoApp.CompactLoggedOnEmployee.AllTeamMemberOids != null && custDC.RelatedTeamOids != null)
+ {
+
+ foreach (var teamOid in BeWoApp.CompactLoggedOnEmployee.AllTeamMemberOids)
+ {
+ if (custDC.RelatedTeamOids.Contains(teamOid))
+ {
+ contains = true;
+ }
+ }
+ }
+ //return custDC.RelatedTeamOids != null && custDC.RelatedTeamOids.Contains(BeWoApp.CompactLoggedOnEmployee.AllTeamMemberOids)
+ return contains;
+ }
+ }
return true;
}
}
diff --git a/BeWo/View/Navigation/Filter/SupportConceptNavigationFilter.cs b/BeWo/View/Navigation/Filter/SupportConceptNavigationFilter.cs
index 2509ae986..5a2d52dbf 100644
--- a/BeWo/View/Navigation/Filter/SupportConceptNavigationFilter.cs
+++ b/BeWo/View/Navigation/Filter/SupportConceptNavigationFilter.cs
@@ -22,7 +22,21 @@ namespace BeWo.View.Navigation.Filter
if (this.ShowOnlyTeamSupportConcepts)
{
- // return scDC.Customer.IsRelatedToTeamLeader;
+ bool contains = false;
+
+ if (BeWoApp.CompactLoggedOnEmployee.AllTeamMemberOids != null && scDC.Customer.RelatedTeamOids != null)
+ {
+
+ foreach (var teamOid in BeWoApp.CompactLoggedOnEmployee.AllTeamMemberOids)
+ {
+ if (scDC.Customer.RelatedTeamOids.Contains(teamOid))
+ {
+ contains = true;
+ }
+ }
+ }
+
+ return contains;
}
}
diff --git a/BeWo/View/Navigation/MainNavigationView.xaml.cs b/BeWo/View/Navigation/MainNavigationView.xaml.cs
index 4415f6fac..2dae19f72 100644
--- a/BeWo/View/Navigation/MainNavigationView.xaml.cs
+++ b/BeWo/View/Navigation/MainNavigationView.xaml.cs
@@ -265,8 +265,8 @@ namespace BeWo.View.Navigation
set
{
mainGroup.Header = value;
- chkShowArchived.Content = " " + Translator.Translate("Archivierte {0} anzeigen", value);
- chkShowDeleted.Content = " " + Translator.Translate("Gelöschte {0} anzeigen", value);
+ chkShowArchived.Content = " " + Translator.Translate("Archivierte {0}", value);
+ chkShowDeleted.Content = " " + Translator.Translate("Gelöschte {0}", value);
}
}
diff --git a/BeWo/View/Navigation/SupportConceptNavigationView.xaml.cs b/BeWo/View/Navigation/SupportConceptNavigationView.xaml.cs
index 59a9b500d..fa21d7ca9 100644
--- a/BeWo/View/Navigation/SupportConceptNavigationView.xaml.cs
+++ b/BeWo/View/Navigation/SupportConceptNavigationView.xaml.cs
@@ -46,12 +46,12 @@ namespace BeWo.View.Navigation
this.chkShowOnlyMySCs = new CheckBox();
this.chkShowOnlyMySCs.FontSize = 12;
this.chkShowOnlyMySCs.Margin = new Thickness(10, 0, 0, 0);
- this.chkShowOnlyMySCs.Content = Translator.Translate("Nur meine Hilfepläne anzeigen");
+ this.chkShowOnlyMySCs.Content = Translator.Translate("Meine Hilfepläne");
this.chkShowOnlyTeamSCs = new CheckBox();
this.chkShowOnlyTeamSCs.FontSize = 12;
this.chkShowOnlyTeamSCs.Margin = new Thickness(10, 0, 0, 0);
- this.chkShowOnlyTeamSCs.Content = Translator.Translate("Nur Hilfepläne meines Teams anzeigen");
+ this.chkShowOnlyTeamSCs.Content = Translator.Translate("Hilfepläne meines Teams");
this.chkShowOnlyMySCs.VerticalAlignment = VerticalAlignment.Center;
this.chkShowOnlyTeamSCs.VerticalAlignment = VerticalAlignment.Center;
@@ -63,6 +63,16 @@ namespace BeWo.View.Navigation
this.chkShowOnlyTeamSCs.Foreground = b;
}
+ if (!BeWoApp.LoggedOnUser.HasRight(UserRightType.SupportConcept_ViewAllSupportConcepts) && !BeWoApp.LoggedOnUser.HasRight(UserRightType.ViewAll) && BeWoApp.LoggedOnUser.HasRight(UserRightType.SupportConcept_View MyTeams))
+ {
+ this.chkShowOnlyMySCs.IsChecked = true;
+ this.chkShowOnlyMySCs.IsEnabled = false;
+ }
+ else
+ {
+ this.chkShowOnlyTeamSCs.IsChecked = BeWoApp.AppSettings.ShowOnlyTeamSupportConcepts;
+ }
+
if (!BeWoApp.LoggedOnUser.HasRight(UserRightType.SupportConcept_ViewAllSupportConcepts) && !BeWoApp.LoggedOnUser.HasRight(UserRightType.ViewAll))
{
this.chkShowOnlyMySCs.IsChecked = true;
@@ -73,6 +83,8 @@ namespace BeWo.View.Navigation
this.chkShowOnlyMySCs.IsChecked = BeWoApp.AppSettings.ShowOnlyMySupportConcepts;
}
+
+
// if (BeWoApp.LoggedOnUser.Employee.IsTeamLeader)
// {
// chkShowOnlyTeamSCs.Visibility = Visibility.Visible;
@@ -82,9 +94,10 @@ namespace BeWo.View.Navigation
this.chkShowOnlyTeamSCs.Visibility = Visibility.Collapsed;
// }
- this.chkShowOnlyMySCs.Click += this.chkShowOnlyMySCs_Click;
- this.chkShowOnlyTeamSCs.Click += this.chkShowOnlyTeamSCs_Click;
+ this.chkShowOnlyMySCs.Click += this.chkShowOnlySCs_Click;
+ this.chkShowOnlyTeamSCs.Click += this.chkShowOnlySCs_Click;
this.mainNavigationView.AddControlToSortPanel(this.chkShowOnlyMySCs);
+ this.mainNavigationView.AddControlToSortPanel(this.chkShowOnlyTeamSCs);
this.UpdateCustomFilter();
@@ -112,20 +125,17 @@ namespace BeWo.View.Navigation
this.mainNavigationView.CustomFilter = this.CreateNewCustomFilter();
}
- private void chkShowOnlyMySCs_Click(object sender, RoutedEventArgs e)
+ private void chkShowOnlySCs_Click(object sender, RoutedEventArgs e)
{
// chkShowOnlyTeamSCs.IsChecked = false;
BeWoApp.AppSettings.ShowOnlyMySupportConcepts = this.chkShowOnlyMySCs.IsChecked.Value;
+ BeWoApp.AppSettings.ShowOnlyTeamSupportConcepts = this.chkShowOnlyTeamSCs.IsChecked.Value;
BeWoApp.SaveAppSettings();
this.UpdateCustomFilter();
}
- private void chkShowOnlyTeamSCs_Click(object sender, RoutedEventArgs e)
- {
- this.chkShowOnlyMySCs.IsChecked = false;
- this.UpdateCustomFilter();
- }
+
private bool mainNavigationView_ArchiveObject(IFilterableDC obj)
{
diff --git a/BeWo/View/PasswortAenderungsView.xaml.cs b/BeWo/View/PasswortAenderungsView.xaml.cs
index 9452ae557..fea860f31 100644
--- a/BeWo/View/PasswortAenderungsView.xaml.cs
+++ b/BeWo/View/PasswortAenderungsView.xaml.cs
@@ -5,7 +5,7 @@ using System.Text.RegularExpressions;
using System.Windows;
using System.Windows.Input;
using System.Windows.Media;
-
+using BeWo.PasswortSecurity;
using BeWo.ServiceProxy;
using BeWo.ViewModel;
@@ -111,49 +111,18 @@ namespace BeWo.View
textblock_editFailures.Text = string.Empty;
}
- //private const string sonderzeichen = "\\\"\'µ@€!§$%&/()=?+#*',.-;:_><|{[]}´`^°~²³";
- private const string zahlen = "0123456789";
- private const string grossBuchstaben = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
- private const string kleinBuchstaben = "abcdefghijklmnopqrstuvwxyz";
+
- private const string grossBuchstabenSonderLevel = "ÄÖÜ";
- private const string kleinBuchstabenSonderLevel = "äöüß";
- private const string sonderzeichenLevel1 = "\\\"\'µ@€!";
- private const string sonderzeichenLevel2 = "&/()=?+#*";
- private const string sonderzeichenLevel3 = ",.-;:_><|";
- private const string sonderzeichenLevel4 = "§$%'{[]}´";
- private const string sonderzeichenLevel5 = "`^°~²³";
+ PasswortSicherheit pwS = new PasswortSicherheit();
- private string letztespw = "";
- private bool retschalter = false;
- private int distanz = 0;
private void NeuesPwBox_OnPasswordChanged(object sender, RoutedEventArgs e)
{
- string s = NeuesPwBox.Password;
-
-
- //################ Foreach String Char if Kopie and paste was triggered ################
-
-
-
-
- //--> this block foreach Char
- //############################
-
- if (s.Length < letztespw.Length)
- {
- retschalter = true;
- distanz = letztespw.Length - s.Length;
- }
+ passwortprüfer = pwS.ErmittleUndZeigePasswortStaerke(NeuesPwBox.Password, passwortprüfer);
+
- if (!letztespw.Equals(s))
- letztespw = s;
-
- ZeigePasswortStrength(NeuesPwBox.Password.Length);
-
-
- var fehlermeldung = string.Empty;
+ var fehlermeldung = string.Empty;
+
//textblock_editFailures.Foreground = new SolidColorBrush(Color.FromRgb(255, 72, 0));
//if (!(NeuesPwBox.Password.Any(x => sonderzeichen.Contains(x)) && NeuesPwBox.Password.Any(x => zahlen.Contains(x)) && NeuesPwBox.Password.Any(x => grossBuchstaben.Contains(x)) && NeuesPwBox.Password.Any(x => kleinBuchstaben.Contains(x))))
@@ -164,263 +133,5 @@ namespace BeWo.View
textblock_editFailures.Text = fehlermeldung;
}
-
- int score = 0;
- int letzterwert = 0;
- bool schalter = false;
- List letztewerte = new List();
-
- private void ZeigePasswortStrength(int text)
- {
- int i = 0;
- letzterwert = 0;
- //############### Score System ############
-
- if (retschalter == true)
- {
- if (distanz == 1)
- {
- score -= letztewerte.Last();
- letztewerte.RemoveAt(letztewerte.Count - 1);
- }
- else
- {
- for (int s = 0; s < distanz; s++)
- {
- score -= letztewerte.Last();
- letztewerte.RemoveAt(letztewerte.Count - 1);
- }
- }
-
- retschalter = false;
-
- //letzterwert = 0;
- }
- else
- {
- //Passwort Längen Bonus Punkte
- if (NeuesPwBox.Password.Length >= 6 && NeuesPwBox.Password.Length < 9 )
- {
- score += 1;
- letzterwert = 1;
- schalter = true;
- }
-
- if (NeuesPwBox.Password.Length >= 9 && NeuesPwBox.Password.Length < 12 )
- {
- score += 2;
- letzterwert = 2;
- schalter = true;
- }
-
- if (NeuesPwBox.Password.Length >= 12 && NeuesPwBox.Password.Length < 18 )
- {
- score += 3;
- letzterwert = 3;
- schalter = true;
- }
-
- if (NeuesPwBox.Password.Length >= 18 )
- {
- score += 4;
- letzterwert = 4;
- schalter = true;
- }
-
- //Zahlen und Buchstaben
- if (NeuesPwBox.Password.Any(x => zahlen.Contains(x)))
- {
- score += 3;
-
- if (schalter == true)
- letzterwert += 3;
- else
- letzterwert = 3;
- }
-
- if (NeuesPwBox.Password.Any(x => grossBuchstaben.Contains(x)))
- {
- score += 3;
-
- if (schalter == true)
- letzterwert += 3;
- else
- letzterwert = 3;
- }
-
- if (NeuesPwBox.Password.Any(x => grossBuchstabenSonderLevel.Contains(x)))
- {
- score += 2;
-
- if (schalter == true)
- letzterwert += 2;
- else
- letzterwert = 2;
- }
-
- if (NeuesPwBox.Password.Any(x => kleinBuchstaben.Contains(x)))
- {
- score += 2;
-
- if (schalter == true)
- letzterwert += 2;
- else
- letzterwert = 2;
- }
-
- if (NeuesPwBox.Password.Any(x => kleinBuchstabenSonderLevel.Contains(x)))
- {
- score += 2;
-
- if (schalter == true)
- letzterwert += 2;
- else
- letzterwert = 2;
- }
-
- // Sonderzeichen
-
- if (NeuesPwBox.Password.Any(x => sonderzeichenLevel1.Contains(x)))
- {
- score += 4;
-
- if (schalter == true)
- letzterwert += 4;
- else
- letzterwert = 4;
- }
-
- if (NeuesPwBox.Password.Any(x => sonderzeichenLevel2.Contains(x)))
- {
- score += 4;
-
- if (schalter == true)
- letzterwert += 4;
- else
- letzterwert = 4;
- }
-
- if (NeuesPwBox.Password.Any(x => sonderzeichenLevel3.Contains(x)))
- {
- score += 4;
-
- if (schalter == true)
- letzterwert += 4;
- else
- letzterwert = 4;
- }
-
- if (NeuesPwBox.Password.Any(x => sonderzeichenLevel4.Contains(x)))
- {
- score += 4;
-
- if (schalter == true)
- letzterwert += 4;
- else
- letzterwert = 4;
- }
-
- if (NeuesPwBox.Password.Any(x => sonderzeichenLevel5.Contains(x)))
- {
- score += 4;
-
- if (schalter == true)
- letzterwert += 4;
- else
- letzterwert = 4;
- }
-
- letztewerte.Add(letzterwert);
- }
-
- //#########################################
-
- // ########################################### PasswortStärke Bereich ##########################
- //Sehr Schwach
- if (score <= 15)
- {
- i = 0;
- }
-
- //Schwach
- if (score >= 16 && score <= 55)
- {
- i = 1;
- }
-
- //Mittelmäßig
- if (score >= 56 && score <= 115)
- {
- i = 2;
- }
-
- //Stark
- if (score >= 116 && score <= 155)
- {
- i = 3;
- }
-
- //Sehr Stark
- if (score >= 156 )
- {
- i = 4;
- }
-
- // ########################################### PasswortStärke Bereich ##########################
-
- if (text == 0)
- {
- if (passwortprüfer.Visibility != Visibility.Hidden)
- passwortprüfer.Visibility = Visibility.Hidden;
-
- score = 0;
- letzterwert = 0;
-
- }else{
-
- if (passwortprüfer.Visibility != Visibility.Visible)
- passwortprüfer.Visibility = Visibility.Visible;
-
- switch (i)
- {
-
- case 0:
-
- passwortprüfer.Foreground = new SolidColorBrush(Colors.Red);
- passwortprüfer.Content = "Passwortstärke: Sehr schwach";
-
- break;
-
- case 1:
-
- passwortprüfer.Foreground = new SolidColorBrush(Colors.OrangeRed);
- passwortprüfer.Content = "Passwortstärke: Schwach";
-
- break;
-
- case 2:
-
- passwortprüfer.Foreground = new SolidColorBrush(Colors.Yellow);
- passwortprüfer.Content = "Passwortstärke: Mittel";
-
- break;
-
- case 3:
-
- passwortprüfer.Foreground = new SolidColorBrush(Colors.Green);
- passwortprüfer.Content = "Passwortstärke: Stark";
-
- break;
-
- case 4:
-
- passwortprüfer.Foreground = new SolidColorBrush(Colors.Green);
- passwortprüfer.Content = "Passwortstärke: Sehr stark";
-
- break;
- }
-
- }
- }
}
}
diff --git a/BeWo/ViewModel/ChatBewoMessageSyncVM.cs b/BeWo/ViewModel/ChatBewoMessageSyncVM.cs
new file mode 100644
index 000000000..2a125c5c4
--- /dev/null
+++ b/BeWo/ViewModel/ChatBewoMessageSyncVM.cs
@@ -0,0 +1,46 @@
+using BS.Shared;
+using BS.Shared.DataContracts;
+using System;
+
+namespace BeWo.ViewModel
+{
+ public class ChatBewoMessageSyncVM : AbstractDCMapperVM
+ {
+ public static string PropertyName_MessageSyncText = "MessageSyncText";
+
+ private string _MessageSyncText;
+
+ public ChatBewoMessageSyncVM(ChatBewoMessageSyncDC pDC)
+ : base(pDC, true)
+ {
+ }
+
+ public string MessageSyncText
+ {
+ get { return this._MessageSyncText; }
+
+ set
+ {
+ if (this.AreDifferent(this._MessageSyncText, value))
+ {
+ this._MessageSyncText = value;
+ this.StoreDirtyInformation(this.AreDifferent(this.DataContract.MessageSyncText, value), PropertyName_MessageSyncText);
+ this.FirePropertyChanged(PropertyName_MessageSyncText);
+ }
+ }
+ }
+
+ protected override void InitByDataContract(ChatBewoMessageSyncDC pDataContract)
+ {
+ this._MessageSyncText = pDataContract.MessageSyncText;
+
+ }
+
+ protected override ChatBewoMessageSyncDC MapToDataContract(ChatBewoMessageSyncDC pDataContract, bool doCommit)
+ {
+ pDataContract.MessageSyncText = _MessageSyncText;
+
+ return pDataContract;
+ }
+ }
+}
\ No newline at end of file
diff --git a/BeWo/View/ChatDokumentationsView.xaml b/BeWo/ownChat/ChatDokumentationsView.xaml
similarity index 90%
rename from BeWo/View/ChatDokumentationsView.xaml
rename to BeWo/ownChat/ChatDokumentationsView.xaml
index 1c5ae593d..1e322f723 100644
--- a/BeWo/View/ChatDokumentationsView.xaml
+++ b/BeWo/ownChat/ChatDokumentationsView.xaml
@@ -1,4 +1,4 @@
-
/// Interaktionslogik für ChatEmojiService.xaml
diff --git a/BeWo/View/ChatServiceCustomer.xaml b/BeWo/ownChat/ChatServiceCustomer.xaml
similarity index 95%
rename from BeWo/View/ChatServiceCustomer.xaml
rename to BeWo/ownChat/ChatServiceCustomer.xaml
index 6fa45871e..ae75be7d9 100644
--- a/BeWo/View/ChatServiceCustomer.xaml
+++ b/BeWo/ownChat/ChatServiceCustomer.xaml
@@ -1,151 +1,154 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/BeWo/View/ChatServiceCustomer.xaml.cs b/BeWo/ownChat/ChatServiceCustomer.xaml.cs
similarity index 71%
rename from BeWo/View/ChatServiceCustomer.xaml.cs
rename to BeWo/ownChat/ChatServiceCustomer.xaml.cs
index 1a4ee72b2..65f04c453 100644
--- a/BeWo/View/ChatServiceCustomer.xaml.cs
+++ b/BeWo/ownChat/ChatServiceCustomer.xaml.cs
@@ -1,632 +1,659 @@
-using System;
-using System.Collections.Generic;
-using System.Collections.Specialized;
-using System.Diagnostics;
-using System.IO;
-using System.Linq;
-using System.Net;
-using System.Text;
-using System.Threading;
-using System.Web;
-using System.Windows;
-using System.Windows.Controls;
-using System.Windows.Controls.Primitives;
-using System.Windows.Documents;
-using System.Windows.Forms;
-using System.Windows.Forms.VisualStyles;
-using System.Windows.Input;
-using System.Windows.Media;
-using System.Windows.Media.Imaging;
-using System.Windows.Navigation;
-using System.Windows.Threading;
-
-using BeWo.Core;
-using BeWo.Core.Service;
-using BeWo.ViewModel;
-using BeWo.ServiceProxy;
-using BeWo.View.Detail;
-using BS.Shared.DataContracts;
-using BS.Shared.Extensions;
-using BS.Shared;
-using BS.Shared.Core;
-using ChatController.ChatKlassen;
-using Microsoft.Win32;
-using Newtonsoft.Json;
-using CheckBox = System.Windows.Controls.CheckBox;
-using KeyEventArgs = System.Windows.Input.KeyEventArgs;
-using MessageBox = System.Windows.MessageBox;
-using Panel = System.Windows.Controls.Panel;
-using SaveFileDialog = System.Windows.Forms.SaveFileDialog;
-
-namespace BeWo.View
-{
- public partial class ChatServiceCustomer
- {
-
- private CustomerVM _ViewModel;
-
- // TableID tableid;
- private long? customerOid;
- private long? personOid;
-
- public ChatServiceCustomer(TableID pObjectTid, long? oid,long? cusUserOid)
- {
- InitializeComponent();
-
- customerOid = oid;
- personOid = cusUserOid;
- // tableid = pObjectTid;
-
- LaodInfostoView();
-
- }
-
-
- public CustomerVM PublicViewModel { get { return _ViewModel; } }
-
-
-
-
- public override bool IsDirty
- {
- get
- {
- return ViewModel != null && ViewModel.IsDirty;
- }
- }
-
- private CustomerVM ViewModel
- {
- get { return _ViewModel; }
-
- set
- {
- DataContext = value;
- _ViewModel = value;
- }
- }
-
- //TODO Speicher Button Aktivieren
-
- /* private bool DoSaveCheck()
- {
- Cache.GetInstance().GetActiveSupportConceptCostbearer(scList =>
- VMFactory.CreateServiceRecordVMAsync(
- BeWoApp.LoggedOnUser.Employee.EmployeeOid,
- vm => this.Dispatch(
- delegate
- {
- ChatServiceCustomer newView = new ChatServiceCustomer(tableid, customerOid);
-
- if (newView.CommandBindings.Count == 0)
- {
- newView.CommandBindings.Add(
- new CommandBinding(
- ApplicationCommands.Close,
- (s, e) =>
- {
- if (!newView.DoSaveCheck())
- {
- return;
- }
-
- }));
- newView.CommandBindings.Add(
- new CommandBinding(
- ApplicationCommands.Save,
- (s, e) =>
- {
- bool save = true;
-
- if (!save)
- {
- return;
- }
-
- newView.SaveData();
-
- }));
- }
- })));
-
- }
- */
-
- private void GenerateCodeClick(object sender, RoutedEventArgs e)
- {
- if (!GeneratetTexfield.Text.Equals("") && BeWoApp.Tenant != null && BeWoApp.Mandator.Apikey != null)
- {
- if (MessageBox.Show("Wollen Sie wirklich den Chat-Code ändern?\nAlle Daten auf Mobilgeräten werden gelöscht.", "Chat-Code ändern", MessageBoxButton.YesNo,
- MessageBoxImage.Question) == MessageBoxResult.Yes)
- {
- StartWaiting();
- var result =
- ServiceFacade.DoOperationsServiceSync(s => s.CreateNewCustomerAPPCodeDC(customerOid.Value, BeWoApp.Tenant, BeWoApp.Mandator.Apikey,personOid.Value));
-
- EndWaiting();
- if(result != null){
- GeneratetTexfield.Text = result.CustomerCode;
- CodeButtonsOnOFF();
- }
- else{
- MessageBox.Show("Beim erstellen eines neuen Chat-Codes ist ein Fehler aufgetreten.", "Chat-Code erstellen", MessageBoxButton.OK, MessageBoxImage.Exclamation);
- }
-
- //GeneratetTexfield.Text = result.CustomerCode;
- }
- }
- else if (BeWoApp.Tenant != null && BeWoApp.Mandator.Apikey != null)
- {
- StartWaiting();
- var result = ServiceFacade.DoOperationsServiceSync(s => s.CreateNewCustomerAPPCodeDC(customerOid.Value, BeWoApp.Tenant, BeWoApp.Mandator.Apikey, personOid.Value));
- EndWaiting();
-
- if(result != null){
- GeneratetTexfield.Text = result.CustomerCode;
- CodeButtonsOnOFF();
- }
- else
- {
- MessageBox.Show("Beim Erstellen eines neuen Chat-Codes ist ein Fehler aufgetreten.",
- "Chat-Code erstellen", MessageBoxButton.OK, MessageBoxImage.Exclamation);
- }
- //GeneratetTexfield.Text = result.CustomerCode;
- }
- else
- {
- MessageBox.Show("Sie besitzen derzeit keinen API-Key. Bitte wenden sie sich an den Support.", "Info",
- MessageBoxButton.OK, MessageBoxImage.Exclamation);
- }
-//#endif
- }
-
-
- //private void CheckBox_Checked(object sender, RoutedEventArgs e)
- //{
- // ServiceFacade.DoOperationsServiceSync(s => s.UpdateIsChatActiveCustomerAPPCodeDC(customerOid.Value, 1));
- //}
-
- //private void CheckBox_Unchecked(object sender, RoutedEventArgs e)
- //{
- // ServiceFacade.DoOperationsServiceSync(s => s.UpdateIsChatActiveCustomerAPPCodeDC(customerOid.Value, 0));
- //}
-
-
- private void LaodInfostoView()
- {
-
- var getCustomerAppCode = ServiceFacade.DoOperationsServiceSync(s => s.GetIsChatActiveCustomerAPPCodeDC(customerOid.Value, 0));
-
- int x ;
-
- if (getCustomerAppCode.Count > 0)
- {
- x = getCustomerAppCode[getCustomerAppCode.Count - 1].IsChatAktive;
-
- GeneratetTexfield.Text = getCustomerAppCode[getCustomerAppCode.Count - 1].CustomerCode;
- }
-
- CodeButtonsOnOFF();
-
- if (getCustomerAppCode.Count > 0)
- {
- TXTBenutzerName.Text = getCustomerAppCode[getCustomerAppCode.Count - 1].Benutzername;
- TXTPasswort.Text = getCustomerAppCode[getCustomerAppCode.Count - 1].Passwort;
- }
- }
-
- private void CodeButtonsOnOFF()
- {
- if (!GeneratetTexfield.Text.Equals(""))
- {
- //lblGenerateCode.Content = "Chat-Code erneuern";
- RemoveButton.Visibility = Visibility.Visible;
- CustomerHandoutButton.Visibility = Visibility.Visible;
- // CustomerBenutzerKontoGroupBox.Visibility = Visibility.Visible;
- ButtonGenerateCode.ToolTip = "Chat-Code erneuern";
-
- var image = new Image
- {
- Source = new BitmapImage(
- new Uri(
- "pack://application:,,,/Ressources/Icons/SymbolRefresh32.png"))
- };
-
- ImageGenerateCode.Source = image.Source;
-
- }
- else
- {
- //lblGenerateCode.Content = "Chat-Code erneuern";
- RemoveButton.Visibility = Visibility.Collapsed;
- CustomerHandoutButton.Visibility = Visibility.Collapsed;
- //CustomerBenutzerKontoGroupBox.Visibility = Visibility.Collapsed;
- ButtonGenerateCode.ToolTip = "Chat-Code anfordern";
-
- var image = new Image
- {
- Source = new BitmapImage(
- new Uri(
- "pack://application:,,,/Ressources/Icons/DocumentWithAdd2.png"))
- };
-
- ImageGenerateCode.Source = image.Source;
- }
- }
-
- //Genauer bearbeiten
- private void SpeicherButton_OnClick(object sender, RoutedEventArgs e)
- {
- if (BeWoApp.AppSettings.IsPasswordSecurityActiv)
- {
- if (TXTPasswort.Text.Length >= 8)
- {
-
- StartWaiting();
-
- var isBenutzerNameVorhanden = ServiceFacade.DoCustomerServiceSync(r => r.PruefeObBenutzerKontoSchonVorhanden(customerOid.Value, TXTBenutzerName.Text));
-
- if (!isBenutzerNameVorhanden)
- {
- ServiceFacade.DoCustomerServiceSync(
- s =>
- s.SetBenutzerPasswortChatAppCode(customerOid.Value, TXTBenutzerName.Text,
- TXTPasswort.Text));
- EndWaiting();
- MessageBox.Show("Benutzername und Passwort wurden erfolgreich gespeichert.", "Speichern", MessageBoxButton.OK, MessageBoxImage.Information);
- }
- else
- {
- EndWaiting();
-
- MessageBox.Show("Dieser Benutzername ist bereits vergeben.", "Speichern", MessageBoxButton.OK, MessageBoxImage.Exclamation);
- }
-
- }
- else
- {
- MessageBox.Show("Sie verwenden ein zu schwaches Passwort.", "Speichern", MessageBoxButton.OK, MessageBoxImage.Exclamation);
- }
- }
- else
- {
- StartWaiting();
- var isBenutzerNameVorhanden = ServiceFacade.DoCustomerServiceSync(r => r.PruefeObBenutzerKontoSchonVorhanden(customerOid.Value, TXTBenutzerName.Text));
-
- if (!isBenutzerNameVorhanden)
- {
-
- ServiceFacade.DoCustomerServiceSync(s => s.SetBenutzerPasswortChatAppCode(customerOid.Value, TXTBenutzerName.Text, TXTPasswort.Text));
- EndWaiting();
- MessageBox.Show("Benutzername und Passwort wurden erfolgreich gespeichert.", "Speichern", MessageBoxButton.OK, MessageBoxImage.Information);
- }
- else
- {
- EndWaiting();
-
- MessageBox.Show("Dieser Benutzername ist bereits vergeben.", "Speichern", MessageBoxButton.OK, MessageBoxImage.Exclamation);
- }
-
- }
- }
-
- private void RemoveCode_OnClick(object sender, RoutedEventArgs e)
- {
- if (!GeneratetTexfield.Text.Equals(""))
- {
- if (MessageBox.Show("Wollen Sie den Chat-Code wirklich löschen?\nAlle Daten werden gelöscht.", "Achtung", MessageBoxButton.YesNo, MessageBoxImage.Question) == MessageBoxResult.Yes) {
- StartWaiting();
- var isdeletet = ServiceFacade.DoOperationsServiceSync(r => r.DeletCustomerChatCode(BeWoApp.Mandator.Apikey, BeWoApp.Tenant, personOid.Value));
- EndWaiting();
-
- if (isdeletet)
- {
- GeneratetTexfield.Text = "";
- CodeButtonsOnOFF();
- }
- else
- {
- MessageBox.Show("Löschen des Chat-Codes fehlgeschlagen.", "Fehler", MessageBoxButton.OK, MessageBoxImage.Exclamation);
- }
- }
- }
- else
- {
- MessageBox.Show("Sie müssen vorher einen Chat-Code generieren, bevor sie ihn löschen können", "Info",
- MessageBoxButton.OK, MessageBoxImage.Information);
- }
- }
-
- #region pdf
- private void ZeigeHandoutPDF_OnClick(object sender, RoutedEventArgs e)
- {
- StartWaiting();
-
- List parameter = new List();
- parameter.Add("5473568546"/*BeWoApp.Tenant*/);
- parameter.Add("0b50c09aff87f20d9ced75340e04e5ccaa11dd3e7bcf25e9c4f94dc20d3cbb97" /*BeWoApp.Mandator.Apikey*/);
-
- parameter.Add(TXTBenutzerName.Text);
- parameter.Add(TXTPasswort.Text);
- parameter.Add(GeneratetTexfield.Text); // chatcode
-
- Thread newThread = new Thread(DoWork);
- newThread.IsBackground = true;
- newThread.Start(parameter);
- }
-
- private void DoWork(object o)
- {
- List para = o as List;
-
- var Result = PdfAnzeigen(para[0], para[1],para[2],para[3],para[4]);
-
- EndWaiting();
-
- this.Dispatcher.BeginInvoke(
- DispatcherPriority.Background,
- (Action)delegate
- {
- switch (Result)
- {
- case 0:
- // wenn hier dann alles ok
-
-
- break;
- case 11:
- MessageBox.Show("Kundennummer unbekannt.", "Fehler", MessageBoxButton.OK);
- break;
- case 12:
- MessageBox.Show("Der API-Key ist falsch -> Auth-Error.", "Fehler", MessageBoxButton.OK);
- break;
- case 13:
- MessageBox.Show("Es existiert kein API-Key für die angegebene Kundennummer.", "Fehler", MessageBoxButton.OK);
- break;
- case 40:
- MessageBox.Show("Vorlage nicht gefunden.", "Fehler", MessageBoxButton.OK);
- break;
- case 41:
- MessageBox.Show("Ungültige Custom-Logo-URL.", "Fehler", MessageBoxButton.OK);
- break;
- case 60:
- MessageBox.Show("Fehler: \n" + "", "Fehler", MessageBoxButton.OK);
- break;
- }
-
- });
- }
-
- private string ErmittleServerURL(string customerId)
- {
- try
- {
- string url = "https://dict.ownchat.de/api/server/resolve/1/" + customerId;//customerId; //customerid == kundennummer
-
- WebRequest request = WebRequest.Create(url);
-
- request.Credentials = CredentialCache.DefaultCredentials;
-
- WebResponse response = request.GetResponse();
-
-
- Stream dataStream = response.GetResponseStream();
-
- StreamReader reader = new StreamReader(dataStream);
-
- string responseFromServer = reader.ReadToEnd();
-
- dataStream.Dispose();
- reader.Dispose();
-
- dataStream.Close();
- reader.Close();
-
- // string responseFromServer = ReadStreamForChatCode(response);
-
- var definition = new { status = "", URL = "", SYNCTYPE = "" };
-
- var jsondaten = JsonConvert.DeserializeAnonymousType(responseFromServer, definition);
-
- string serverUrl = jsondaten.URL;
- response.Close();
-
- return serverUrl;
- }
- catch (Exception e)
- {
- return null;
- }
- }
-
- private int PdfAnzeigen(string customerId, string apikey,string benutzername, string passwort, string chatcode)
- {
- try
- {
- int Result = 0;
-
- #region ServerErmittlung und Link ermittlung
- string serverUrl = ErmittleServerURL(customerId);
-
- if (serverUrl == null)
- {
- return Result = 11;
- }
- else if (serverUrl.Equals(""))
- {
- return Result = 11;
- }
-
- var endurl = serverUrl + "/api/ownchat/createpdfmanual/" + apikey + "/" + customerId;
- #endregion
-
- #region Post Parameter Uebergabe
-
- Dictionary postparameter = new Dictionary();
-
- if(!benutzername.Equals(""))
- postparameter.Add("username", benutzername);
-
- if(!passwort.Equals(""))
- postparameter.Add("password", passwort);
-
- if (!chatcode.Equals(""))
- postparameter.Add("chatcode", chatcode);
-
- string postdaten = "";
- int i = 0;
- foreach (var key in postparameter.Keys)
- {
- postdaten += HttpUtility.UrlEncode(key) + "=" + HttpUtility.UrlEncode(postparameter[key]) + "&";
- }
- #endregion
-
- #region Webrequest Aufbau ink. stream
- WebRequest requesten = WebRequest.Create(endurl);
-
- requesten.Method = "POST";
- requesten.ContentType = "application/x-www-form-urlencoded";
-
- byte[] daten = Encoding.ASCII.GetBytes(postdaten);
-
- requesten.ContentLength = daten.Length;
-
- try
- {
- Stream requestStream = requesten.GetRequestStream();
-
- requestStream.Write(daten, 0, daten.Length);
-
- requestStream.Close();
-
- var inte = VerarbeiteErhalteneDaten(requesten);
-
- return inte;
- }
- catch (Exception e)
- {
- this.Dispatcher.BeginInvoke(
- DispatcherPriority.Background,
- (Action)delegate
- {
- MessageBox.Show("Es konnte keine Verbindung aufgebaut werden.", "Fehler", MessageBoxButton.OK);
- });
-
- return 0;
- }
- #endregion
-
- }
- catch (Exception e)
- {
- return 60;
- }
- }
-
- private int VerarbeiteErhalteneDaten(WebRequest requesten)
- {
- try
- {
- #region Verarbeitung der Erhaltenen Daten
- HttpWebResponse response = (HttpWebResponse)requesten.GetResponse();
-
- string responseFromServer = "";
-
- Stream reqStr2 = response.GetResponseStream();
-
- byte[] barray = null;
-
- byte[] Stringmesage = null;
-
- using (var memoryStream = new MemoryStream())
- {
- reqStr2.CopyTo(memoryStream);
- barray = memoryStream.ToArray();
- }
-
- if (barray != null)
- {
- Stringmesage = barray;
-
- responseFromServer = System.Text.Encoding.Default.GetString(Stringmesage);
- }
-
- if (responseFromServer.Contains("PDF"))
- {
- this.Dispatcher.BeginInvoke(
- DispatcherPriority.Background,
- (Action)delegate
- {
- Microsoft.Win32.SaveFileDialog saveFileDialog1 = new Microsoft.Win32.SaveFileDialog();
-
- saveFileDialog1.Title = "PDF Speichern";
- saveFileDialog1.FileName = Path.GetFileName("ownChat-Kurzanleitung.pdf");
- saveFileDialog1.ShowDialog();
-
- File.WriteAllBytes(saveFileDialog1.FileName, barray);
-
- Process.Start(saveFileDialog1.FileName);
-
- });
- reqStr2.Close();
-
-
-
- return 0;
- }
- else
- {
- var jsonDatentyp = JsonConvert.DeserializeObject(responseFromServer);
-
- return jsonDatentyp.Result;
- }
- #endregion
- }
- catch (Exception e)
- {
- return 60;
- }
- }
-
- #endregion
-
- #region Waitlayer
- private WaitLayer2 _waitLayer = null;
-
- public void StartWaiting()
- {
- Dispatcher.BeginInvoke(DispatcherPriority.Background, (Action)StartWaitingImmediately);
- }
-
- public void StartWaitingImmediately()
- {
- if (_waitLayer == null)
- {
- _waitLayer = new WaitLayer2();
- //Grid.SetColumnSpan(_waitLayer, 3);
- //Grid.SetRowSpan(_waitLayer, 3);
- ChatServiceCustomerGrid.Children.Add(_waitLayer);
- Panel.SetZIndex(_waitLayer, int.MaxValue);
- _waitLayer.RefreshChatUI();
- }
- }
-
- public void EndWaiting()
- {
- Dispatcher.BeginInvoke(
- DispatcherPriority.Background,
- (Action)delegate
- {
- if (_waitLayer != null)
- {
- ChatServiceCustomerGrid.Children.Remove(_waitLayer);
- _waitLayer = null;
- }
- });
- }
-
- #endregion
-
-
- }
+using System;
+using System.Collections.Generic;
+using System.Collections.Specialized;
+using System.Diagnostics;
+using System.IO;
+using System.Linq;
+using System.Net;
+using System.Text;
+using System.Threading;
+using System.Web;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Controls.Primitives;
+using System.Windows.Documents;
+using System.Windows.Forms;
+using System.Windows.Forms.VisualStyles;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Navigation;
+using System.Windows.Threading;
+
+using BeWo.Core;
+using BeWo.Core.Service;
+using BeWo.PasswortSecurity;
+using BeWo.ViewModel;
+using BeWo.ServiceProxy;
+using BeWo.View.Detail;
+using BS.Shared.DataContracts;
+using BS.Shared.Extensions;
+using BS.Shared;
+using BS.Shared.Core;
+using ChatController.ChatKlassen;
+using Microsoft.Win32;
+using Newtonsoft.Json;
+using CheckBox = System.Windows.Controls.CheckBox;
+using KeyEventArgs = System.Windows.Input.KeyEventArgs;
+using MessageBox = System.Windows.MessageBox;
+using Panel = System.Windows.Controls.Panel;
+using SaveFileDialog = System.Windows.Forms.SaveFileDialog;
+using BeWo.View;
+
+namespace BeWo.ownChat
+{
+ public partial class ChatServiceCustomer
+ {
+
+ private CustomerVM _ViewModel;
+
+ // TableID tableid;
+ private long? customerOid;
+ private long? personOid;
+ PasswortSicherheit pwS = new PasswortSicherheit();
+
+ public ChatServiceCustomer(TableID pObjectTid, long? oid,long? cusUserOid)
+ {
+ InitializeComponent();
+
+ customerOid = oid;
+ personOid = cusUserOid;
+ // tableid = pObjectTid;
+
+ LaodInfostoView();
+
+ }
+
+
+ public CustomerVM PublicViewModel { get { return _ViewModel; } }
+
+ public override bool IsDirty
+ {
+ get
+ {
+ return ViewModel != null && ViewModel.IsDirty;
+ }
+ }
+
+ private CustomerVM ViewModel
+ {
+ get { return _ViewModel; }
+
+ set
+ {
+ DataContext = value;
+ _ViewModel = value;
+ }
+ }
+
+ #region DoSaveCheck Nicht aktiviert
+
+ //TODO Speicher Button Aktivieren
+
+ /* private bool DoSaveCheck()
+ {
+ Cache.GetInstance().GetActiveSupportConceptCostbearer(scList =>
+ VMFactory.CreateServiceRecordVMAsync(
+ BeWoApp.LoggedOnUser.Employee.EmployeeOid,
+ vm => this.Dispatch(
+ delegate
+ {
+ ChatServiceCustomer newView = new ChatServiceCustomer(tableid, customerOid);
+
+ if (newView.CommandBindings.Count == 0)
+ {
+ newView.CommandBindings.Add(
+ new CommandBinding(
+ ApplicationCommands.Close,
+ (s, e) =>
+ {
+ if (!newView.DoSaveCheck())
+ {
+ return;
+ }
+
+ }));
+ newView.CommandBindings.Add(
+ new CommandBinding(
+ ApplicationCommands.Save,
+ (s, e) =>
+ {
+ bool save = true;
+
+ if (!save)
+ {
+ return;
+ }
+
+ newView.SaveData();
+
+ }));
+ }
+ })));
+
+ }
+ */
+ #endregion
+
+ private void LaodInfostoView()
+ {
+
+ var getCustomerAppCode = ServiceFacade.DoOperationsServiceSync(s => s.GetIsChatActiveCustomerAPPCodeDC(customerOid.Value, 0));
+
+ int x ;
+
+ if (getCustomerAppCode.Count > 0)
+ {
+ x = getCustomerAppCode[getCustomerAppCode.Count - 1].IsChatAktive;
+
+ GeneratetTexfield.Text = getCustomerAppCode[getCustomerAppCode.Count - 1].CustomerCode;
+ }
+
+ CodeButtonsOnOFF();
+
+ if (getCustomerAppCode.Count > 0)
+ {
+ TXTBenutzerName.Text = getCustomerAppCode[getCustomerAppCode.Count - 1].Benutzername;
+ TXTPasswort.Text = getCustomerAppCode[getCustomerAppCode.Count - 1].Passwort;
+ }
+ }
+
+ private void CodeButtonsOnOFF()
+ {
+ if (!GeneratetTexfield.Text.Equals(""))
+ {
+ //lblGenerateCode.Content = "Chat-Code erneuern";
+ RemoveButton.Visibility = Visibility.Visible;
+ CustomerHandoutButton.Visibility = Visibility.Visible;
+ // CustomerBenutzerKontoGroupBox.Visibility = Visibility.Visible;
+ ButtonGenerateCode.ToolTip = "Chat-Code erneuern";
+
+ var image = new Image
+ {
+ Source = new BitmapImage(
+ new Uri(
+ "pack://application:,,,/Ressources/Icons/SymbolRefresh32.png"))
+ };
+
+ ImageGenerateCode.Source = image.Source;
+
+ }
+ else
+ {
+ //lblGenerateCode.Content = "Chat-Code erneuern";
+ RemoveButton.Visibility = Visibility.Collapsed;
+ CustomerHandoutButton.Visibility = Visibility.Collapsed;
+ //CustomerBenutzerKontoGroupBox.Visibility = Visibility.Collapsed;
+ ButtonGenerateCode.ToolTip = "Chat-Code anfordern";
+
+ var image = new Image
+ {
+ Source = new BitmapImage(
+ new Uri(
+ "pack://application:,,,/Ressources/Icons/DocumentWithAdd2.png"))
+ };
+
+ ImageGenerateCode.Source = image.Source;
+ }
+ }
+
+ #region Code Generieren / Erneuern / Löschen
+ private void GenerateCodeClick(object sender, RoutedEventArgs e)
+ {
+ if (!GeneratetTexfield.Text.Equals("") && BeWoApp.Tenant != null && BeWoApp.Mandator.Apikey != null)
+ {
+ if (MessageBox.Show("Wollen Sie wirklich den Chat-Code ändern?\nAlle Daten auf Mobilgeräten werden gelöscht.", "Chat-Code ändern", MessageBoxButton.YesNo,
+ MessageBoxImage.Question) == MessageBoxResult.Yes)
+ {
+ StartGenerateCode();
+ }
+ }
+ else if (BeWoApp.Tenant != null && BeWoApp.Mandator.Apikey != null)
+ {
+ StartGenerateCode();
+
+ //StartWaiting();
+ //var result = ServiceFacade.DoOperationsServiceSync(s => s.CreateNewCustomerAPPCodeDC(customerOid.Value, BeWoApp.Tenant, BeWoApp.Mandator.Apikey));
+ //EndWaiting();
+
+ //if(result != null){
+ // GeneratetTexfield.Text = result.CustomerCode;
+ // CodeButtonsOnOFF();
+ //}
+ //else
+ //{
+ // MessageBox.Show("Beim Erstellen eines neuen Chat-Codes ist ein Fehler aufgetreten.",
+ // "Chat-Code erstellen", MessageBoxButton.OK, MessageBoxImage.Exclamation);
+ //}
+ ////GeneratetTexfield.Text = result.CustomerCode;
+ }
+ else
+ {
+ MessageBox.Show("Sie besitzen derzeit keinen API-Key. Bitte wenden sie sich an den Support.", "Info",
+ MessageBoxButton.OK, MessageBoxImage.Exclamation);
+ }
+ }
+
+ private void StartGenerateCode()
+ {
+ StartWaiting();
+
+ List parameter = new List();
+ parameter.Add(customerOid.Value.ToString());
+ parameter.Add(BeWoApp.Tenant);
+ parameter.Add(BeWoApp.Mandator.Apikey);
+
+ Thread newThread = new Thread(GenerateCode);
+ newThread.IsBackground = true;
+ newThread.Start(parameter);
+ }
+
+ private void GenerateCode(object o)
+ {
+ List para = o as List;
+ var result =
+ ServiceFacade.DoOperationsServiceSync(s => s.CreateNewCustomerAPPCodeDC(Convert.ToInt64(para[0]),para[1], para[2]));
+
+ EndWaiting();
+ this.Dispatcher.BeginInvoke(
+ DispatcherPriority.Background,
+ (Action)delegate
+ {
+ if (result != null)
+ {
+ GeneratetTexfield.Text = result.CustomerCode;
+ CodeButtonsOnOFF();
+ }
+ else
+ {
+ MessageBox.Show("Beim erstellen eines neuen Chat-Codes ist ein Fehler aufgetreten.", "Chat-Code erstellen", MessageBoxButton.OK, MessageBoxImage.Exclamation);
+ }
+ });
+ }
+
+ #region Remove
+ private void RemoveCode_OnClick(object sender, RoutedEventArgs e)
+ {
+ if (!GeneratetTexfield.Text.Equals(""))
+ {
+ if (MessageBox.Show("Wollen Sie den Chat-Code wirklich löschen?\nAlle Daten werden gelöscht.", "Achtung", MessageBoxButton.YesNo, MessageBoxImage.Question) == MessageBoxResult.Yes)
+ {
+ StartWaiting();
+
+ List parameter = new List();
+
+ parameter.Add(BeWoApp.Mandator.Apikey);
+ parameter.Add(BeWoApp.Tenant);
+ parameter.Add(customerOid.Value.ToString());
+
+ Thread newThread = new Thread(DeletGeneratedCode);
+ newThread.IsBackground = true;
+ newThread.Start(parameter);
+
+ }
+ }
+ else
+ {
+ MessageBox.Show("Sie müssen vorher einen Chat-Code generieren, bevor sie ihn löschen können", "Info",
+ MessageBoxButton.OK, MessageBoxImage.Information);
+ }
+ }
+
+ private void DeletGeneratedCode(object o)
+ {
+ List para = o as List;
+
+ var isdeletet = ServiceFacade.DoOperationsServiceSync(r => r.DeletCustomerChatCode(para[0], para[1], Convert.ToInt64(para[2])));
+ EndWaiting();
+
+ this.Dispatcher.BeginInvoke(
+ DispatcherPriority.Background,
+ (Action)delegate
+ {
+ if (isdeletet)
+ {
+ GeneratetTexfield.Text = "";
+ CodeButtonsOnOFF();
+ }
+ else
+ {
+ MessageBox.Show("Löschen des Chat-Codes fehlgeschlagen.", "Fehler", MessageBoxButton.OK, MessageBoxImage.Exclamation);
+ }
+ });
+ }
+ #endregion
+
+ #endregion
+
+ #region Klient Ownchat Anmelde-Daten Handler
+ //speicher button auf do savecheck auslagern
+ private void SpeicherButton_OnClick(object sender, RoutedEventArgs e)
+ {
+ var pwStaerke = BeWoUtils.CheckPasswordSecurity(TXTPasswort.Text);
+ if (BeWoApp.AppSettings.IsPasswordSecurityActiv && (pwStaerke == PasswortSecurityStrength.SehrSchwach || pwStaerke == PasswortSecurityStrength.Schwach))
+ {
+ string failure = "Das Passwort ist zu schwach!";
+ MessageBox.Show(failure, "Erstellen des Passworts fehlgeschlagen", MessageBoxButton.OK, MessageBoxImage.Information);
+ return;
+ }
+
+ StartWaiting();
+
+ var isBenutzerNameVorhanden = ServiceFacade.DoCustomerServiceSync(r => r.PruefeObBenutzerKontoSchonVorhanden(customerOid.Value, TXTBenutzerName.Text));
+
+ if (!isBenutzerNameVorhanden)
+ {
+ ServiceFacade.DoCustomerServiceSync(
+ s =>
+ s.SetBenutzerPasswortChatAppCode(customerOid.Value, TXTBenutzerName.Text,
+ TXTPasswort.Text));
+ EndWaiting();
+ MessageBox.Show("Benutzername und Passwort wurden erfolgreich gespeichert.", "Speichern", MessageBoxButton.OK, MessageBoxImage.Information);
+ }
+ else
+ {
+ EndWaiting();
+
+ MessageBox.Show("Dieser Benutzername ist bereits vergeben.", "Speichern", MessageBoxButton.OK, MessageBoxImage.Exclamation);
+ }
+ }
+
+ private void TXTPasswort_OnTextChanged(object sender, TextChangedEventArgs e)
+ {
+ LblPwStaerkenAnzeige = pwS.ErmittleUndZeigePasswortStaerke(TXTPasswort.Text, LblPwStaerkenAnzeige);
+ }
+ #endregion
+
+ #region pdf
+ private void ZeigeHandoutPDF_OnClick(object sender, RoutedEventArgs e)
+ {
+ StartWaiting();
+
+ List parameter = new List();
+ parameter.Add("5473568546"/*BeWoApp.Tenant*/);
+ parameter.Add("0b50c09aff87f20d9ced75340e04e5ccaa11dd3e7bcf25e9c4f94dc20d3cbb97" /*BeWoApp.Mandator.Apikey*/);
+
+ parameter.Add(TXTBenutzerName.Text);
+ parameter.Add(TXTPasswort.Text);
+ parameter.Add(GeneratetTexfield.Text); // chatcode
+
+ Thread newThread = new Thread(DoWork);
+ newThread.IsBackground = true;
+ newThread.Start(parameter);
+ }
+
+ private void DoWork(object o)
+ {
+ List para = o as List;
+
+ var Result = PdfAnzeigen(para[0], para[1],para[2],para[3],para[4]);
+
+ EndWaiting();
+
+ this.Dispatcher.BeginInvoke(
+ DispatcherPriority.Background,
+ (Action)delegate
+ {
+ switch (Result)
+ {
+ case 0:
+ // wenn hier dann alles ok
+
+
+ break;
+ case 11:
+ MessageBox.Show("Kundennummer unbekannt.", "Fehler", MessageBoxButton.OK);
+ break;
+ case 12:
+ MessageBox.Show("Der API-Key ist falsch -> Auth-Error.", "Fehler", MessageBoxButton.OK);
+ break;
+ case 13:
+ MessageBox.Show("Es existiert kein API-Key für die angegebene Kundennummer.", "Fehler", MessageBoxButton.OK);
+ break;
+ case 40:
+ MessageBox.Show("Vorlage nicht gefunden.", "Fehler", MessageBoxButton.OK);
+ break;
+ case 41:
+ MessageBox.Show("Ungültige Custom-Logo-URL.", "Fehler", MessageBoxButton.OK);
+ break;
+ case 60:
+ MessageBox.Show("Fehler: \n" + "", "Fehler", MessageBoxButton.OK);
+ break;
+ }
+
+ });
+ }
+
+ private string ErmittleServerURL(string customerId)
+ {
+ try
+ {
+ string url = "https://dict.ownchat.de/api/server/resolve/1/" + customerId;//customerId; //customerid == kundennummer
+
+ WebRequest request = WebRequest.Create(url);
+
+ request.Credentials = CredentialCache.DefaultCredentials;
+
+ WebResponse response = request.GetResponse();
+
+
+ Stream dataStream = response.GetResponseStream();
+
+ StreamReader reader = new StreamReader(dataStream);
+
+ string responseFromServer = reader.ReadToEnd();
+
+ dataStream.Dispose();
+ reader.Dispose();
+
+ dataStream.Close();
+ reader.Close();
+
+ // string responseFromServer = ReadStreamForChatCode(response);
+
+ var definition = new { status = "", URL = "", SYNCTYPE = "" };
+
+ var jsondaten = JsonConvert.DeserializeAnonymousType(responseFromServer, definition);
+
+ string serverUrl = jsondaten.URL;
+ response.Close();
+
+ return serverUrl;
+ }
+ catch (Exception e)
+ {
+ return null;
+ }
+ }
+
+ private int PdfAnzeigen(string customerId, string apikey,string benutzername, string passwort, string chatcode)
+ {
+ try
+ {
+ int Result = 0;
+
+ #region ServerErmittlung und Link ermittlung
+ string serverUrl = ErmittleServerURL(customerId);
+
+ if (serverUrl == null)
+ {
+ return Result = 11;
+ }
+ else if (serverUrl.Equals(""))
+ {
+ return Result = 11;
+ }
+
+ var endurl = serverUrl + "/api/ownchat/createpdfmanual/" + apikey + "/" + customerId;
+ #endregion
+
+ #region Post Parameter Uebergabe
+
+ Dictionary postparameter = new Dictionary();
+
+ if(!benutzername.Equals(""))
+ postparameter.Add("username", benutzername);
+
+ if(!passwort.Equals(""))
+ postparameter.Add("password", passwort);
+
+ if (!chatcode.Equals(""))
+ postparameter.Add("chatcode", chatcode);
+
+ string postdaten = "";
+ int i = 0;
+ foreach (var key in postparameter.Keys)
+ {
+ postdaten += HttpUtility.UrlEncode(key) + "=" + HttpUtility.UrlEncode(postparameter[key]) + "&";
+ }
+ #endregion
+
+ #region Webrequest Aufbau ink. stream
+ WebRequest requesten = WebRequest.Create(endurl);
+
+ requesten.Method = "POST";
+ requesten.ContentType = "application/x-www-form-urlencoded";
+
+ byte[] daten = Encoding.ASCII.GetBytes(postdaten);
+
+ requesten.ContentLength = daten.Length;
+
+ try
+ {
+ Stream requestStream = requesten.GetRequestStream();
+
+ requestStream.Write(daten, 0, daten.Length);
+
+ requestStream.Close();
+
+ var inte = VerarbeiteErhalteneDaten(requesten);
+
+ return inte;
+ }
+ catch (Exception e)
+ {
+ this.Dispatcher.BeginInvoke(
+ DispatcherPriority.Background,
+ (Action)delegate
+ {
+ MessageBox.Show("Es konnte keine Verbindung aufgebaut werden.", "Fehler", MessageBoxButton.OK);
+ });
+
+ return 0;
+ }
+ #endregion
+
+ }
+ catch (Exception e)
+ {
+ return 60;
+ }
+ }
+
+ private int VerarbeiteErhalteneDaten(WebRequest requesten)
+ {
+ try
+ {
+ #region Verarbeitung der Erhaltenen Daten
+ HttpWebResponse response = (HttpWebResponse)requesten.GetResponse();
+
+ string responseFromServer = "";
+
+ Stream reqStr2 = response.GetResponseStream();
+
+ byte[] barray = null;
+
+ byte[] Stringmesage = null;
+
+ using (var memoryStream = new MemoryStream())
+ {
+ reqStr2.CopyTo(memoryStream);
+ barray = memoryStream.ToArray();
+ }
+
+ if (barray != null)
+ {
+ Stringmesage = barray;
+
+ responseFromServer = System.Text.Encoding.Default.GetString(Stringmesage);
+ }
+
+ if (responseFromServer.Contains("PDF"))
+ {
+ this.Dispatcher.BeginInvoke(
+ DispatcherPriority.Background,
+ (Action)delegate
+ {
+ Microsoft.Win32.SaveFileDialog saveFileDialog1 = new Microsoft.Win32.SaveFileDialog();
+
+ saveFileDialog1.Title = "PDF Speichern";
+ saveFileDialog1.FileName = Path.GetFileName("ownChat-Kurzanleitung.pdf");
+ saveFileDialog1.ShowDialog();
+
+ File.WriteAllBytes(saveFileDialog1.FileName, barray);
+
+ Process.Start(saveFileDialog1.FileName);
+
+ });
+ reqStr2.Close();
+
+
+
+ return 0;
+ }
+ else
+ {
+ var jsonDatentyp = JsonConvert.DeserializeObject(responseFromServer);
+
+ return jsonDatentyp.Result;
+ }
+ #endregion
+ }
+ catch (Exception e)
+ {
+ return 60;
+ }
+ }
+
+ #endregion
+
+ #region Waitlayer
+ private WaitLayer2 _waitLayer = null;
+
+ public void StartWaiting()
+ {
+ Dispatcher.BeginInvoke(DispatcherPriority.Background, (Action)StartWaitingImmediately);
+ }
+
+ public void StartWaitingImmediately()
+ {
+ if (_waitLayer == null)
+ {
+ _waitLayer = new WaitLayer2();
+ //Grid.SetColumnSpan(_waitLayer, 3);
+ //Grid.SetRowSpan(_waitLayer, 3);
+ ChatServiceCustomerGrid.Children.Add(_waitLayer);
+ Panel.SetZIndex(_waitLayer, int.MaxValue);
+ _waitLayer.RefreshChatUI();
+ }
+ }
+
+ public void EndWaiting()
+ {
+ Dispatcher.BeginInvoke(
+ DispatcherPriority.Background,
+ (Action)delegate
+ {
+ if (_waitLayer != null)
+ {
+ ChatServiceCustomerGrid.Children.Remove(_waitLayer);
+ _waitLayer = null;
+ }
+ });
+ }
+
+ #endregion
+
+
+ }
}
\ No newline at end of file
diff --git a/BeWo/View/ChatServiceEmployee.xaml b/BeWo/ownChat/ChatServiceEmployee.xaml
similarity index 95%
rename from BeWo/View/ChatServiceEmployee.xaml
rename to BeWo/ownChat/ChatServiceEmployee.xaml
index dad9a7261..d23824372 100644
--- a/BeWo/View/ChatServiceEmployee.xaml
+++ b/BeWo/ownChat/ChatServiceEmployee.xaml
@@ -1,81 +1,81 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/BeWo/View/ChatServiceEmployee.xaml.cs b/BeWo/ownChat/ChatServiceEmployee.xaml.cs
similarity index 80%
rename from BeWo/View/ChatServiceEmployee.xaml.cs
rename to BeWo/ownChat/ChatServiceEmployee.xaml.cs
index 953cd0063..c67aa149c 100644
--- a/BeWo/View/ChatServiceEmployee.xaml.cs
+++ b/BeWo/ownChat/ChatServiceEmployee.xaml.cs
@@ -1,531 +1,562 @@
-using System;
-using System.Collections.Generic;
-using System.Collections.Specialized;
-using System.ComponentModel;
-using System.Diagnostics;
-using System.IO;
-using System.Linq;
-using System.Net;
-using System.Text;
-using System.Threading;
-using System.Web;
-using System.Windows;
-using System.Windows.Controls;
-using System.Windows.Controls.Primitives;
-using System.Windows.Data;
-using System.Windows.Documents;
-using System.Windows.Input;
-using System.Windows.Media;
-using System.Windows.Media.Imaging;
-using System.Windows.Navigation;
-using System.Windows.Threading;
-
-using BeWo.Core;
-using BeWo.ViewModel;
-using BeWo.ServiceProxy;
-
-using BS.Shared.DataContracts;
-using BS.Shared.Extensions;
-using BS.Shared;
-using BS.Shared.Core;
-using ChatController.ChatKlassen;
-using DevExpress.Office.Utils;
-using DevExpress.Pdf;
-using DevExpress.Pdf.Native;
-using Microsoft.Win32;
-using Newtonsoft.Json;
-
-namespace BeWo.View
-{
- public partial class ChatServiceEmployee
- {
-
- private CustomerVM _ViewModel;
-
- private long? employeeOid;
- private long? personOid;
-
- public ChatServiceEmployee(TableID pObjectTid, long? oid, long? empUserOid)
- {
- InitializeComponent();
-
- employeeOid = oid;
- personOid = empUserOid;
-
- LaodInfostoView();
- }
-
-
- public CustomerVM PublicViewModel { get { return _ViewModel; } }
-
-
-
-
- public override bool IsDirty
- {
- get
- {
- return ViewModel != null && ViewModel.IsDirty;
- }
- }
-
- private CustomerVM ViewModel
- {
- get { return _ViewModel; }
-
- set
- {
- DataContext = value;
- _ViewModel = value;
- }
- }
-
- private void GenerateCodeClick(object sender, RoutedEventArgs e)
- {
- if (!GeneratetTexfield.Text.Equals("") && BeWoApp.Tenant != null && BeWoApp.Mandator.Apikey != null)
- {
- if (MessageBox.Show("Wollen Sie wirklich den Chat-Code ändern?\nAlle Daten auf Mobilgeräte werden gelöscht.", "Achtung", MessageBoxButton.YesNo,
- MessageBoxImage.Question) == MessageBoxResult.Yes)
- {
- StartWaiting();
- var result = ServiceFacade.DoOperationsServiceSync(s => s.CreateNewEmployeeAPPCodeDC(employeeOid.Value, BeWoApp.Tenant, BeWoApp.Mandator.Apikey, personOid.Value));
-
- EndWaiting();
- if(result != null){
- GeneratetTexfield.Text = result.EmployeeCode;
- CodeButtonsOnOFF();
- }
- else{
- MessageBox.Show("Beim Erstellen eines neuen Chat-Codes ist ein Fehler aufgetreten.");
- //result.Result mit switc case Fehler ausgabe
- }
- }
- }
- else
- {
- if (BeWoApp.Tenant != null && BeWoApp.Mandator.Apikey != null)
- {
- StartWaiting();
- var result =
- ServiceFacade.DoOperationsServiceSync(
- s =>
- s.CreateNewEmployeeAPPCodeDC(employeeOid.Value, BeWoApp.Tenant, BeWoApp.Mandator.Apikey,
- personOid.Value));
- EndWaiting();
-
- //GeneratetTexfield.Text = result.EmployeeCode;
-
- if(result != null){
- GeneratetTexfield.Text = result.EmployeeCode;
- CodeButtonsOnOFF();
- }
- else{
- MessageBox.Show("Beim erstellen eines neuen Chat-Codes ist ein Fehler aufgetreten.");
- //result.Result mit switc case Fehler ausgabe
- }
- }
- else
- {
- MessageBox.Show("Sie besitzen derzeit keinen API-Key. Bitte wenden Sie sich an den Support.",
- "Info", MessageBoxButton.OK);
- }
- }
- }
-
- #region Nicht benutzte Events
- //private void CheckBox_Checked(object sender, RoutedEventArgs e)
- //{
- // ServiceFacade.DoOperationsServiceSync(s => s.UpdateIsChatActiveEmployeeAPPCodeDC(employeeOid.Value, 1));
- //}
-
- //private void CheckBox_Unchecked(object sender, RoutedEventArgs e)
- //{
- // ServiceFacade.DoOperationsServiceSync(s => s.UpdateIsChatActiveEmployeeAPPCodeDC(employeeOid.Value, 0));
- //}
-
- //private void Creat_NotfallMessage(object sender, RoutedEventArgs e)
- //{
- // if(!NotfallTexfield.Text.Equals(""))
- // ServiceFacade.DoOperationsServiceSync(s => s.UpdateNotfallNacrichtEmployeeAPPCodeDC(employeeOid.Value, NotfallTexfield.Text));
- //}
-
-
- #endregion
-
- private void LaodInfostoView()
- {
- var getEmployeeAppCode = ServiceFacade.DoEmployeeServiceSync(s => s.GetAllEmployeeAppCodes(employeeOid.Value));
-
- int x;
- if (getEmployeeAppCode.Count > 0){
- x = getEmployeeAppCode[getEmployeeAppCode.Count - 1].IsChatAktive;
-
- GeneratetTexfield.Text = getEmployeeAppCode[getEmployeeAppCode.Count - 1].EmployeeCode;
- }
-
- CodeButtonsOnOFF();
- }
-
- private void CodeButtonsOnOFF()
- {
- if (!GeneratetTexfield.Text.Equals(""))
- {
- //lblGenerateCode.Content = "Chat-Code erneuern";
- RemoveButton.Visibility = Visibility.Visible;
- EmployeeHandoutButton.Visibility = Visibility.Visible;
-
- ButtonGenerateCode.ToolTip = "Chat-Code erneuern";
-
- var image = new Image
- {
- //Source = new BitmapImage(
- // new Uri(
- // "pack://application:,,,/ChatController;component/Ressourcen/SymbolRefresh32.png"))
-
- Source = new BitmapImage(
- new Uri(
- "pack://application:,,,/Ressources/Icons/SymbolRefresh32.png"))
- };
-
- ImageGenerateCode.Source = image.Source;
- }
- else
- {
- RemoveButton.Visibility = Visibility.Collapsed;
- EmployeeHandoutButton.Visibility = Visibility.Collapsed;
-
- ButtonGenerateCode.ToolTip = "Chat-Code anfordern";
-
- var image = new Image
- {
- Source = new BitmapImage(
- new Uri(
- "pack://application:,,,/Ressources/Icons/DocumentWithAdd2.png"))
- };
-
- ImageGenerateCode.Source = image.Source;
- }
- }
-
- #region Pdf Gedönse
-
- private void ZeigePDF_OnClick(object sender, RoutedEventArgs e)
- {
- StartWaiting();
-
- //var handout = ServiceFacade.DoOperationsServiceSync(r => r.GetHandOutPdfForChat("5473568546", "0b50c09aff87f20d9ced75340e04e5ccaa11dd3e7bcf25e9c4f94dc20d3cbb97"/*BeWoApp.Tenant, BeWoApp.Mandator.Apikey*/));
-
- List parameter = new List();
- parameter.Add(BeWoApp.Tenant);
- parameter.Add(BeWoApp.Mandator.Apikey);
-
- parameter.Add(GeneratetTexfield.Text); // chat code
-
- Thread newThread = new Thread(DoWork);
- newThread.IsBackground = true;
- newThread.Start(parameter);
- }
-
- private void DoWork(object o )
- {
- List para = o as List;
-
- var Result = PdfAnzeigen(para[0], para[1],para[2]);
-
- EndWaiting();
-
- this.Dispatcher.BeginInvoke(
- DispatcherPriority.Background,
- (Action)delegate
- {
- switch (Result)
- {
- case 0:
- // wenn hier dann alles ok
-
-
- break;
- case 11:
- MessageBox.Show("Kundennummer unbekannt.", "Fehler", MessageBoxButton.OK);
- break;
- case 12:
- MessageBox.Show("Der API-Key ist falsch -> Auth-Error.", "Fehler", MessageBoxButton.OK);
- break;
- case 13:
- MessageBox.Show("Es existiert kein API-Key für die angegebene Kundennummer.", "Fehler", MessageBoxButton.OK);
- break;
- case 40:
- MessageBox.Show("Vorlage nicht gefunden.", "Fehler", MessageBoxButton.OK);
- break;
- case 41:
- MessageBox.Show("Ungültige Custom-Logo-URL.", "Fehler", MessageBoxButton.OK);
- break;
- case 60:
- MessageBox.Show("Fehler: \n" + "", "Fehler", MessageBoxButton.OK);
- break;
- }
-
- });
- }
-
- private string ErmittleServerURL(string customerId)
- {
- try
- {
- string url = "https://dict.ownchat.de/api/server/resolve/1/" + customerId;//customerId; //customerid == kundennummer
-
- WebRequest request = WebRequest.Create(url);
-
- request.Credentials = CredentialCache.DefaultCredentials;
-
- WebResponse response = request.GetResponse();
-
-
- Stream dataStream = response.GetResponseStream();
-
- StreamReader reader = new StreamReader(dataStream);
-
- string responseFromServer = reader.ReadToEnd();
-
- dataStream.Dispose();
- reader.Dispose();
-
- dataStream.Close();
- reader.Close();
-
- // string responseFromServer = ReadStreamForChatCode(response);
-
- var definition = new { status = "", URL = "", SYNCTYPE = "" };
-
- var jsondaten = JsonConvert.DeserializeAnonymousType(responseFromServer, definition);
-
- string serverUrl = jsondaten.URL;
- response.Close();
-
- return serverUrl;
- }
- catch (Exception e)
- {
- return null;
- }
- }
-
- private int PdfAnzeigen(string customerId, string apikey, string chatcode)
- {
- try
- {
- int Result = 0;
-
- #region ServerErmittlung und Link ermittlung
- string serverUrl = ErmittleServerURL(customerId);
-
- if (serverUrl == null)
- {
- return Result = 11;
- }
- else if (serverUrl.Equals(""))
- {
- return Result = 11;
- }
-
- var endurl = serverUrl + "/api/ownchat/createpdfmanual/" + apikey + "/" + customerId;
- #endregion
-
- #region Post Parameter Uebergabe
-
- Dictionary postparameter = new Dictionary();
-
- //if (personOid != null && personOid.Value == BeWoApp.LoggedOnUser.Employee.PersonOid) {
- // postparameter.Add("username", BeWoApp.UserName);
- // postparameter.Add("password", BeWoApp.UserPassword);
- //}
-
- if (!chatcode.Equals(""))
- postparameter.Add("chatcode", chatcode);
-
- string postdaten = "";
- int i = 0;
- foreach (var key in postparameter.Keys)
- {
- postdaten += HttpUtility.UrlEncode(key) + "=" + HttpUtility.UrlEncode(postparameter[key]) + "&";
- }
- #endregion
-
- #region Webrequest Aufbau ink. stream
- WebRequest requesten = WebRequest.Create(endurl);
-
- requesten.Method = "POST";
- requesten.ContentType = "application/x-www-form-urlencoded";
-
- byte[] daten = Encoding.ASCII.GetBytes(postdaten);
-
- requesten.ContentLength = daten.Length;
-
- try
- {
- Stream requestStream = requesten.GetRequestStream();
-
- requestStream.Write(daten, 0, daten.Length);
-
- requestStream.Close();
-
- var inte = VerarbeiteErhalteneDaten(requesten);
-
- return inte;
- }
- catch (Exception e)
- {
- this.Dispatcher.BeginInvoke(
- DispatcherPriority.Background,
- (Action)delegate
- {
- MessageBox.Show("Es konnte keine Verbindung aufgebaut werden.", "Fehler", MessageBoxButton.OK);
- });
-
- return 0;
- }
- #endregion
-
- }
- catch (Exception e)
- {
- return 60;
- }
- }
-
- private int VerarbeiteErhalteneDaten(WebRequest requesten)
- {
- try
- {
- #region Verarbeitung der Erhaltenen Daten
- HttpWebResponse response = (HttpWebResponse)requesten.GetResponse();
-
- string responseFromServer = "";
-
- Stream reqStr2 = response.GetResponseStream();
-
- byte[] barray = null;
-
- byte[] Stringmesage = null;
-
- using (var memoryStream = new MemoryStream())
- {
- reqStr2.CopyTo(memoryStream);
- barray = memoryStream.ToArray();
- }
-
- if (barray != null)
- {
- Stringmesage = barray;
-
- responseFromServer = System.Text.Encoding.Default.GetString(Stringmesage);
- }
-
- if (responseFromServer.Contains("PDF"))
- {
- this.Dispatcher.BeginInvoke(
- DispatcherPriority.Background,
- (Action)delegate
- {
- SaveFileDialog saveFileDialog1 = new SaveFileDialog();
-
- saveFileDialog1.Title = "PDF Speichern";
- saveFileDialog1.FileName = Path.GetFileName("ownChat-Kurzanleitung.pdf");
- saveFileDialog1.ShowDialog();
-
- File.WriteAllBytes(saveFileDialog1.FileName, barray);
-
- Process.Start(saveFileDialog1.FileName);
-
- });
- reqStr2.Close();
-
-
-
- return 0;
- }
- else
- {
- var jsonDatentyp = JsonConvert.DeserializeObject(responseFromServer);
-
- return jsonDatentyp.Result;
- }
- #endregion
- }
- catch (Exception e)
- {
- return 60;
- }
- }
-
- #endregion
-
-
- private void RemoveCode_OnClick(object sender, RoutedEventArgs e)
- {
- if (!GeneratetTexfield.Text.Equals(""))
- {
- if (MessageBox.Show("Wollen Sie den Chat-Code wirklich löschen?\nAlle Daten auf Mobilgeräte werden gelöscht.", "Achtung", MessageBoxButton.YesNo, MessageBoxImage.Question) == MessageBoxResult.Yes)
- {
- StartWaiting();
-
- var isdeletet = ServiceFacade.DoOperationsServiceSync(r => r.DeletEmloyeeChatCode(BeWoApp.Mandator.Apikey, BeWoApp.Tenant, personOid.Value));
-
- EndWaiting();
-
- if (isdeletet)
- {
- GeneratetTexfield.Text = "";
- CodeButtonsOnOFF();
- }
- else
- {
- MessageBox.Show("Löschen des Chat-Codes Fehlgeschlagen.", "Fehler");
- }
- }
- }
- else
- {
- MessageBox.Show("Sie müssen vorher einen Chat-Code generieren, bevor sie ihn löschen können", "Info",
- MessageBoxButton.OK, MessageBoxImage.Information);
- }
- }
-
- #region Waitlayer
- private WaitLayer2 _waitLayer = null;
-
- public void StartWaiting()
- {
- Dispatcher.BeginInvoke(DispatcherPriority.Background, (Action)StartWaitingImmediately);
- }
-
- public void StartWaitingImmediately()
- {
- if (_waitLayer == null)
- {
- _waitLayer = new WaitLayer2();
- //Grid.SetColumnSpan(_waitLayer, 3);
- //Grid.SetRowSpan(_waitLayer, 3);
- ChatServiceEmployeeGrid.Children.Add(_waitLayer);
- Panel.SetZIndex(_waitLayer, int.MaxValue);
- _waitLayer.RefreshChatUI();
- }
- }
-
- public void EndWaiting()
- {
- Dispatcher.BeginInvoke(
- DispatcherPriority.Background,
- (Action)delegate
- {
- if (_waitLayer != null)
- {
- ChatServiceEmployeeGrid.Children.Remove(_waitLayer);
- _waitLayer = null;
- }
- });
- }
-
- #endregion
- }
+using System;
+using System.Collections.Generic;
+using System.Collections.Specialized;
+using System.ComponentModel;
+using System.Diagnostics;
+using System.IO;
+using System.Linq;
+using System.Net;
+using System.Text;
+using System.Threading;
+using System.Web;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Controls.Primitives;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Navigation;
+using System.Windows.Threading;
+
+using BeWo.Core;
+using BeWo.ViewModel;
+using BeWo.ServiceProxy;
+using BeWo.View;
+using BS.Shared.DataContracts;
+using BS.Shared.Extensions;
+using BS.Shared;
+using BS.Shared.Core;
+using ChatController.ChatKlassen;
+using DevExpress.Office.Utils;
+using DevExpress.Pdf;
+using DevExpress.Pdf.Native;
+using Microsoft.Win32;
+using Newtonsoft.Json;
+
+namespace BeWo.ownChat
+{
+ public partial class ChatServiceEmployee
+ {
+
+ private EmployeeVM _ViewModel;
+
+ private long? employeeOid;
+ private long? personOid;
+
+ public ChatServiceEmployee(TableID pObjectTid, long? oid, long? empUserOid)
+ {
+ InitializeComponent();
+
+ employeeOid = oid;
+ personOid = empUserOid;
+
+ LaodInfostoView();
+ }
+
+
+ public EmployeeVM PublicViewModel { get { return _ViewModel; } }
+
+ public override bool IsDirty
+ {
+ get
+ {
+ return ViewModel != null && ViewModel.IsDirty;
+ }
+ }
+
+ private EmployeeVM ViewModel
+ {
+ get { return _ViewModel; }
+
+ set
+ {
+ DataContext = value;
+ _ViewModel = value;
+ }
+ }
+
+
+ private void LaodInfostoView()
+ {
+ var getEmployeeAppCode = ServiceFacade.DoEmployeeServiceSync(s => s.GetAllEmployeeAppCodes(employeeOid.Value));
+
+ int x;
+ if (getEmployeeAppCode.Count > 0)
+ {
+ x = getEmployeeAppCode[getEmployeeAppCode.Count - 1].IsChatAktive;
+
+ GeneratetTexfield.Text = getEmployeeAppCode[getEmployeeAppCode.Count - 1].EmployeeCode;
+ }
+
+ CodeButtonsOnOff();
+ }
+
+ private void CodeButtonsOnOff()
+ {
+ if (!GeneratetTexfield.Text.Equals(""))
+ {
+ //lblGenerateCode.Content = "Chat-Code erneuern";
+ RemoveButton.Visibility = Visibility.Visible;
+ EmployeeHandoutButton.Visibility = Visibility.Visible;
+
+ ButtonGenerateCode.ToolTip = "Chat-Code erneuern";
+
+ var image = new Image
+ {
+ //Source = new BitmapImage(
+ // new Uri(
+ // "pack://application:,,,/ChatController;component/Ressourcen/SymbolRefresh32.png"))
+
+ Source = new BitmapImage(
+ new Uri(
+ "pack://application:,,,/Ressources/Icons/SymbolRefresh32.png"))
+ };
+
+ ImageGenerateCode.Source = image.Source;
+ }
+ else
+ {
+ RemoveButton.Visibility = Visibility.Collapsed;
+ EmployeeHandoutButton.Visibility = Visibility.Collapsed;
+
+ ButtonGenerateCode.ToolTip = "Chat-Code anfordern";
+
+ var image = new Image
+ {
+ Source = new BitmapImage(
+ new Uri(
+ "pack://application:,,,/Ressources/Icons/DocumentWithAdd2.png"))
+ };
+
+ ImageGenerateCode.Source = image.Source;
+ }
+ }
+
+ #region Code Generieren / Erneuern / Löschen
+ private void GenerateCodeClick(object sender, RoutedEventArgs e)
+ {
+ if (!GeneratetTexfield.Text.Equals("") && BeWoApp.Tenant != null && BeWoApp.Mandator.Apikey != null)
+ {
+ if (MessageBox.Show("Wollen Sie wirklich den Chat-Code ändern?\nAlle Daten auf Mobilgeräte werden gelöscht.", "Achtung", MessageBoxButton.YesNo,
+ MessageBoxImage.Question) == MessageBoxResult.Yes)
+ {
+ StartGenerateCode();
+ }
+ }
+ else
+ {
+ if (BeWoApp.Tenant != null && BeWoApp.Mandator.Apikey != null)
+ {
+
+ StartGenerateCode();
+
+ //// diesen bereich als thread azslagern
+ //var result =
+ // ServiceFacade.DoOperationsServiceSync(
+ // s =>
+ // s.CreateNewEmployeeAPPCodeDC(employeeOid.Value, BeWoApp.Tenant, BeWoApp.Mandator.Apikey));
+
+ //EndWaiting();
+
+ ////GeneratetTexfield.Text = result.EmployeeCode;
+
+ //if(result != null){
+ // GeneratetTexfield.Text = result.EmployeeCode;
+ // CodeButtonsOnOff();
+ //}
+ //else{
+ // MessageBox.Show("Beim erstellen eines neuen Chat-Codes ist ein Fehler aufgetreten.");
+ // //result.Result mit switc case Fehler ausgabe
+ //}
+ }
+ else
+ {
+ MessageBox.Show("Sie besitzen derzeit keinen API-Key. Bitte wenden Sie sich an den Support.",
+ "Info", MessageBoxButton.OK);
+ }
+ }
+ }
+
+ private void StartGenerateCode()
+ {
+ StartWaiting();
+
+ List parameter = new List();
+ parameter.Add(employeeOid.Value.ToString());
+ parameter.Add(BeWoApp.Tenant);
+ parameter.Add(BeWoApp.Mandator.Apikey);
+
+ Thread newThread = new Thread(GenerateCode);
+ newThread.IsBackground = true;
+ newThread.Start(parameter);
+ }
+
+ private void GenerateCode(object o)
+ {
+ List para = o as List;
+
+ var result = ServiceFacade.DoOperationsServiceSync(s => s.CreateNewEmployeeAPPCodeDC(Convert.ToInt64(para[0]),para[1],para[2]));
+
+ EndWaiting();
+
+ this.Dispatcher.BeginInvoke(
+ DispatcherPriority.Background,
+ (Action)delegate
+ {
+ if (result != null)
+ {
+ GeneratetTexfield.Text = result.EmployeeCode;
+ CodeButtonsOnOff();
+ }
+ else
+ {
+ MessageBox.Show("Beim Erstellen eines neuen Chat-Codes ist ein Fehler aufgetreten.");
+ }
+ });
+ }
+
+ #region Remove
+ private void RemoveCode_OnClick(object sender, RoutedEventArgs e)
+ {
+ if (!GeneratetTexfield.Text.Equals(""))
+ {
+ if (MessageBox.Show("Wollen Sie den Chat-Code wirklich löschen?\nAlle Daten auf Mobilgeräte werden gelöscht.", "Achtung", MessageBoxButton.YesNo, MessageBoxImage.Question) == MessageBoxResult.Yes)
+ {
+ StartWaiting();
+
+ List parameter = new List();
+
+ parameter.Add(BeWoApp.Mandator.Apikey);
+ parameter.Add(BeWoApp.Tenant);
+ parameter.Add(employeeOid.Value.ToString());
+
+ Thread newThread = new Thread(DeletGeneratedCode);
+ newThread.IsBackground = true;
+ newThread.Start(parameter);
+ }
+ }
+ else
+ {
+ MessageBox.Show("Sie müssen vorher einen Chat-Code generieren, bevor sie ihn löschen können", "Info",
+ MessageBoxButton.OK, MessageBoxImage.Information);
+ }
+ }
+
+ private void DeletGeneratedCode(object o)
+ {
+ List para = o as List;
+
+ var isdeletet = ServiceFacade.DoOperationsServiceSync(r => r.DeletEmloyeeChatCode(para[0],para[1],Convert.ToInt64(para[2])));
+
+ EndWaiting();
+
+ this.Dispatcher.BeginInvoke(
+ DispatcherPriority.Background,
+ (Action)delegate
+ {
+ if (isdeletet)
+ {
+ GeneratetTexfield.Text = "";
+ CodeButtonsOnOff();
+ }
+ else
+ {
+ MessageBox.Show("Löschen des Chat-Codes Fehlgeschlagen.", "Fehler");
+ }
+ });
+ }
+ #endregion
+
+ #endregion
+
+ #region Pdf Gedönse
+
+ private void ZeigePDF_OnClick(object sender, RoutedEventArgs e)
+ {
+ StartWaiting();
+
+ List parameter = new List();
+ parameter.Add(BeWoApp.Tenant);
+ parameter.Add(BeWoApp.Mandator.Apikey);
+
+ parameter.Add(GeneratetTexfield.Text); // chat code
+
+ Thread newThread = new Thread(DoWork);
+ newThread.IsBackground = true;
+ newThread.Start(parameter);
+ }
+
+ private void DoWork(object o )
+ {
+ List para = o as List;
+
+ var Result = PdfAnzeigen(para[0], para[1],para[2]);
+
+ EndWaiting();
+
+ this.Dispatcher.BeginInvoke(
+ DispatcherPriority.Background,
+ (Action)delegate
+ {
+ switch (Result)
+ {
+ case 0:
+ // wenn hier dann alles ok
+
+
+ break;
+ case 11:
+ MessageBox.Show("Kundennummer unbekannt.", "Fehler", MessageBoxButton.OK);
+ break;
+ case 12:
+ MessageBox.Show("Der API-Key ist falsch -> Auth-Error.", "Fehler", MessageBoxButton.OK);
+ break;
+ case 13:
+ MessageBox.Show("Es existiert kein API-Key für die angegebene Kundennummer.", "Fehler", MessageBoxButton.OK);
+ break;
+ case 40:
+ MessageBox.Show("Vorlage nicht gefunden.", "Fehler", MessageBoxButton.OK);
+ break;
+ case 41:
+ MessageBox.Show("Ungültige Custom-Logo-URL.", "Fehler", MessageBoxButton.OK);
+ break;
+ case 60:
+ MessageBox.Show("Fehler: \n" + "", "Fehler", MessageBoxButton.OK);
+ break;
+ }
+
+ });
+ }
+
+ private string ErmittleServerURL(string customerId)
+ {
+ try
+ {
+ string url = "https://dict.ownchat.de/api/server/resolve/1/" + customerId;//customerId; //customerid == kundennummer
+
+ WebRequest request = WebRequest.Create(url);
+
+ request.Credentials = CredentialCache.DefaultCredentials;
+
+ WebResponse response = request.GetResponse();
+
+
+ Stream dataStream = response.GetResponseStream();
+
+ StreamReader reader = new StreamReader(dataStream);
+
+ string responseFromServer = reader.ReadToEnd();
+
+ dataStream.Dispose();
+ reader.Dispose();
+
+ dataStream.Close();
+ reader.Close();
+
+ // string responseFromServer = ReadStreamForChatCode(response);
+
+ var definition = new { status = "", URL = "", SYNCTYPE = "" };
+
+ var jsondaten = JsonConvert.DeserializeAnonymousType(responseFromServer, definition);
+
+ string serverUrl = jsondaten.URL;
+ response.Close();
+
+ return serverUrl;
+ }
+ catch (Exception e)
+ {
+ return null;
+ }
+ }
+
+ private int PdfAnzeigen(string customerId, string apikey, string chatcode)
+ {
+ try
+ {
+ int Result = 0;
+
+ #region ServerErmittlung und Link ermittlung
+ string serverUrl = ErmittleServerURL(customerId);
+
+ if (serverUrl == null)
+ {
+ return Result = 11;
+ }
+ else if (serverUrl.Equals(""))
+ {
+ return Result = 11;
+ }
+
+ var endurl = serverUrl + "/api/ownchat/createpdfmanual/" + apikey + "/" + customerId;
+ #endregion
+
+ #region Post Parameter Uebergabe
+
+ Dictionary postparameter = new Dictionary();
+
+ //if (personOid != null && personOid.Value == BeWoApp.LoggedOnUser.Employee.PersonOid) {
+ // postparameter.Add("username", BeWoApp.UserName);
+ // postparameter.Add("password", BeWoApp.UserPassword);
+ //}
+
+ if (!chatcode.Equals(""))
+ postparameter.Add("chatcode", chatcode);
+
+ string postdaten = "";
+ int i = 0;
+ foreach (var key in postparameter.Keys)
+ {
+ postdaten += HttpUtility.UrlEncode(key) + "=" + HttpUtility.UrlEncode(postparameter[key]) + "&";
+ }
+ #endregion
+
+ #region Webrequest Aufbau ink. stream
+ WebRequest requesten = WebRequest.Create(endurl);
+
+ requesten.Method = "POST";
+ requesten.ContentType = "application/x-www-form-urlencoded";
+
+ byte[] daten = Encoding.ASCII.GetBytes(postdaten);
+
+ requesten.ContentLength = daten.Length;
+
+ try
+ {
+ Stream requestStream = requesten.GetRequestStream();
+
+ requestStream.Write(daten, 0, daten.Length);
+
+ requestStream.Close();
+
+ var inte = VerarbeiteErhalteneDaten(requesten);
+
+ return inte;
+ }
+ catch (Exception e)
+ {
+ this.Dispatcher.BeginInvoke(
+ DispatcherPriority.Background,
+ (Action)delegate
+ {
+ MessageBox.Show("Es konnte keine Verbindung aufgebaut werden.", "Fehler", MessageBoxButton.OK);
+ });
+
+ return 0;
+ }
+ #endregion
+
+ }
+ catch (Exception e)
+ {
+ return 60;
+ }
+ }
+
+ private int VerarbeiteErhalteneDaten(WebRequest requesten)
+ {
+ try
+ {
+ #region Verarbeitung der Erhaltenen Daten
+ HttpWebResponse response = (HttpWebResponse)requesten.GetResponse();
+
+ string responseFromServer = "";
+
+ Stream reqStr2 = response.GetResponseStream();
+
+ byte[] barray = null;
+
+ byte[] Stringmesage = null;
+
+ using (var memoryStream = new MemoryStream())
+ {
+ reqStr2.CopyTo(memoryStream);
+ barray = memoryStream.ToArray();
+ }
+
+ if (barray != null)
+ {
+ Stringmesage = barray;
+
+ responseFromServer = System.Text.Encoding.Default.GetString(Stringmesage);
+ }
+
+ if (responseFromServer.Contains("PDF"))
+ {
+ this.Dispatcher.BeginInvoke(
+ DispatcherPriority.Background,
+ (Action)delegate
+ {
+ SaveFileDialog saveFileDialog1 = new SaveFileDialog();
+
+ saveFileDialog1.Title = "PDF Speichern";
+ saveFileDialog1.FileName = Path.GetFileName("ownChat-Kurzanleitung.pdf");
+ saveFileDialog1.ShowDialog();
+
+ File.WriteAllBytes(saveFileDialog1.FileName, barray);
+
+ Process.Start(saveFileDialog1.FileName);
+
+ });
+ reqStr2.Close();
+
+
+
+ return 0;
+ }
+ else
+ {
+ var jsonDatentyp = JsonConvert.DeserializeObject(responseFromServer);
+
+ return jsonDatentyp.Result;
+ }
+ #endregion
+ }
+ catch (Exception e)
+ {
+ return 60;
+ }
+ }
+
+ #endregion
+
+ #region Waitlayer
+ private WaitLayer2 _waitLayer = null;
+
+ public void StartWaiting()
+ {
+ Dispatcher.BeginInvoke(DispatcherPriority.Background, (Action)StartWaitingImmediately);
+ }
+
+ public void StartWaitingImmediately()
+ {
+ if (_waitLayer == null)
+ {
+ _waitLayer = new WaitLayer2();
+ //Grid.SetColumnSpan(_waitLayer, 3);
+ //Grid.SetRowSpan(_waitLayer, 3);
+ ChatServiceEmployeeGrid.Children.Add(_waitLayer);
+ Panel.SetZIndex(_waitLayer, int.MaxValue);
+ _waitLayer.RefreshChatUI();
+ }
+ }
+
+ public void EndWaiting()
+ {
+ Dispatcher.BeginInvoke(
+ DispatcherPriority.Background,
+ (Action)delegate
+ {
+ if (_waitLayer != null)
+ {
+ ChatServiceEmployeeGrid.Children.Remove(_waitLayer);
+ _waitLayer = null;
+ }
+ });
+ }
+
+ #endregion
+ }
}
\ No newline at end of file
diff --git a/BeWo/View/ChatView.xaml b/BeWo/ownChat/ChatView.xaml
similarity index 79%
rename from BeWo/View/ChatView.xaml
rename to BeWo/ownChat/ChatView.xaml
index f610ed2e1..fb4bc69d7 100644
--- a/BeWo/View/ChatView.xaml
+++ b/BeWo/ownChat/ChatView.xaml
@@ -1,4 +1,4 @@
-
-
+
diff --git a/BeWo/View/ChatView.xaml.cs b/BeWo/ownChat/ChatView.xaml.cs
similarity index 77%
rename from BeWo/View/ChatView.xaml.cs
rename to BeWo/ownChat/ChatView.xaml.cs
index 021f1765a..e29d05f6a 100644
--- a/BeWo/View/ChatView.xaml.cs
+++ b/BeWo/ownChat/ChatView.xaml.cs
@@ -15,15 +15,17 @@ using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using BeWo.Core.Config;
using BeWo.ServiceProxy;
+using BeWo.View;
using BS.Shared.DataContracts.Compact;
using BS.Shared.Extensions;
+using ChatController;
using ChatController.ChatKlassen;
using ChatController.Klassen;
using DevExpress.Xpf.Core;
using Button = System.Windows.Controls.Button;
using MessageBox = System.Windows.MessageBox;
-namespace BeWo.View
+namespace BeWo.ownChat
{
///
/// Interaktionslogik für ChatService.xaml
@@ -41,8 +43,8 @@ namespace BeWo.View
ChatMainControl.InitMitChatdaten(chatDaten);
ChatMainControl.AddContextMenu("In Dokumentation übernehmen", ChatMainControl_OnClickContextMenuItem);
-
- //in einem thread auslagern
+ LadeMessageInfoAusDatenBank();
+
Thread newThread = new Thread(ChatMainControl.SynchronisationVeranlassen);
newThread.IsBackground = true;
newThread.Start();
@@ -61,8 +63,7 @@ namespace BeWo.View
private void CloseWindow()
{
CommandBindings.Add(new CommandBinding(ApplicationCommands.Close, (s, e) =>
- {
- //Close();
+ {
Visibility = Visibility.Hidden;
if (_emojiView != null)
@@ -71,7 +72,8 @@ namespace BeWo.View
}
- ChatMainControl.SpeichereMessageInfoInDatei();
+
+ SpeichereMessageInfosInDatenBank();
}));
}
@@ -173,11 +175,9 @@ namespace BeWo.View
#endregion
-
-
- #region Close chat
+ #region Close chat / wird nicht benutzt
private void MainWindow_OnClosed(object sender, EventArgs e)
- {
+ {
//_emojiView = null;
//ChatMainControl.SpeichereMessageInfoInDatei();
@@ -202,5 +202,48 @@ namespace BeWo.View
}
#endregion
+ #region Speichere/Lade MessageSync In DB
+
+ private void SpeichereMessageInfosInDatenBank()
+ {
+ var liste = ChatMainControl.UebergebeMessageInfoDatenFuerDb();
+
+ if (liste.Count != 0)
+ {
+ string text="";
+ foreach (var item in liste)
+ {
+ text += item.GroupId + ";" + item.TimeStamp + ";"+"&";
+ }
+
+ ServiceFacade.DoEmployeeServiceSync(r => r.CreateOrUpdateChatBewoMessageSync(BeWoApp.LoggedOnUser.Employee.EmployeeOid,text));
+ }
+ }
+
+ private void LadeMessageInfoAusDatenBank()
+ {
+ var item = ServiceFacade.DoEmployeeServiceSync(r => r.GetChatBewoMessageSync(BeWoApp.LoggedOnUser.Employee.EmployeeOid));
+
+ if (item != null)
+ {
+ string[] messageSynctext = item.MessageSyncText.Split('&');
+
+ Dictionary aa = new Dictionary();
+
+ foreach (var text in messageSynctext)
+ {
+ if (!text.Equals("")) {
+ string[] splitten = text.Split(';');
+
+ aa.Add(Convert.ToInt64(splitten[0]), DateTime.Parse(splitten[1]));
+ }
+ }
+
+ ChatMainControl.ErhalteMessageInfoVonDb(aa);
+ }
+ }
+
+ #endregion
+
}
}
diff --git a/BeWoPlanerMobil/Controllers/ChatController.cs b/BeWoPlanerMobil/Controllers/ChatController.cs
index 6b48c89d1..82f636a51 100644
--- a/BeWoPlanerMobil/Controllers/ChatController.cs
+++ b/BeWoPlanerMobil/Controllers/ChatController.cs
@@ -168,6 +168,13 @@ namespace BeWoPlanerMobil.Controllers
input.Status = "3";
if (daten.IsActive == ActivationTypeId.Archived)
input.Status = "2";
+
+
+ if (daten.TerminationDate != null && daten.TerminationDate.Value.Date < DateTime.Now.Date)
+ {
+ input.Status = "2";
+ }
+
input1.Add(input);
diff --git a/Data/Access/SearchDAO.cs b/Data/Access/SearchDAO.cs
index 668e80993..caf8e8765 100644
--- a/Data/Access/SearchDAO.cs
+++ b/Data/Access/SearchDAO.cs
@@ -2187,5 +2187,13 @@ namespace BeWo.Data.Access
return criteria.List();
}
+
+ public IEnumerable FindEmployeeChatBewoMessageSync(long oid)
+ {
+ var c = CreateCriteriaIsActive()
+ .Add(Restrictions.Eq(ChatBewoMessageSync.PropertyName_EmployeeOid, oid));
+
+ return c.List();
+ }
}
}
diff --git a/Data/Data.csproj b/Data/Data.csproj
index 961453770..032deca3d 100644
--- a/Data/Data.csproj
+++ b/Data/Data.csproj
@@ -168,6 +168,7 @@
+
@@ -569,6 +570,9 @@
+
+ Designer
+
Designer
diff --git a/Data/Entities/ChatBewoMessageSync.cs b/Data/Entities/ChatBewoMessageSync.cs
new file mode 100644
index 000000000..cfeceee3d
--- /dev/null
+++ b/Data/Entities/ChatBewoMessageSync.cs
@@ -0,0 +1,54 @@
+using BS.Shared;
+using System;
+using System.Collections.Generic;
+
+namespace BeWo.Data.Entities
+{
+ public class ChatBewoMessageSync : BeWoEntityBase
+ {
+ public static string PropertyName_EmployeeOid = "EmployeeOid";
+
+ public static string PropertyName_MessageSyncText = "MessageSyncText";
+
+ private long? _EmployeeOid;
+
+ private string _MessageSyncText;
+
+ public ChatBewoMessageSync()
+ {
+ this._Tid = TableID.ChatBewoMessageSync;
+ }
+
+ public virtual string MessageSyncText
+ {
+ get
+ {
+ return this._MessageSyncText;
+ }
+
+ set
+ {
+ if (this.AreDifferent(this._MessageSyncText, value))
+ {
+ this._MessageSyncText = value;
+ }
+ }
+ }
+
+ public virtual long? EmployeeOid
+ {
+ get
+ {
+ return _EmployeeOid;
+ }
+ set
+ {
+ if (AreDifferent(_EmployeeOid, value))
+ {
+ _EmployeeOid = value;
+ }
+ }
+ }
+
+ }
+}
\ No newline at end of file
diff --git a/Data/Mappings/ChatBewoMessageSync.hbm.xml b/Data/Mappings/ChatBewoMessageSync.hbm.xml
new file mode 100644
index 000000000..3c0df85fe
--- /dev/null
+++ b/Data/Mappings/ChatBewoMessageSync.hbm.xml
@@ -0,0 +1,21 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Model/Changes_2017_11_08.txt b/Model/Changes_2017_11_08.txt
new file mode 100644
index 000000000..6c558b28d
--- /dev/null
+++ b/Model/Changes_2017_11_08.txt
@@ -0,0 +1,24 @@
+CREATE TABLE `1234567890`.`chatbewomessagesync` (
+ `Oid` BIGINT(19) NOT NULL AUTO_INCREMENT COMMENT '',
+
+ `EmployeeOid` BIGINT(19) NULL COMMENT '',
+
+ `Tid` INT(10) NULL COMMENT '',
+
+ `Notice` VARCHAR(1024) NULL COMMENT '',
+
+ `InsTs` DATETIME NULL COMMENT '',
+
+ `InsUser` VARCHAR(1024) NULL COMMENT '',
+
+ `Version` BIGINT(19) NULL COMMENT '',
+
+ `UdpUser` VARCHAR(256) NULL COMMENT '',
+
+ `isActive` TINYINT(4) NULL COMMENT '',
+
+ `SystemEntryID` INT(10) NULL COMMENT '',
+
+ `MessageSyncText` VARCHAR(1024) NULL COMMENT '',
+
+ PRIMARY KEY (`Oid`) COMMENT '');
diff --git a/Service/DCEntityMapper/ChatBewoMessageSyncDC_ChatBewoMessageSync.cs b/Service/DCEntityMapper/ChatBewoMessageSyncDC_ChatBewoMessageSync.cs
new file mode 100644
index 000000000..6abb35cd6
--- /dev/null
+++ b/Service/DCEntityMapper/ChatBewoMessageSyncDC_ChatBewoMessageSync.cs
@@ -0,0 +1,37 @@
+using System.IO;
+using BeWo.Data.Entities;
+using BS.Shared;
+using BS.Shared.DataContracts;
+
+namespace BeWo.Service.DCEntityMapper
+{
+ public class ChatBewoMessageSyncDC_ChatBewoMessageSync : AbstractIDCEntityMapper
+ {
+ public override ChatBewoMessageSyncDC MergeWithDC(ChatBewoMessageSync pEntity, ChatBewoMessageSyncDC pDataContract)
+ {
+ pDataContract.EmployeeOid = pEntity.EmployeeOid;
+ pDataContract.MessageSyncText = pEntity.MessageSyncText;
+
+ return pDataContract;
+ }
+
+ public override ChatBewoMessageSync MergeWithEntity(ChatBewoMessageSyncDC pDataContract, ChatBewoMessageSync pEntity)
+ {
+ pEntity.EmployeeOid = pDataContract.EmployeeOid;
+ pEntity.MessageSyncText = pDataContract.MessageSyncText;
+
+ return pEntity;
+ }
+
+ protected override bool AreDCAndEntityEqual(ChatBewoMessageSyncDC pDC, ChatBewoMessageSync pEntity)
+ {
+
+ if (pDC.ChatBewoMessageSyncOid == null)
+ {
+ return false;
+ }
+
+ return pDC.ChatBewoMessageSyncOid == pEntity.Oid;
+ }
+ }
+}
\ No newline at end of file
diff --git a/Service/DCEntityMapper/MapperFactory.cs b/Service/DCEntityMapper/MapperFactory.cs
index 3d1b31271..00b3c404a 100644
--- a/Service/DCEntityMapper/MapperFactory.cs
+++ b/Service/DCEntityMapper/MapperFactory.cs
@@ -47,6 +47,8 @@ namespace BeWo.Service.DCEntityMapper
private static VertretungDC_Vertretung _VertretungDC_Vertretung;
+ private static ChatBewoMessageSyncDC_ChatBewoMessageSync _ChatBewoMessageSyncDC_ChatBewoMessageSync;
+
private static TokenDC_Token _TokenDC_Token;
private static QuittierungsCheckDC_QuittierungsCheck _QuittierungsCheckDC_QuittierungsCheck;
@@ -552,6 +554,14 @@ namespace BeWo.Service.DCEntityMapper
}
}
+ public static ChatBewoMessageSyncDC_ChatBewoMessageSync ChatBewoMessageSyncDC_ChatBewoMessageSync
+ {
+ get
+ {
+ return _ChatBewoMessageSyncDC_ChatBewoMessageSync ?? (_ChatBewoMessageSyncDC_ChatBewoMessageSync = new ChatBewoMessageSyncDC_ChatBewoMessageSync());
+ }
+ }
+
public static TokenDC_Token TokenDC_Token
{
get
diff --git a/Service/Plugins/SaveInterceptor.cs b/Service/Plugins/SaveInterceptor.cs
index 4d78d54ee..957550dd3 100644
--- a/Service/Plugins/SaveInterceptor.cs
+++ b/Service/Plugins/SaveInterceptor.cs
@@ -15,11 +15,11 @@ namespace BeWo.Service.Plugins
public virtual String AllowSaveCustomer(CustomerDC c)
{
- //ZUM TESTEN ;-)
- if (!String.IsNullOrWhiteSpace(c.Notice) && c.Notice.Contains("NEIN"))
- {
- return "NEIN";
- }
+ // //ZUM TESTEN ;-)
+ //if (!String.IsNullOrWhiteSpace(c.Notice) && c.Notice.Contains("NEIN"))
+ //{
+ // return "NEIN";
+ //}
return null;
}
}
diff --git a/Service/Service.csproj b/Service/Service.csproj
index 814a00894..c03464ec6 100644
--- a/Service/Service.csproj
+++ b/Service/Service.csproj
@@ -230,6 +230,7 @@
+
diff --git a/Service/ServiceContracts/IEmployeeService.cs b/Service/ServiceContracts/IEmployeeService.cs
index a55f529bf..f0fb31ef1 100644
--- a/Service/ServiceContracts/IEmployeeService.cs
+++ b/Service/ServiceContracts/IEmployeeService.cs
@@ -359,5 +359,13 @@ namespace BeWo.Service.ServiceContracts
[FaultContract(typeof(BeWoFault))]
[OperationContract]
EmployeeDC GetEmployeebyFullName(string fullName);
+
+ [FaultContract(typeof(BeWoFault))]
+ [OperationContract]
+ void CreateOrUpdateChatBewoMessageSync(long? eOid, string text);
+
+ [FaultContract(typeof(BeWoFault))]
+ [OperationContract]
+ ChatBewoMessageSyncDC GetChatBewoMessageSync(long? eOid);
}
}
\ No newline at end of file
diff --git a/Service/ServiceContracts/IOperationsService.cs b/Service/ServiceContracts/IOperationsService.cs
index 475caa60a..2fd7c4d5f 100644
--- a/Service/ServiceContracts/IOperationsService.cs
+++ b/Service/ServiceContracts/IOperationsService.cs
@@ -524,7 +524,7 @@ namespace BeWo.Service.ServiceContracts
[FaultContract(typeof(BeWoFault))]
[OperationContract]
- CustomerAPPCodeDC CreateNewCustomerAPPCodeDC(long customerOid, string kundennummer, string apikey, long userOid);
+ CustomerAPPCodeDC CreateNewCustomerAPPCodeDC(long customerOid, string kundennummer, string apikey);
[FaultContract(typeof (BeWoFault))]
[OperationContract]
@@ -544,7 +544,7 @@ namespace BeWo.Service.ServiceContracts
[FaultContract(typeof(BeWoFault))]
[OperationContract]
- EmployeeAPPCodeDC CreateNewEmployeeAPPCodeDC(long employeeOid, string kundennummer, string apikey, long userOid);
+ EmployeeAPPCodeDC CreateNewEmployeeAPPCodeDC(long employeeOid, string kundennummer, string apikey);
[FaultContract(typeof (BeWoFault))]
[OperationContract]
@@ -698,15 +698,11 @@ namespace BeWo.Service.ServiceContracts
[FaultContract(typeof(BeWoFault))]
[OperationContract]
- PdfChatHandoutDC GetHandOutPdfForChat(string customerId, string apikey);
+ bool DeletEmloyeeChatCode(string apikey, string kundennummer, long employeeoid);
[FaultContract(typeof(BeWoFault))]
[OperationContract]
- bool DeletEmloyeeChatCode(string apikey, string kundennummer, long userOid);
-
- [FaultContract(typeof(BeWoFault))]
- [OperationContract]
- bool DeletCustomerChatCode(string apikey, string kundennummer, long userOid);
+ bool DeletCustomerChatCode(string apikey, string kundennummer, long customeroid);
[FaultContract(typeof(BeWoFault))]
[OperationContract]
diff --git a/Service/ServiceImplementations/EmployeeServiceImp.cs b/Service/ServiceImplementations/EmployeeServiceImp.cs
index 2e9d59890..0420f408e 100644
--- a/Service/ServiceImplementations/EmployeeServiceImp.cs
+++ b/Service/ServiceImplementations/EmployeeServiceImp.cs
@@ -1352,6 +1352,68 @@ namespace BeWo.Service.ServiceImplementations
}
}
+ public void CreateOrUpdateChatBewoMessageSync(long? eOid, string text)
+ {
+ try
+ {
+
+ var chatMessageSync = DAOFactory.SearchDAO.FindEmployeeChatBewoMessageSync(eOid.Value);
+
+ int count = chatMessageSync.Count();
+ if(count > 0) {
+
+ foreach (var item in chatMessageSync)
+ {
+ item.MessageSyncText = text;
+ }
+
+ DAOFactory.GenericDAO.Update(chatMessageSync);
+ }
+ else {
+ ChatBewoMessageSyncDC cms = new ChatBewoMessageSyncDC();
+
+ cms.EmployeeOid = eOid;
+ cms.MessageSyncText = text;
+
+ var x = MapperFactory.ChatBewoMessageSyncDC_ChatBewoMessageSync.MapToNewEntity(cms);
+ DAOFactory.GenericDAO.Insert(x);
+ }
+ }
+ catch (Exception e)
+ {
+ throw Utils.CreateBeWoFaultException(e);
+ }
+ }
+
+ public ChatBewoMessageSyncDC GetChatBewoMessageSync(long? eOid)
+ {
+ try
+ {
+ var chatMessageSync = DAOFactory.GenericDAO.GetAllActive();
+
+ ChatBewoMessageSync cms = null;
+ foreach (var item in chatMessageSync)
+ {
+ if (eOid == item.EmployeeOid)
+ {
+ cms = item;
+ }
+ }
+
+ if (cms != null)
+ {
+ var x = MapperFactory.ChatBewoMessageSyncDC_ChatBewoMessageSync.MapToNewDC(cms);
+
+ return x;
+ }
+
+ return null;
+ }
+ catch (Exception e)
+ {
+ throw Utils.CreateBeWoFaultException(e);
+ }
+ }
}
}
\ No newline at end of file
diff --git a/Service/ServiceImplementations/OperationsServiceImp.cs b/Service/ServiceImplementations/OperationsServiceImp.cs
index a4649cd57..8d8e8bb3a 100644
--- a/Service/ServiceImplementations/OperationsServiceImp.cs
+++ b/Service/ServiceImplementations/OperationsServiceImp.cs
@@ -3164,8 +3164,9 @@ namespace BeWo.Service.ServiceImplementations
}
}
- public EmployeeAPPCodeDC CreateNewEmployeeAPPCodeDC(long employeeOid,string kundennummer,string apikey ,long personOid)
- {
+
+ public EmployeeAPPCodeDC CreateNewEmployeeAPPCodeDC(long employeeOid, string kundennummer, string apikey)
+ {
try
{
#if DEBUG
@@ -3255,7 +3256,8 @@ namespace BeWo.Service.ServiceImplementations
}
}
- public CustomerAPPCodeDC CreateNewCustomerAPPCodeDC(long customerOid,string kundennummer, string apikey, long personOid)
+
+ public CustomerAPPCodeDC CreateNewCustomerAPPCodeDC(long customerOid,string kundennummer, string apikey)
{
try
{
@@ -4550,8 +4552,6 @@ namespace BeWo.Service.ServiceImplementations
return lResult.OrderBy(s => s.Description).ToList();
}
-
-
public void CreateNewPerson2OrganisationRelation(long organi, ValueListEntryDC value, long personOid, string mail, string fax, string tele, string notice)
{
try
@@ -4580,6 +4580,7 @@ namespace BeWo.Service.ServiceImplementations
}
}
+
public PdfChatHandoutDC GetHandOutPdfForChat(string customerId,string apikey)
{
try
@@ -4777,16 +4778,13 @@ namespace BeWo.Service.ServiceImplementations
}
}
- public bool DeletCustomerChatCode(string apikey,string kundennummer,long customerOid)
+ public bool DeletCustomerChatCode(string apikey,string kundennummer,long customeroid)
{
try
{
- //CB###### NACH CLIENT UPDATE RAUS
- var cust = DAOFactory.SearchDAO.FindCustomerWithPersonOid(customerOid);
-
- DeletZufallsCode(apikey, kundennummer, "C" + cust.Oid.Value);
+ DeletZufallsCode(apikey, kundennummer, "C" + customeroid);
- var customerappcode = DAOFactory.SearchDAO.FindAllCustomerAppCodes(cust.Oid.Value);
+ var customerappcode = DAOFactory.SearchDAO.FindAllCustomerAppCodes(customeroid);
var anzahl = customerappcode.Count();
@@ -4814,17 +4812,14 @@ namespace BeWo.Service.ServiceImplementations
}
}
- public bool DeletEmloyeeChatCode(string apikey, string kundennummer, long employeeOid)
+ public bool DeletEmloyeeChatCode(string apikey, string kundennummer,long employeeoid)
{
try
{
- //CB###### NACH CLIENT UPDATE RAUS
- var emp = DAOFactory.SearchDAO.FindEmployeeWithPersonOid(employeeOid);
+ DeletZufallsCode(apikey, kundennummer, "E" + employeeoid);
+ var employeeappcode = DAOFactory.SearchDAO.FindAllEmployeeAppCodes(employeeoid);
- DeletZufallsCode(apikey, kundennummer, "E" + emp.Oid.Value);
-
- var employeeappcode = DAOFactory.SearchDAO.FindAllEmployeeAppCodes(emp.Oid.Value);
var anzahl = employeeappcode.Count();
diff --git a/Shared/BeWoEntityEnums.cs b/Shared/BeWoEntityEnums.cs
index d03941aa0..01d1fbd95 100644
--- a/Shared/BeWoEntityEnums.cs
+++ b/Shared/BeWoEntityEnums.cs
@@ -128,8 +128,9 @@ namespace BS.Shared
Vertretung = 121,
Employee2Token = 122,
QuittierungsCheck = 123,
- CustomerTeam = 124
- }
+ CustomerTeam = 124,
+ ChatBewoMessageSync = 125
+ }
public enum SystemEntryID
{
@@ -371,6 +372,8 @@ namespace BS.Shared
ServiceRecord_AllowCreatingGroupBooking = 10029,
ServiceRecord_AllowCreatingMultiBooking = 10030,
TeamView_ViewMyTeams = 10031,
+ Customer_ViewMyTeams = 10032,
+ SupportConcept_ViewMyTeams = 10033,
Employee_AllowEditExtendedProperties = 20000,
Employee_AllowEditContracts = 20001,
@@ -909,9 +912,11 @@ namespace BS.Shared
public enum PasswortSecurityStrength
{
+ SehrSchwach,
Schwach,
Mittelmass,
- Stark
+ Stark,
+ SehrStark
}
public enum ZeiterfassungsDauer
diff --git a/Shared/Core/EnumTranslations.cs b/Shared/Core/EnumTranslations.cs
index 305220579..0a9d5a3f2 100644
--- a/Shared/Core/EnumTranslations.cs
+++ b/Shared/Core/EnumTranslations.cs
@@ -97,7 +97,10 @@ namespace BS.Shared.Core
},
{
UserRightType.Customer_ViewMyCustomers, Translator.Translate("Klienten ansehen (Nur vom Mitarbeiter betreute)")
- },
+ },
+ {
+ UserRightType.Customer_ViewMyTeams, Translator.Translate("Klienten meines Teams ansehen")
+ },
{
UserRightType.DeleteAll, Translator.Translate("Alles löschen")
},
@@ -337,7 +340,10 @@ namespace BS.Shared.Core
},
{
UserRightType.SupportConcept_ViewAllSupportConcepts, Translator.Translate("Hilfepläne ansehen (alle)")
- },
+ },
+ {
+ UserRightType.SupportConcept_ViewMyTeams, Translator.Translate("Hilfepläne meines Teams ansehen")
+ },
{
UserRightType.SupportConcept_AllowGoalOrientedSupportConcepts, Translator.Translate("Hilfepläne zielorientiert planen")
},
diff --git a/Shared/DataContracts/ChatBewoMessageSyncDC.cs b/Shared/DataContracts/ChatBewoMessageSyncDC.cs
new file mode 100644
index 000000000..ec08fec62
--- /dev/null
+++ b/Shared/DataContracts/ChatBewoMessageSyncDC.cs
@@ -0,0 +1,20 @@
+using System;
+using System.Collections.Generic;
+using System.Runtime.Serialization;
+
+namespace BS.Shared.DataContracts
+{
+ [DataContract]
+ public class ChatBewoMessageSyncDC : IDataContract
+ {
+ [DataMember]
+ public long? ChatBewoMessageSyncOid { get; set; }
+
+ [DataMember]
+ public long? EmployeeOid { get; set; }
+
+ [DataMember]
+ public string MessageSyncText { get; set; }
+
+ }
+}
\ No newline at end of file
diff --git a/Shared/Shared.csproj b/Shared/Shared.csproj
index 3f7d021ed..14885db06 100644
--- a/Shared/Shared.csproj
+++ b/Shared/Shared.csproj
@@ -186,6 +186,7 @@
+