private void toolStripUserAdministration_Click(object sender, EventArgs e) { UserAdministration ua = new UserAdministration(); ua.ShowDialog(); }
private void buttonLoadScenario_Click(object sender, EventArgs e) { if (serverState == "SCENARIO_STOPPED" || serverState == "REPLAY_STOPPED") { //TODO: Get Current User/Passwords int userAccountCount = UserAdministration.GetUserCount(); //if not, display message and return if (userAccountCount < 1) { MessageBox.Show("You need to have at least 1 user account created to run a simulation. Go to Users > User Administration to enter user accounts."); return; } try { server.SimControlLoadScenario(textBoxScenario.Text, textBoxGroupName.Text, eventLogTextBox.Text); } catch (Exception ex) { server.ResetServer(); MessageBox.Show(ex.Message); return; } if (ServerOptions.EnableVoiceServer) { string errString = "Missing Voice Server Credentials:"; if (ServerOptions.VoiceServerAdminUsername == string.Empty) { errString += "\r\n\tAdmin Username"; } if (ServerOptions.VoiceServerHostname == string.Empty) { errString += "\r\n\tServer Hostname"; } if (ServerOptions.VoiceServerPort < 0) { errString += "\r\n\tServer Port Number"; } if (errString != "Missing Voice Server Credentials:") { errString += "\r\nPlease close the server and locate your Server Options file and modify these values"; MessageBox.Show(errString, "Error Validating Voice Server Settings"); return; } } } else { if (DialogResult.No == (MessageBox.Show("A simulation is currently running, are you sure that you want to stop?", "Warning", MessageBoxButtons.YesNo))) { return; } server.SimControlStopScenario(true); } }