diff --git a/BeWoLauncher/App.config b/BeWoLauncher/App.config index c1900e1bf..6343a5ee7 100644 --- a/BeWoLauncher/App.config +++ b/BeWoLauncher/App.config @@ -20,6 +20,8 @@ + + diff --git a/BeWoLauncher/Components/MessageDialog.xaml.cs b/BeWoLauncher/Components/MessageDialog.xaml.cs index 8042d3013..7188a8ddb 100644 --- a/BeWoLauncher/Components/MessageDialog.xaml.cs +++ b/BeWoLauncher/Components/MessageDialog.xaml.cs @@ -1,5 +1,6 @@ using BeWoLauncher.ServiceProxy; using BS.SharedLauncher; +using BS.SharedLauncher.Enums; using BS.SharedLauncher.Information; using System; using System.Windows; diff --git a/BeWoLauncher/Components/PasswortAenderungsView.xaml.cs b/BeWoLauncher/Components/PasswortAenderungsView.xaml.cs index e1ac25092..395ace7ba 100644 --- a/BeWoLauncher/Components/PasswortAenderungsView.xaml.cs +++ b/BeWoLauncher/Components/PasswortAenderungsView.xaml.cs @@ -1,6 +1,7 @@ using BeWoLauncher.ServiceProxy; using BeWoLauncher.WindowImp; using BS.SharedLauncher; +using BS.SharedLauncher.Enums; using BS.SharedLauncher.Information; using System; using System.Collections.Generic; diff --git a/BeWoLauncher/LauncherApp.xaml.cs b/BeWoLauncher/LauncherApp.xaml.cs index 611d5f1cb..c709322f2 100644 --- a/BeWoLauncher/LauncherApp.xaml.cs +++ b/BeWoLauncher/LauncherApp.xaml.cs @@ -22,6 +22,7 @@ using System.Windows.Controls; using System.Windows.Input; using System.Windows.Markup; using System.Windows.Threading; +using System.Xml; namespace BeWoLauncher { @@ -74,6 +75,16 @@ namespace BeWoLauncher }; FrameworkElement.LanguageProperty.OverrideMetadata(typeof(FrameworkElement), new FrameworkPropertyMetadata(XmlLanguage.GetLanguage(CultureInfo.CurrentCulture.IetfLanguageTag))); + + + + //XmlDocument doc = new XmlDocument(); + //doc.Load(Path.Combine("d:/ServerBeWoDataExample", "version.config")); + + //var default2 = doc.SelectSingleNode("/config/default/version"); + //var defaultValue = default2.InnerXml; + //var specific2 = doc.SelectSingleNode("/config/tenant[@id='demo3']/version"); + //var specificVersion = specific2.InnerXml; } private void CheckForOtherInstance() diff --git a/BeWoLauncher/LauncherGeneratedNeuErstellen.lnk b/BeWoLauncher/LauncherGeneratedNeuErstellen.lnk new file mode 100644 index 000000000..47751bf9a Binary files /dev/null and b/BeWoLauncher/LauncherGeneratedNeuErstellen.lnk differ diff --git a/BeWoLauncher/PageImp/01 LoginPage.xaml.cs b/BeWoLauncher/PageImp/01 LoginPage.xaml.cs index 100c3a119..e34e47948 100644 --- a/BeWoLauncher/PageImp/01 LoginPage.xaml.cs +++ b/BeWoLauncher/PageImp/01 LoginPage.xaml.cs @@ -5,6 +5,7 @@ using BeWoLauncher.ServiceProxy; using BeWoLauncher.WindowImp; using BS.SharedLauncher; +using BS.SharedLauncher.Enums; using BS.SharedLauncher.Information; using System; diff --git a/BeWoLauncher/PageImp/02 UpdatePage.xaml.cs b/BeWoLauncher/PageImp/02 UpdatePage.xaml.cs index fffd2de77..3cbeb7421 100644 --- a/BeWoLauncher/PageImp/02 UpdatePage.xaml.cs +++ b/BeWoLauncher/PageImp/02 UpdatePage.xaml.cs @@ -89,18 +89,18 @@ namespace BeWoLauncher.PageImp SubMessage = ""; await showDelay(1000); - UpdateFileManager.DownloadUpdateSync(); + //UpdateFileManager.DownloadUpdateSync(); Message = "Update wird installiert..."; await showDelay(1000); - await UpdateFileManager.ApplyUpdate(); + //await UpdateFileManager.ApplyUpdate(); Message = "Update wurde installiert!"; SubMessage = "Starte BeWoPlaner..."; await showDelay(1000); - UpdateFileManager.UpdateData = null; + //UpdateFileManager.UpdateData = null; UpdateSuccessful(this, new EventArgs()); UpdatePathManager.GetDownloadDirInfo().ClearFolder(); diff --git a/BeWoLauncher/ServiceProxy/LauncherGenerated.cs b/BeWoLauncher/ServiceProxy/LauncherGenerated.cs index 6e0063cfa..07bcb7e73 100644 --- a/BeWoLauncher/ServiceProxy/LauncherGenerated.cs +++ b/BeWoLauncher/ServiceProxy/LauncherGenerated.cs @@ -168,7 +168,7 @@ namespace BeWoLauncher.ServiceProxy [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/ILauncherService/IsUserValid", ReplyAction="http://tempuri.org/ILauncherService/IsUserValidResponse")] [System.ServiceModel.FaultContractAttribute(typeof(BeWoLauncher.ServiceProxy.BeWoFault), Action="http://tempuri.org/ILauncherService/IsUserValidBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")] - BS.SharedLauncher.UserValidationResult IsUserValid(string pUserName, string pPassword, string pPIN, string clientId, bool checkTenant); + BS.SharedLauncher.Enums.UserValidationResult IsUserValid(string pUserName, string pPassword, string pPIN, string clientId, bool checkTenant); [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/ILauncherService/ResetTenant", ReplyAction="http://tempuri.org/ILauncherService/ResetTenantResponse")] [System.ServiceModel.FaultContractAttribute(typeof(BeWoLauncher.ServiceProxy.BeWoFault), Action="http://tempuri.org/ILauncherService/ResetTenantBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")] @@ -182,17 +182,13 @@ namespace BeWoLauncher.ServiceProxy [System.ServiceModel.FaultContractAttribute(typeof(BeWoLauncher.ServiceProxy.BeWoFault), Action="http://tempuri.org/ILauncherService/GetEmailForUserNameBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")] bool GetEmailForUserName(out string email, string pUserName, System.Uri serverName); - [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/ILauncherService/Update", ReplyAction="http://tempuri.org/ILauncherService/UpdateResponse")] - [System.ServiceModel.FaultContractAttribute(typeof(BeWoLauncher.ServiceProxy.BeWoFault), Action="http://tempuri.org/ILauncherService/UpdateBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")] - BS.SharedLauncher.DataContract.BeWoProgramPackageDC Update(BS.SharedLauncher.DataContract.BeWoProgramPackageDC t); - [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/ILauncherService/CheckPassword", ReplyAction="http://tempuri.org/ILauncherService/CheckPasswordResponse")] [System.ServiceModel.FaultContractAttribute(typeof(BeWoLauncher.ServiceProxy.BeWoFault), Action="http://tempuri.org/ILauncherService/CheckPasswordBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")] - BS.SharedLauncher.PasswordValidationResult CheckPassword(long userOid, string pOldPassword, string pNewPassword); + BS.SharedLauncher.Enums.PasswordValidationResult CheckPassword(long userOid, string pOldPassword, string pNewPassword); [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/ILauncherService/CheckPassword2", ReplyAction="http://tempuri.org/ILauncherService/CheckPassword2Response")] [System.ServiceModel.FaultContractAttribute(typeof(BeWoLauncher.ServiceProxy.BeWoFault), Action="http://tempuri.org/ILauncherService/CheckPassword2BeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")] - BS.SharedLauncher.PasswordValidationResult CheckPassword2(string username, string pOldPassword, string pNewPassword); + BS.SharedLauncher.Enums.PasswordValidationResult CheckPassword2(string username, string pOldPassword, string pNewPassword); [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/ILauncherService/ChangePassword", ReplyAction="http://tempuri.org/ILauncherService/ChangePasswordResponse")] [System.ServiceModel.FaultContractAttribute(typeof(BeWoLauncher.ServiceProxy.BeWoFault), Action="http://tempuri.org/ILauncherService/ChangePasswordBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")] @@ -237,7 +233,7 @@ namespace BeWoLauncher.ServiceProxy { } - public BS.SharedLauncher.UserValidationResult IsUserValid(string pUserName, string pPassword, string pPIN, string clientId, bool checkTenant) + public BS.SharedLauncher.Enums.UserValidationResult IsUserValid(string pUserName, string pPassword, string pPIN, string clientId, bool checkTenant) { return base.Channel.IsUserValid(pUserName, pPassword, pPIN, clientId, checkTenant); } @@ -257,17 +253,12 @@ namespace BeWoLauncher.ServiceProxy return base.Channel.GetEmailForUserName(out email, pUserName, serverName); } - public BS.SharedLauncher.DataContract.BeWoProgramPackageDC Update(BS.SharedLauncher.DataContract.BeWoProgramPackageDC t) - { - return base.Channel.Update(t); - } - - public BS.SharedLauncher.PasswordValidationResult CheckPassword(long userOid, string pOldPassword, string pNewPassword) + public BS.SharedLauncher.Enums.PasswordValidationResult CheckPassword(long userOid, string pOldPassword, string pNewPassword) { return base.Channel.CheckPassword(userOid, pOldPassword, pNewPassword); } - public BS.SharedLauncher.PasswordValidationResult CheckPassword2(string username, string pOldPassword, string pNewPassword) + public BS.SharedLauncher.Enums.PasswordValidationResult CheckPassword2(string username, string pOldPassword, string pNewPassword) { return base.Channel.CheckPassword2(username, pOldPassword, pNewPassword); } @@ -338,9 +329,9 @@ namespace BeWoLauncher.ServiceProxy public interface IDownloadBeWoService { - [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IDownloadBeWoService/Download", ReplyAction="http://tempuri.org/IDownloadBeWoService/DownloadResponse")] - [System.ServiceModel.FaultContractAttribute(typeof(BeWoLauncher.ServiceProxy.BeWoFault), Action="http://tempuri.org/IDownloadBeWoService/DownloadBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")] - BS.SharedLauncher.DataContract.BeWoProgramPackageDC Download(BS.SharedLauncher.DataContract.BeWoProgramFilterDC filter); + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IDownloadBeWoService/Download2", ReplyAction="http://tempuri.org/IDownloadBeWoService/Download2Response")] + [System.ServiceModel.FaultContractAttribute(typeof(BeWoLauncher.ServiceProxy.BeWoFault), Action="http://tempuri.org/IDownloadBeWoService/Download2BeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")] + BS.SharedLauncher.DataContract.DownloadPlanerResponseDC Download2(BS.SharedLauncher.DataContract.DownloadPlanerRequestDC request); } [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] @@ -377,9 +368,9 @@ namespace BeWoLauncher.ServiceProxy { } - public BS.SharedLauncher.DataContract.BeWoProgramPackageDC Download(BS.SharedLauncher.DataContract.BeWoProgramFilterDC filter) + public BS.SharedLauncher.DataContract.DownloadPlanerResponseDC Download2(BS.SharedLauncher.DataContract.DownloadPlanerRequestDC request) { - return base.Channel.Download(filter); + return base.Channel.Download2(request); } } } diff --git a/BeWoLauncher/UpdateFileManager.cs b/BeWoLauncher/UpdateFileManager.cs index 6bd2cc63d..5bf00745f 100644 --- a/BeWoLauncher/UpdateFileManager.cs +++ b/BeWoLauncher/UpdateFileManager.cs @@ -15,7 +15,7 @@ namespace BeWoLauncher public class FileEventArgs : EventArgs { public object File { get; set; } - public FileToDo ToDo { get; set; } + //public FileToDo ToDo { get; set; } } public static class UpdateFileManager @@ -23,49 +23,49 @@ namespace BeWoLauncher public static event EventHandler DownloadFileEventHandler; public static event EventHandler ApplyFileEventHandler; - public static BeWoProgramPackageDC UpdateData { get; set; } + //public static BeWoProgramPackageDC UpdateData { get; set; } static UpdateFileManager() { } - public static BeWoProgramPackageDC GetLastUpdate() - { - var last = new BeWoProgramPackageDC(); + //public static BeWoProgramPackageDC GetLastUpdate() + //{ + // var last = new BeWoProgramPackageDC(); - last.Files = UpdatePathManager.GetApplyDirInfo().GetFiles().Select(file => new BeWoProgramFileDC(file)).ToList(); + // last.Files = UpdatePathManager.GetApplyDirInfo().GetFiles().Select(file => new BeWoProgramFileDC(file)).ToList(); - return last; - } + // return last; + //} - public static void DownloadUpdateSync() - { - var last = GetLastUpdate(); + //public static void DownloadUpdateSync() + //{ + // var last = GetLastUpdate(); - UpdateData = LauncherServiceFacade.DoLauncherServiceSync(x => x.Update(last)); + // UpdateData = LauncherServiceFacade.DoLauncherServiceSync(x => x.Update(last)); - foreach (var file in UpdateData.Files) - { - switch (file.ToDo) - { - case FileToDo.Update: - case FileToDo.Add: - using (var fs = new FileStream(Path.Combine(UpdatePathManager.GetDownloadPath(), file.FileName), FileMode.Create, FileAccess.Write)) - { - fs.Write(file.FileData, 0, file.FileData.Length); - } - file.FileData = null; - break; - case FileToDo.Remove: - break; - case FileToDo.Nuthing: - break; - } + // foreach (var file in UpdateData.Files) + // { + // switch (file.ToDo) + // { + // //case FileToDo.Update: + // //case FileToDo.Add: + // // using (var fs = new FileStream(Path.Combine(UpdatePathManager.GetDownloadPath(), file.FileName), FileMode.Create, FileAccess.Write)) + // // { + // // fs.Write(file.FileData, 0, file.FileData.Length); + // // } + // // file.FileData = null; + // // break; + // //case FileToDo.Remove: + // // break; + // //case FileToDo.Nuthing: + // // break; + // } - DownloadFileEventHandler(null, new FileEventArgs { ToDo = file.ToDo, File = file }); - } - } + // DownloadFileEventHandler(null, new FileEventArgs { ToDo = file.ToDo, File = file }); + // } + //} public static async Task DownloadUpdateAsync() { @@ -96,31 +96,31 @@ namespace BeWoLauncher //} } - public static async Task ApplyUpdate() - { - foreach (var file in UpdateData.Files) - { - switch (file.ToDo) - { - case FileToDo.Update: - case FileToDo.Add: - var source = Path.Combine(UpdatePathManager.GetDownloadPath(), file.FileName); - var dest = Path.Combine(UpdatePathManager.GetApplyPath(), file.FileName); - File.Delete(dest); - File.Copy(source, dest); - break; - case FileToDo.Remove: - File.Delete(Path.Combine(UpdatePathManager.GetApplyPath(), file.FileName)); - break; - case FileToDo.Nuthing: - break; - } + //public static async Task ApplyUpdate() + //{ + // foreach (var file in UpdateData.Files) + // { + // switch (file.ToDo) + // { + // case FileToDo.Update: + // case FileToDo.Add: + // var source = Path.Combine(UpdatePathManager.GetDownloadPath(), file.FileName); + // var dest = Path.Combine(UpdatePathManager.GetApplyPath(), file.FileName); + // File.Delete(dest); + // File.Copy(source, dest); + // break; + // case FileToDo.Remove: + // File.Delete(Path.Combine(UpdatePathManager.GetApplyPath(), file.FileName)); + // break; + // case FileToDo.Nuthing: + // break; + // } - await showDelay(50); + // await showDelay(50); - ApplyFileEventHandler(null, new FileEventArgs { ToDo = file.ToDo, File = file }); - } - } + // ApplyFileEventHandler(null, new FileEventArgs { ToDo = file.ToDo, File = file }); + // } + //} private static async Task showDelay(int millisec) { diff --git a/BeWoLauncher/WindowImp/LauncherWindow.xaml.cs b/BeWoLauncher/WindowImp/LauncherWindow.xaml.cs index 58f539c84..1757c71cc 100644 --- a/BeWoLauncher/WindowImp/LauncherWindow.xaml.cs +++ b/BeWoLauncher/WindowImp/LauncherWindow.xaml.cs @@ -12,6 +12,7 @@ using System.Windows.Media; using System.Windows.Threading; using BeWoLauncher.Components; using BeWoLauncher.PageImp; +using BeWoLauncher.ServiceProxy; using BS.SharedLauncher; using BS.SharedLauncher.Information; @@ -33,6 +34,8 @@ namespace BeWoLauncher.WindowImp LauncherApp.Window = this; ShowLoginPage(); + + LauncherServiceFacade.DoDownloadBeWoServiceSync(x => x.Download2(new BS.SharedLauncher.DataContract.DownloadPlanerRequestDC() { })); } public void FinishLogin(object sender, EventArgs e) diff --git a/Service/Security/SecurityContextInitializer.cs b/Service/Security/SecurityContextInitializer.cs index cb1558c77..ffe4c5501 100644 --- a/Service/Security/SecurityContextInitializer.cs +++ b/Service/Security/SecurityContextInitializer.cs @@ -37,10 +37,19 @@ namespace BeWo.Service.Security string lServiceInterface = lTemp[lTemp.Count - 2]; // TODO Hier kann man jetzt etwas bauen wer sich für welchen service autorisieren muss... + var skip = new string[] { "Download", "Download2" }; if (lMethodName == "IsUserValid" || lMethodName == "IsUserValidTwoFactor" || lMethodName == "ResetTenant" || lMethodName == "ResetAllTenants" || lMethodName == "GetEmailForUserName") { return null; } + if (skip.Contains(lMethodName)) + { + return null; + } + else + { + // Vergessen neue Methode einzutragen? + } string lUserName = null, lPassword = null; diff --git a/Service/Service.csproj b/Service/Service.csproj index 1dc0cb623..31bdfd8d1 100644 --- a/Service/Service.csproj +++ b/Service/Service.csproj @@ -476,6 +476,8 @@ + + @@ -522,19 +524,7 @@ - - - - - - - This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - - - -