private void btnViewBird_Click(object sender, EventArgs e) { try { if (gridBirds.CurrentRow == null) { MessageBox.Show(@"First select a bird from grid to view"); } else { BirdDetails detailFrom = new BirdDetails(_birdService, this, _unitOfMeasurementService) { Bird = (Bird)gridBirds.CurrentRow?.DataBoundItem }; detailFrom.BirdFromGrid(); detailFrom.Um = cmbUM.SelectedValue as Enums.UnitOfMeasurement? ?? Enums.UnitOfMeasurement.Milliarchieops; detailFrom.Show(); } } catch (Exception ex) { MessageBox.Show(@"Error:" + ex.Message); } }
private void btnAddBird_Click(object sender, EventArgs e) { BirdDetails detailFrom = new BirdDetails(_birdService, this, _unitOfMeasurementService); detailFrom.Show(); }