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 @@