private void button1_Click(object sender, EventArgs e) { Nullify(); Altering f3 = new Altering(); f3.ShowDialog(); if (confirm == true) { comm = conn.CreateCommand(); comm.CommandText = String.Format(add, SetName, SetSurname, SetCurrency, SetSum, SetDate, SetRate, SetTerm); comm.ExecuteNonQuery(); RefreshTable(); } }
private void Alter_Click(object sender, EventArgs e) { Nullify(); SetName = Convert.ToString(table.CurrentRow.Cells[1].Value); SetSurname = Convert.ToString(table.CurrentRow.Cells[2].Value); SetSum = Convert.ToInt32(table.CurrentRow.Cells[4].Value); SetCurrency = Convert.ToString(table.CurrentRow.Cells[3].Value); SetRate = Convert.ToInt32(table.CurrentRow.Cells[6].Value); SetTerm = Convert.ToInt32(table.CurrentRow.Cells[7].Value); SetDate = (string)table.CurrentRow.Cells[5].Value; Altering f3 = new Altering(); f3.ShowDialog(); if (confirm == true) { comm = conn.CreateCommand(); comm.CommandText = String.Format(update, SetName, SetSurname, SetCurrency, SetSum, SetDate, SetRate, SetTerm, Convert.ToString(table.CurrentRow.Cells[0].Value)); comm.ExecuteNonQuery(); RefreshTable(); } }