private void btnNew_Clicked(object sender, EventArgs e)
        {
            if (!BusinessDomain.TryConnect(DbProvider, Server, SlaveServer, User, Password))
            {
                MessageError.ShowDialog(Translator.GetString("The connection to the server was not successful!"),
                                        "Icons.Database32.png");
                return;
            }

            CreateDatabaseType dbType;

            using (NewDatabase dlgNewDB = new NewDatabase()) {
                ResponseType response = dlgNewDB.Run();
                if (response == ResponseType.Apply)
                {
                    BusinessDomain.AppConfiguration.DbDatabase = dlgNewDB.DatabaseName;
                    ReLoadDatabases();
                }

                if (response != ResponseType.Ok)
                {
                    return;
                }

                dbType = dlgNewDB.DatabaseType;

                // Set the new database as the only one as at this point we are closing the dialog and we don't nee the full list
                cboDatabase.Load(new [] { dlgNewDB.DatabaseName }, null, null, null);
            }

            // Unclutter the screen by hiding the background dialog which is no longer needed anyway
            dlgEditDBConnection.Hide();
            if (dbType == CreateDatabaseType.Blank)
            {
                SetSettings();
                BusinessDomain.AppConfiguration.Load(false);

                using (Assistant assistant = new Assistant(AssistType.DatabaseSetup))
                    assistant.Run();

                BusinessDomain.AppConfiguration.Save(true);
            }

            dlgEditDBConnection.Respond(ResponseType.Ok);
        }
Exemplo n.º 2
0
 public abstract bool CommitChanges(StepPartners step, Assistant assistant);
Exemplo n.º 3
0
        public override bool Complete(Assistant assistant)
        {
            ItemsSetup setup = setups [nbkMain.CurrentPage];

            return(setup.Validate() && setup.CommitChanges(this, assistant));
        }
Exemplo n.º 4
0
 public abstract bool CommitChanges(StepLocations step, Assistant assistant);
Exemplo n.º 5
0
 public virtual bool Complete(Assistant assistant)
 {
     ChangeStatus(StepStatus.Complete);
     return(true);
 }