private void metroButtonClose_Click(object sender, EventArgs e) { try { ValidFields(); ValidIfExistsTable(); var table = new SAPTables() { Name = metroTextBoxTableName.Text, Description = metroTextBoxTableDescription.Text, System = "N" }; _tableRepository.Add(table); MetroMessageBox.Show(this, "Tabela registrada com sucesso!", "INVENT", MessageBoxButtons.OK, MessageBoxIcon.Information); this.DialogResult = DialogResult.OK; this.Close(); } catch (Exception ex) { MetroMessageBox.Show(this, ex.Message, "INVENT", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
public void Add(SAPTables sapTable) { _dataConnection.DbConnection.Insert <SAPTables>(sapTable); }