private void button1_Click_1(object sender, EventArgs e) { Active t = GetSelectedData(); if (t != null) { FormEditZamestnanc c = new FormEditZamestnanc(); foreach (var i in zamestananec) { if (t.Name.Equals(i.Name, StringComparison.Ordinal) && t.Surname.Equals(i.LastName, StringComparison.Ordinal)) { if (c.OpenRecord(i.RecordId)) { c.Show(); } break; } } } else { MessageBox.Show("Choose dates!", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning); } }
private void gridZamestnanec_CellMouseClick(object sender, DataGridViewCellMouseEventArgs e) { FormEditZamestnanc c = new FormEditZamestnanc(); Zamestnanec t = GetSelectedData(); foreach (var i in z) { if (t.Name.Equals(i.Name, StringComparison.Ordinal) && t.LastName.Equals(i.LastName, StringComparison.Ordinal)) { if (c.OpenRecord(i.RecordId)) { c.Show(); } break; } } }