Ejemplo n.º 1
0
        public FormScriptObject(ScriptObject[] scriptObjects, ArchAngel.Providers.Database.Model.Database parentDatabase)
        {
            InitializeComponent();
            this.BackColor      = Slyce.Common.Colors.BackgroundColor;
            this.ParentDatabase = parentDatabase;

            _scriptObjects  = scriptObjects;
            ucHeading1.Text = "";
            Controller.ShadeMainForm();
        }
Ejemplo n.º 2
0
        public FormScriptObject(ScriptObject[] scriptObjects, ArchAngel.Providers.Database.Model.Database parentDatabase)
        {
            InitializeComponent();
            this.BackColor = Slyce.Common.Colors.BackgroundColor;
            this.ParentDatabase = parentDatabase;

            _scriptObjects = scriptObjects;
            ucHeading1.Text = "";
            Controller.ShadeMainForm();
        }
Ejemplo n.º 3
0
        private void buttonAddDatabase_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(Controller.Instance.AppConfig.TemplateFileName))
            {
                MessageBox.Show("Please select a template on the Project Details screen before adding a database.", "No Template", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }
            FormSelectDatabase form = new FormSelectDatabase();

            if (form.ShowAddDatabase())
            {
                ArchAngel.Providers.Database.Model.Database database = new ArchAngel.Providers.Database.Model.Database(form.DatabaseName, form.ConnectionString, form.DatabaseType);
                Controller.Instance.BllDatabase.AddDatabase(database);
                DisplayDatabaseList();
            }
        }
Ejemplo n.º 4
0
        private void buttonEdit_Click(object sender, EventArgs e)
        {
            if (listBoxDatabase.SelectedItems.Count == 0)
            {
                MessageBox.Show("Please select a database from the list.", "No Database Selected", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }
            int foundIndex = -1;

            // Find the selected database
            for (int i = 0; i < Controller.Instance.BllDatabase.Databases.Length; i++)
            {
                if (Controller.Instance.BllDatabase.Databases[i].Name == ((ArchAngel.Providers.Database.Model.Database)listBoxDatabase.SelectedItems[0]).Name)
                {
                    foundIndex = i;
                    break;
                }
            }
            if (foundIndex < 0)
            {
                MessageBox.Show("Database not found in internal collection.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            FormSelectDatabase form = new FormSelectDatabase();

            if (form.ShowEditDatabase(Controller.Instance.BllDatabase.Databases[foundIndex].ConnectionString))
            {
                ArchAngel.Providers.Database.Model.Database database = (ArchAngel.Providers.Database.Model.Database)listBoxDatabase.SelectedItem;
                database.Name             = form.DatabaseName;
                database.DatabaseType     = form.DatabaseType;
                database.ConnectionString = form.ConnectionString;

                Controller.Instance.BllDatabase.UpdateDatabase(database, listBoxDatabase.SelectedIndex);
            }
        }
Ejemplo n.º 5
0
        private void buttonAddDatabase_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(Controller.Instance.AppConfig.TemplateFileName))
            {
                MessageBox.Show("Please select a template on the Project Details screen before adding a database.", "No Template", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }
            FormSelectDatabase form = new FormSelectDatabase();

            if (form.ShowAddDatabase())
            {
                ArchAngel.Providers.Database.Model.Database database = new ArchAngel.Providers.Database.Model.Database(form.DatabaseName, form.ConnectionString, form.DatabaseType);
                Controller.Instance.BllDatabase.AddDatabase(database);
                DisplayDatabaseList();
            }
        }