private void btnPlaceDetails_Click(object sender, EventArgs e) { int placeIndex = dgvPlaceTable.CurrentCell.RowIndex; PlaceEntity place = AllPlaces.ElementAt(placeIndex); CRUD_Place crudPlace = new CRUD_Place(place); crudPlace.makeReadOnly(); crudPlace.Show(); }
private void btnPlaceAdd_Click(object sender, EventArgs e) { PlaceEntity place = new PlaceEntity(); CRUD_Place crudPlace = new CRUD_Place(place); crudPlace.ShowDialog(); if (crudPlace.DialogResult == DialogResult.OK) { AllPlaces.Add(place); dgvPlaceTable.Invalidate(); } }
private void btnPlaceEdit_Click(object sender, EventArgs e) { int placeIndex = dgvPlaceTable.CurrentCell.RowIndex; PlaceEntity place = AllPlaces.ElementAt(placeIndex); CRUD_Place crudPlace = new CRUD_Place(place); crudPlace.editing = true; crudPlace.ShowDialog(); if (crudPlace.DialogResult == DialogResult.OK) { dgvPlaceTable.InvalidateRow(placeIndex); } }