private void buttonNew_Click(object sender, EventArgs e) { LocationCard locationCard = new LocationCard(); Location location = new Location(); locationCard.SetParameters(true, location); locationCard.ShowDialog(); InsertDataIntoTable(); }
private void buttonOpen_Click(object sender, EventArgs e) { if (locationsTable.SelectedRows.Count > 0) { int id = Convert.ToInt32(locationsTable.SelectedRows[0].Cells["Id"].Value.ToString()); Location location = new Location(); location = locationRepository.GetLocationById(id); LocationCard locationCard = new LocationCard(); locationCard.SetParameters(false, location); locationCard.ShowDialog(); InsertDataIntoTable(); } }