/// <summary> /// Called when [create new company]. /// </summary> /// <param name="status">The status.</param> private void OnCreateNewCompany(SyncStatus status) { // Check Sql Settings ISqlServerSettings sqlSettings = this.Configurator.SqlSettings; if (string.IsNullOrEmpty(sqlSettings.Server)) { // TODO: Show Warning EditSqlServerSettingsForm editSqlSettinnsForm = new EditSqlServerSettingsForm(this.Configurator); if (this.SnapIn.Console.ShowDialog(editSqlSettinnsForm) == DialogResult.OK) { this.Configurator.ChangeSqlServerSettings( editSqlSettinnsForm.SqlServerName, editSqlSettinnsForm.UseWindowsAuth ? AuthenticationType.Windows : AuthenticationType.SqlServer, editSqlSettinnsForm.SqlServerUser, editSqlSettinnsForm.SqlServerPassword, editSqlSettinnsForm.IbnUserName, editSqlSettinnsForm.IbnUserPassword); } else { return; } } CreateCompanyForm createCompanyForm = new CreateCompanyForm(this.Configurator); if (this.SnapIn.Console.ShowDialog(createCompanyForm) == DialogResult.OK) { status.ReportProgress(0, 0, string.Format(SnapInResources.CompanyScopeNode_Action_Create_Progress, createCompanyForm.textBoxHost.Text)); string newCompanyId = string.Empty; //Thread.Sleep(10000); newCompanyId = this.Configurator.CreateCompany(createCompanyForm.textBoxCompanyName.Text, createCompanyForm.textBoxHost.Text, ((ILanguageInfo)createCompanyForm.comboBoxDefaultLanguage.SelectedItem).Locale, createCompanyForm.checkBoxIsActive.Checked, createCompanyForm.IisIPAddress, int.Parse(createCompanyForm.textBoxIisPort.Text), createCompanyForm.IisPool, createCompanyForm.textBoxAdminAccountName.Text, createCompanyForm.textBoxAdminPassword.Text, createCompanyForm.textBoxAdminFirstName.Text, createCompanyForm.textBoxAdminLastName.Text, createCompanyForm.textBoxAdminEmail.Text); // Refresh Company List Refresh(); // TODO: Navigate browser to form.NewCompanyId Url } }
/// <summary> /// Shows the edit SQL server settings form. /// </summary> public void ShowEditSqlServerSettingsForm() { EditSqlServerSettingsForm form = new EditSqlServerSettingsForm(GetConfigurator()); if (this.ParentFormView.SnapIn.Console.ShowDialog(form) == DialogResult.OK) { GetConfigurator().ChangeSqlServerSettings( form.SqlServerName, form.UseWindowsAuth ? AuthenticationType.Windows : AuthenticationType.SqlServer, form.SqlServerUser, form.SqlServerPassword, form.IbnUserName, form.IbnUserPassword); InitSqlServerSettingsBlock(); } }
internal static void CreateAspSite(IConfigurator configurator, Microsoft.ManagementConsole.Advanced.Console console, SyncStatus status) { // Check Sql Settings ISqlServerSettings sqlSettings = configurator.SqlSettings; bool sqlSettingsOK = !string.IsNullOrEmpty(sqlSettings.Server); if (!sqlSettingsOK) { // TODO: Show Warning EditSqlServerSettingsForm editSqlSettinnsForm = new EditSqlServerSettingsForm(configurator); if (console.ShowDialog(editSqlSettinnsForm) == DialogResult.OK) { configurator.ChangeSqlServerSettings( editSqlSettinnsForm.SqlServerName, editSqlSettinnsForm.UseWindowsAuth ? AuthenticationType.Windows : AuthenticationType.SqlServer, editSqlSettinnsForm.SqlServerUser, editSqlSettinnsForm.SqlServerPassword, editSqlSettinnsForm.IbnUserName, editSqlSettinnsForm.IbnUserPassword); sqlSettingsOK = true; } } if (sqlSettingsOK) { CreateAspForm createAspForm = new CreateAspForm(configurator); if (console.ShowDialog(createAspForm) == DialogResult.OK) { if (status != null) { status.ReportProgress(0, 0, SnapInResources.ServerFormView_Action_AspCreate_Progress); } configurator.CreateAspSite(createAspForm.textBoxHost.Text , createAspForm.IisIPAddress , int.Parse(createAspForm.textBoxIisPort.Text) , createAspForm.IisPool ); } } }
/// <summary> /// Called when [create new company for database]. /// </summary> /// <param name="status">The status.</param> private void OnCreateNewCompanyForDatabase(SyncStatus status) { // Check Sql Settings ISqlServerSettings sqlSettings = this.Configurator.SqlSettings; if (string.IsNullOrEmpty(sqlSettings.Server)) { // TODO: Show Warning EditSqlServerSettingsForm editSqlSettinnsForm = new EditSqlServerSettingsForm(this.Configurator); if (this.SnapIn.Console.ShowDialog(editSqlSettinnsForm) == DialogResult.OK) { this.Configurator.ChangeSqlServerSettings( editSqlSettinnsForm.SqlServerName, editSqlSettinnsForm.UseWindowsAuth ? AuthenticationType.Windows : AuthenticationType.SqlServer, editSqlSettinnsForm.SqlServerUser, editSqlSettinnsForm.SqlServerPassword, editSqlSettinnsForm.IbnUserName, editSqlSettinnsForm.IbnUserPassword); } else return; } CreateCompanyForDatabaseForm createCompanyForDatabaseForm = new CreateCompanyForDatabaseForm(this.Configurator); if (this.SnapIn.Console.ShowDialog(createCompanyForDatabaseForm) == DialogResult.OK) { status.ReportProgress(0, 0, string.Format(SnapInResources.CompanyScopeNode_Action_CreateForDatabase_Progress, createCompanyForDatabaseForm.textBoxHost.Text)); string newCompanyId = string.Empty; //Thread.Sleep(10000); newCompanyId = this.Configurator.CreateCompanyForDatabase( createCompanyForDatabaseForm.comboBoxSqlDatabase.Text, DateTime.UtcNow, createCompanyForDatabaseForm.checkBoxIsActive.Checked, createCompanyForDatabaseForm.textBoxHost.Text, createCompanyForDatabaseForm.IisIPAddress, int.Parse(createCompanyForDatabaseForm.textBoxIisPort.Text), createCompanyForDatabaseForm.IisPool, true); // Refresh Company List Refresh(); // TODO: Navigate browser to form.NewCompanyId Url } }
internal static void CreateAspSite(IConfigurator configurator, Microsoft.ManagementConsole.Advanced.Console console, SyncStatus status) { // Check Sql Settings ISqlServerSettings sqlSettings = configurator.SqlSettings; bool sqlSettingsOK = !string.IsNullOrEmpty(sqlSettings.Server); if (!sqlSettingsOK) { // TODO: Show Warning EditSqlServerSettingsForm editSqlSettinnsForm = new EditSqlServerSettingsForm(configurator); if (console.ShowDialog(editSqlSettinnsForm) == DialogResult.OK) { configurator.ChangeSqlServerSettings( editSqlSettinnsForm.SqlServerName, editSqlSettinnsForm.UseWindowsAuth ? AuthenticationType.Windows : AuthenticationType.SqlServer, editSqlSettinnsForm.SqlServerUser, editSqlSettinnsForm.SqlServerPassword, editSqlSettinnsForm.IbnUserName, editSqlSettinnsForm.IbnUserPassword); sqlSettingsOK = true; } } if (sqlSettingsOK) { CreateAspForm createAspForm = new CreateAspForm(configurator); if (console.ShowDialog(createAspForm) == DialogResult.OK) { if (status != null) status.ReportProgress(0, 0, SnapInResources.ServerFormView_Action_AspCreate_Progress); configurator.CreateAspSite(createAspForm.textBoxHost.Text , createAspForm.IisIPAddress , int.Parse(createAspForm.textBoxIisPort.Text) , createAspForm.IisPool ); } } }