/// <summary> /// Starts the scenario /// </summary> public void Start() { if (m_Settings.UseCertificateProxy) { var remoteHost = "net.tcp://" + m_Settings.General.RemoteHostName + "/Fujitsu.Utilities.UserManagement.Service.UserManagementWithCertificateSecurity"; using (var proxy = new UserManagementProxyWithCertificateSecurity(remoteHost)) { proxy.Initialize(new NetworkIdentifier("SC1", "000C29F0C32B", "StoreCenter")); m_Controller.ShowResult(new MessageView { //Pretty = Utilities.RenderHTMLMessage( // "User Management Session Initialized\r\n\r\n" + // "Start User Management to monitor User Management Messages") } ); } } else { var remoteHost = "net.tcp://" + m_Settings.General.RemoteHostName + "/Fujitsu.Utilities.UserManagement.Service.UserManagement"; using (var proxy = new UserManagementProxy(remoteHost)) { proxy.Initialize(new NetworkIdentifier("SC1", "000C29F0C32B", "StoreCenter")); m_Controller.ShowResult(new MessageView { //Pretty = Utilities.RenderHTMLMessage( // "User Management Session Initialized\r\n\r\n" + // "Start User Management to monitor User Management Messages") } ); } } }
/// <summary> /// Add worker /// </summary> public void Start() { UserManagementUpdateOperationResult result; if (m_Settings.UseCertificateProxy) { var remoteHost = "net.tcp://" + m_Settings.General.RemoteHostName + "/Fujitsu.Utilities.UserManagement.Service.UserManagementWithCertificateSecurity"; using (var proxy = new UserManagementProxyWithCertificateSecurity(remoteHost)) { result = proxy.ExecuteUpdateOperation( new PasswordResetOperation { WorkerId = m_Settings.TestWorkerID }); } } else { var remoteHost = "net.tcp://" + m_Settings.General.RemoteHostName + "/Fujitsu.Utilities.UserManagement.Service.UserManagement"; using (var proxy = new UserManagementProxy(remoteHost)) { result = proxy.ExecuteUpdateOperation( new PasswordResetOperation { WorkerId = m_Settings.TestWorkerID }); } } var xml = new MessageViewFormatter <UserManagementUpdateOperationResult>(result).FormatMessage(); m_Controller.ShowResult(xml); }
/// <summary> /// Add worker /// </summary> public void Start() { UserManagementUpdateOperationResult result; var password = new SecureString(); password.AppendChar('a'); password.AppendChar('0'); password.AppendChar('0'); password.AppendChar('0'); password.AppendChar('0'); password.AppendChar('0'); password.AppendChar('0'); var helper = RootContainer.container.Resolve <IPasswordHandler>(); var enc = helper.EncryptPassword(password).ToString(); if (m_Settings.UseCertificateProxy) { var remoteHost = "net.tcp://" + m_Settings.General.RemoteHostName + "/Fujitsu.Utilities.UserManagement.Service.UserManagementWithCertificateSecurity"; using (var proxy = new UserManagementProxyWithCertificateSecurity(remoteHost)) { result = proxy.ExecuteUpdateOperation( new PasswordCreateOperation { NewPasswordEncrypted = enc, WorkerID = m_Settings.TestWorkerID }); } } else { var remoteHost = "net.tcp://" + m_Settings.General.RemoteHostName + "/Fujitsu.Utilities.UserManagement.Service.UserManagement"; using (var proxy = new UserManagementProxy(remoteHost)) { result = proxy.ExecuteUpdateOperation( new PasswordChangeOperation { NewPasswordEncrypted = enc }); } } var xml = new MessageViewFormatter <UserManagementUpdateOperationResult>(result).FormatMessage(); m_Controller.ShowResult(xml); }
/// <summary> /// Add worker /// </summary> public void Start() { UserManagementUpdateOperationResult result; if (m_Settings.UseCertificateProxy) { var remoteHost = "net.tcp://" + m_Settings.General.RemoteHostName + "/Fujitsu.Utilities.UserManagement.Service.UserManagementWithCertificateSecurity"; using (var proxy = new UserManagementProxyWithCertificateSecurity(remoteHost)) { result = proxy.ExecuteUpdateOperation( new CreateWorkerOperation { Worker = new Worker { DefaultLanguageID = 9, HireDate = DateTimeOffset.Now, Person = new Person { FirstName = "John", GenderType = 1, LanguageID = 9, LastName = "Smith", PartyID = Guid.NewGuid(), Salutation = "Mr" }, TerminationDate = null, WorkerID = m_Settings.TestWorkerID, WorkerOperators = new[] { new WorkerOperator { ConfigPoint = m_Settings.StoreID, DisplayName = "Johnny Smith", OperatorGroupIDs = new[] { -2 }, OperatorID = m_Settings.OperatorID, WorkerID = m_Settings.TestWorkerID } } } }); } } else { var remoteHost = "net.tcp://" + m_Settings.General.RemoteHostName + "/Fujitsu.Utilities.UserManagement.Service.UserManagement"; using (var proxy = new UserManagementProxy(remoteHost)) { result = proxy.ExecuteUpdateOperation( new CreateWorkerOperation { Worker = new Worker { DefaultLanguageID = 9, HireDate = DateTimeOffset.Now, Person = new Person { FirstName = "John", GenderType = 1, LanguageID = 9, LastName = "Smith", PartyID = Guid.NewGuid(), Salutation = "Mr" }, TerminationDate = null, WorkerID = m_Settings.TestWorkerID, WorkerOperators = new[] { new WorkerOperator { ConfigPoint = m_Settings.StoreID, DisplayName = "Johnny Smith", OperatorGroupIDs = new[] { 1 }, OperatorID = m_Settings.OperatorID, WorkerID = m_Settings.TestWorkerID } }, WorkerOperatorSellLocations = new[] { new WorkerOperatorSellLocation { DefaultTenderContainerID = "101", SellingLocationID = 1 } } } }); } } var xml = new MessageViewFormatter <UserManagementUpdateOperationResult>(result).FormatMessage(); m_Controller.ShowResult(xml); }