41 lines
1.3 KiB
C#
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));
|
|
}
|
|
}
|