Files
BeWoPlaner/BeWo/Loader.cs
rene bae1380d45 Hauptfeatures laufen, Sicherheit eingebaut, Dynamische Programm Location
(Christian Gespräch 02.03.2022, OneNote Notizen 1)
2022-03-02 14:45:33 +01:00

41 lines
1.3 KiB
C#

using BeWo.ServiceProxy;
using BS.SharedLauncher.Information;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BeWo
{
public static class Loader
{
public static bool Loaded { get; set; }
static Loader()
{
Loaded = false;
}
public static void Load(string username, string password, string servername, string tenant, string coreserveraddress)
{
BeWoApp.UserName = username;
BeWoApp.UserPassword = password;
BeWoApp.ServerName = servername;
BeWoApp.Tenant = tenant;
BeWoApp.ServerAddress = coreserveraddress;
BeWoApp.LoggedOnUser = ServiceFacade.DoUserServiceSync(s => s.LoadUserByNameAndPassword(BeWoApp.UserName, BeWoApp.UserPassword));
BeWoApp.Mandator = ServiceFacade.DoOperationsServiceSync(s => s.GetMandator());
Loaded = true;
}
public static void Load(Connection connection)
=> Load(connection.Username, connection.Password, connection.Servername, connection.Tenant, connection.CoreServerAddress);
public static void Load(string rawInput)
=> Load(Connection.Parse(rawInput));
}
}