From f9596501006414982e7168db0b3bae1ba6215732 Mon Sep 17 00:00:00 2001 From: Christian Date: Wed, 11 Oct 2017 14:44:51 +0200 Subject: [PATCH 1/9] gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index d9805409f..f0d36d9a4 100644 --- a/.gitignore +++ b/.gitignore @@ -256,3 +256,4 @@ /ReportImp/Taubblindendienst/obj/Debug /BeWoPlanerMobil/logs /Host/logs +/.vs/BeWoGit/v15 From dd98a74bb890e4c39fe6fab1283792eea5312ba9 Mon Sep 17 00:00:00 2001 From: Waldi Date: Wed, 11 Oct 2017 14:45:11 +0200 Subject: [PATCH 2/9] =?UTF-8?q?PDF=20Handout=20Chat=20ged=C3=B6nse?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- BeWo/BeWo.csproj | 2 +- .../NewSchulbegleitenderDienstView.xaml.cs | 32 ++++- BeWo/ServiceProxy/Generated.cs | 9 ++ BeWo/View/ChatServiceEmployee.xaml | 8 +- BeWo/View/ChatServiceEmployee.xaml.cs | 109 ++++++++++-------- .../ServiceContracts/IOperationsService.cs | 4 + .../OperationsServiceImp.cs | 50 ++++++++ Shared/DataContracts/CustomerAPPCodeDC.cs | 4 + Shared/DataContracts/EmployeeAPPCodeDC.cs | 5 +- Shared/Shared.csproj | 1 + 10 files changed, 167 insertions(+), 57 deletions(-) diff --git a/BeWo/BeWo.csproj b/BeWo/BeWo.csproj index 2f3ca6f41..e4818c8dc 100644 --- a/BeWo/BeWo.csproj +++ b/BeWo/BeWo.csproj @@ -1975,7 +1975,7 @@ - + {8a83c4dc-a0b1-4a51-ae1d-366d7a05b298} ChatController diff --git a/BeWo/SchulbegleitenderDienst/NewSchulbegleitenderDienstView.xaml.cs b/BeWo/SchulbegleitenderDienst/NewSchulbegleitenderDienstView.xaml.cs index c7f9f7879..bd8de940f 100644 --- a/BeWo/SchulbegleitenderDienst/NewSchulbegleitenderDienstView.xaml.cs +++ b/BeWo/SchulbegleitenderDienst/NewSchulbegleitenderDienstView.xaml.cs @@ -244,13 +244,41 @@ namespace BeWo.SchulbegleitenderDienst // hier den Tag merken um auch für WOCHEN bereich die spalte orange zu machen } - + if (item.isCustomerKrank) { xyc.IsCustomerKrank = true; xyc.IsKunde = 2; } - + + //hier bereich zu abfrage Vertretung Gewünscht / nicht gewünscht + //################## Besser auf Server auslagern ?? ############################################# + List custOid = new List(); + custOid.Add(customer.Key); + var cus = ServiceFacade.DoCustomerServiceSync(r => r.GetCustomersById(custOid)); + + foreach (var c in cus) + { + // 1 für Grün | 0 für Rot + if (c.VertretungDringendErforderlich == false && c.VertretungGewuenscht == false) + { + //anzeige Grün machen + xyc.IsKunde = 1; + } + //else if (c.VertretungDringendErforderlich == false && c.VertretungGewuenscht == true) + //{ + // // anzeige noral halten + // xyc.IsKunde = 2; + //} + //else if (c.VertretungDringendErforderlich == true && c.VertretungGewuenscht == true) + //{ + // //anzeige normal halten + // xyc.IsKunde = 2; + //} + } + + //############################ + _items.Add(xyc); } diff --git a/BeWo/ServiceProxy/Generated.cs b/BeWo/ServiceProxy/Generated.cs index f41f54e9f..e6d760a76 100644 --- a/BeWo/ServiceProxy/Generated.cs +++ b/BeWo/ServiceProxy/Generated.cs @@ -4411,6 +4411,10 @@ 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/DeactivateInvoices", ReplyAction="http://tempuri.org/IOperationsService/DeactivateInvoicesResponse")] [System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IOperationsService/DeactivateInvoicesBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")] void DeactivateInvoices(System.Collections.Generic.List invoices); @@ -5226,6 +5230,11 @@ namespace BeWo.ServiceProxy return base.Channel.GetLastVertreter(klientenOid); } + public BS.Shared.DataContracts.PdfChatHandoutDC GetHandOutPdfForChat(string customerId, string apikey) + { + return base.Channel.GetHandOutPdfForChat(customerId, apikey); + } + public void DeactivateInvoices(System.Collections.Generic.List invoices) { base.Channel.DeactivateInvoices(invoices); diff --git a/BeWo/View/ChatServiceEmployee.xaml b/BeWo/View/ChatServiceEmployee.xaml index c52fbe4c9..241549300 100644 --- a/BeWo/View/ChatServiceEmployee.xaml +++ b/BeWo/View/ChatServiceEmployee.xaml @@ -34,6 +34,7 @@ + diff --git a/BeWo/View/ChatServiceCustomer.xaml.cs b/BeWo/View/ChatServiceCustomer.xaml.cs index b5a646a60..e23870132 100644 --- a/BeWo/View/ChatServiceCustomer.xaml.cs +++ b/BeWo/View/ChatServiceCustomer.xaml.cs @@ -272,7 +272,21 @@ namespace BeWo.View private void SpeicherButton_OnClick(object sender, RoutedEventArgs e) { - ServiceFacade.DoCustomerServiceSync(s => s.SetBenutzerPasswortChatAppCode(customerOid.Value, TXTBenutzerName.Text, TXTPasswort.Text)); + if (BeWoApp.AppSettings.IsPasswordSecurityActiv) + { + if (TXTPasswort.Text.Length >= 8) + { + ServiceFacade.DoCustomerServiceSync(s => s.SetBenutzerPasswortChatAppCode(customerOid.Value, TXTBenutzerName.Text, TXTPasswort.Text)); + } + else + { + MessageBox.Show("Das Passwort ist zu schwach."); + } + } + else + { + ServiceFacade.DoCustomerServiceSync(s => s.SetBenutzerPasswortChatAppCode(customerOid.Value, TXTBenutzerName.Text, TXTPasswort.Text)); + } } private void RemoveCode_OnClick(object sender, RoutedEventArgs e) diff --git a/BeWo/View/ChatServiceEmployee.xaml b/BeWo/View/ChatServiceEmployee.xaml index df82d57aa..c2a2a476b 100644 --- a/BeWo/View/ChatServiceEmployee.xaml +++ b/BeWo/View/ChatServiceEmployee.xaml @@ -41,7 +41,9 @@ - - diff --git a/BeWo/View/HomeDragPanelView.xaml.cs b/BeWo/View/HomeDragPanelView.xaml.cs index c5dc8e3ba..2fe52ed2a 100644 --- a/BeWo/View/HomeDragPanelView.xaml.cs +++ b/BeWo/View/HomeDragPanelView.xaml.cs @@ -108,26 +108,27 @@ namespace BeWo.View MessageBox.Show("Verbindung geglückt.", "Info", MessageBoxButton.OK,MessageBoxImage.Information); });*/ - - //var berechtigung = ServiceFacade.DoEmployeeServiceSync(s => s.GetAllChatActiveEmployeesCompact()); - //foreach (var list in berechtigung) - //{ - // if (list.PersonOid == BeWoApp.LoggedOnUser.Employee.PersonOid) - // { - // berechtigt = true; - // } - //} + + var berechtigung = ServiceFacade.DoEmployeeServiceSync(s => s.GetAllChatActiveEmployeesCompact()); + foreach (var list in berechtigung) + { + if (list.PersonOid == BeWoApp.LoggedOnUser.Employee.PersonOid) + { + berechtigt = true; + } + } if (berechtigt) - { + { //asx = new Thread(ConnectWithServer); //asx.Start(); + BewoChat.Visibility = Visibility.Visible;//Hidden } else { - // BewoChat.Visibility = Visibility.Visible;//Hidden + BewoChat.Visibility = Visibility.Hidden;//Hidden } PruefePasswortStaerke(); diff --git a/BeWoPlanerMobil/Controllers/ChatController.cs b/BeWoPlanerMobil/Controllers/ChatController.cs index 7b764e275..6b48c89d1 100644 --- a/BeWoPlanerMobil/Controllers/ChatController.cs +++ b/BeWoPlanerMobil/Controllers/ChatController.cs @@ -161,7 +161,7 @@ namespace BeWoPlanerMobil.Controllers } JsonInputKlient1 input = new JsonInputKlient1(daten.Oid.ToString(),"1", - daten.Person.FirstName, daten.Person.LastName, daten.CustomerAlias, mobilnummer, chatcode.CustomerCode, inputList); + daten.Person.FirstName, daten.Person.LastName, daten.CustomerAlias, mobilnummer, chatcode.CustomerCode,chatcode.BenutzerName,chatcode.BCryptPassword, inputList); if (daten.IsActive == ActivationTypeId.Deleted) @@ -422,10 +422,12 @@ namespace BeWoPlanerMobil.Controllers public string Alias { get; set; } public string Mobile { get; set; } public string ChatCode { get; set; } + public string Login { get; set; } + public string Password { get; set; } public List Guardians { get; set; } - public JsonInputKlient1(string oid,string status, string firstname, string lastname, string alias,string mobile,string chatCode, List guardians) + public JsonInputKlient1(string oid,string status, string firstname, string lastname, string alias,string mobile,string chatCode,string login,string password, List guardians) { Oid = "C"+oid; Status = status; @@ -434,6 +436,8 @@ namespace BeWoPlanerMobil.Controllers Alias = alias; Mobile = mobile; ChatCode = chatCode; + Login = login; + Password = password; Guardians = guardians; } } diff --git a/Data/Entities/CustomerAPPCode.cs b/Data/Entities/CustomerAPPCode.cs index 8c2af6a1c..d4dc065a5 100644 --- a/Data/Entities/CustomerAPPCode.cs +++ b/Data/Entities/CustomerAPPCode.cs @@ -18,6 +18,8 @@ namespace BeWo.Data.Entities public static string PropertyName_Passwort = "Passwort"; + public static string PropertyName_BCryptPassword = "BCryptPassword"; + private string _CustomerCode; private DateTime _CustomerCodeGenDate; @@ -30,6 +32,8 @@ namespace BeWo.Data.Entities private string _Passwort; + private string _BCryptPassword; + public virtual string CustomerCode { get @@ -126,5 +130,18 @@ namespace BeWo.Data.Entities } } + public virtual string BCryptPassword + { + get { return _BCryptPassword; } + + set + { + if (AreDifferent(_BCryptPassword, value)) + { + _BCryptPassword = value; + } + } + } + } } \ No newline at end of file diff --git a/Data/Mappings/CustomerAPPCode.hbm.xml b/Data/Mappings/CustomerAPPCode.hbm.xml index 2577b5f20..423715a33 100644 --- a/Data/Mappings/CustomerAPPCode.hbm.xml +++ b/Data/Mappings/CustomerAPPCode.hbm.xml @@ -19,5 +19,6 @@ + \ No newline at end of file diff --git a/Model/Changes_2017_10_13.txt b/Model/Changes_2017_10_13.txt new file mode 100644 index 000000000..b29ea2d1b --- /dev/null +++ b/Model/Changes_2017_10_13.txt @@ -0,0 +1,3 @@ + +ALTER TABLE `CustomerAppCode` +ADD COLUMN `PasswordHash` VARCHAR(1024) NULL DEFAULT NULL COMMENT ''; \ No newline at end of file diff --git a/Service/ServiceImplementations/CustomerServiceImp.cs b/Service/ServiceImplementations/CustomerServiceImp.cs index 86c524d54..6fca40dc6 100644 --- a/Service/ServiceImplementations/CustomerServiceImp.cs +++ b/Service/ServiceImplementations/CustomerServiceImp.cs @@ -5,6 +5,7 @@ using System.ServiceModel; using BeWo.Data.Access; using BeWo.Data.Entities; +using BeWo.Data.Security; using BeWo.Service.Core; using BeWo.Service.DCEntityMapper; using BeWo.Service.Plugins; @@ -3700,6 +3701,9 @@ namespace BeWo.Service.ServiceImplementations if (!passwort.Equals("") && appcode.Passwort != null && !appcode.Passwort.Equals(passwort)) { appcode.Passwort = passwort; + + string salt = BCrypt.GenerateSalt(); + appcode.BCryptPassword = BCrypt.HashPassword(passwort, salt); } }