private void btnAdd_Click(object sender, EventArgs e) { FrmAddParticipants add = new FrmAddParticipants(); DialogResult resultat = add.ShowDialog(); if (resultat == System.Windows.Forms.DialogResult.OK) { Logic logic = new Logic(); logic.addparticpant(path,add.Data[0], add.Data[1], add.Data[2], add.Data[3], add.Data[4], add.Data[5]); updateGridView(); } else if (resultat == System.Windows.Forms.DialogResult.Cancel) add.Dispose(); }
private void btnUpdate_Click(object sender, EventArgs e) { if (this.numberOfTables > 4) { participantData[0] = dataGridView1.CurrentRow.Cells[0].Value.ToString(); participantData[1] = dataGridView1.CurrentRow.Cells[1].Value.ToString(); participantData[2] = dataGridView1.CurrentRow.Cells[2].Value.ToString(); participantData[3] = dataGridView1.CurrentRow.Cells[3].Value.ToString(); participantData[4] = dataGridView1.CurrentRow.Cells[4].Value.ToString(); participantData[5] = dataGridView1.CurrentRow.Cells[5].Value.ToString(); FrmAddParticipants add = new FrmAddParticipants(participantData); DialogResult resultat = add.ShowDialog(); if (resultat == System.Windows.Forms.DialogResult.OK) { Logic logic = new Logic(); logic.updateParticpant(path, dataGridView1.CurrentRow, add.Data); updateGridView(); } else if (resultat == System.Windows.Forms.DialogResult.Cancel) add.Dispose(); } }