public void addCommandForQuery(IQuery query) { Button formButton = new Button(); formButton.Left = 500; formButton.Top = OfsetFromTop; OfsetFromTop += 30; formButton.Text = query.GetType().ToString(); formButton.Click += (s, e) => { Entity fullEntity = createAFullEntity(); fullEntity.name = InputEntityName; Postgre postgre = new Postgre(); postgre.executeQuery(query.BuildQuery(fullEntity)); UpdateTable(postgre); }; this.Controls.Add(formButton); }
private void UpdateTable(Postgre postre) { dataTable = postre.fetchAllDataFromTable(InputEntityName); ((DataGridView)(this.Controls["dataGridViewValues"])).DataSource = dataTable; }