Exemplo n.º 1
0
        public void SetProperties(string dbName, string tableName)
        {
            Init();
            var databases = _runner.GetDatabaseList().ToList();

            if (databases.Count > 0)
            {
                foreach (var db in databases)
                {
                    dbNameBox.Items.Add(db.Name);
                }

                if (dbName == tableName && dbName == string.Empty)
                {
                    dbNameBox.SelectedIndex = 0;
                }
                else
                {
                    tableNameTextBox.Text    = tableName;
                    tableNameTextBox.Enabled = false;
                    dbNameBox.Text           = dbName;
                    dbNameBox.Enabled        = false;
                    Dictionary <string, string> columns = _runner.GetTable(dbName, tableName).Columns;

                    CreateTableView(columns);
                }
            }
        }
Exemplo n.º 2
0
        public void Init()
        {
            dbComboBox.Items.Clear();

            qtComboBox.Items.Clear();

            whereColumnBox.Text  = String.Empty;
            opBox.Text           = String.Empty;
            whereValTextBox.Text = String.Empty;


            qtComboBox.Items.Add("Select");
            qtComboBox.Items.Add("Insert");
            qtComboBox.Items.Add("Update");
            qtComboBox.Items.Add("Delete");
            qtComboBox.SelectedIndex = 0;

            var databases = _runner.GetDatabaseList();

            if (databases.Count() > 0)
            {
                foreach (var db in databases)
                {
                    dbComboBox.Items.Add(db.Name);
                }
                dbComboBox.SelectedIndex = 0;

                SetTableBox();

                SetWhereView();
            }
        }
        public void Init(int id)
        {
            dbListBox.Items.Clear();
            var databases = _runner.GetDatabaseList();

            if (databases.Count() > 0)
            {
                foreach (var db in databases)
                {
                    dbListBox.Items.Add(db.Name);
                }
                dbListBox.SetSelected(id, true);
            }
        }