private void btnAdd_Click(object sender, EventArgs e) { var AddEditWorker = new AddEditWorker(DateTime.Today); AddEditWorker.FormClosing += AddEditWorker_FormClosing; AddEditWorker.ShowDialog(); }
private void FireSelectedWorker() { var addEditWorker = new AddEditWorker( DateTime.Today, Convert.ToInt32( dgvWorkers.SelectedRows[0].Cells[0].Value)); addEditWorker.FormClosing += AddEditWorker_FormClosing; addEditWorker.ShowDialog(); }
private void btnEdit_Click(object sender, EventArgs e) { if (dgvWorkers.SelectedRows.Count == 0) { MessageBox.Show("Zaznacz pracownika do edycji"); return; } var addEditWorker = new AddEditWorker( Convert.ToInt32( dgvWorkers.SelectedRows[0].Cells[0].Value)); addEditWorker.FormClosing += AddEditWorker_FormClosing; addEditWorker.ShowDialog(); }