private void viewPicture() { try { if (pictureDataGrid.SelectedRows.Count > 0) { // Get picture ID where clicked int pictureId = pictureDataGrid.SelectedRows[0].Cells["PictureViewID"].Value.ToInt32TryParse(); var pictureView = PictureViewBLL.Current.GetByID(pictureId); // Open picture PictureViewDetailForm f = new PictureViewDetailForm(pictureView); f.Show(); } } catch (Exception exception) { ShowErrorMessage(exception.Message); } }
private void pictureViewToolStripMenuItem_Click(object sender, EventArgs e) { try { int idObject = Convert.ToInt32(currentRightClickCtrl.AccessibleName); if (entityConntext.Objects.Where(ent => ent.ObjectID == idObject).Count() > 0) { var obj = PictureViewBLL.Current.GetObjectByID(idObject); int pictureId = Convert.ToInt32(obj.Parameters); if (pictureId != 0) { Models.PictureView picture = PictureViewBLL.Current.GetByID(pictureId); using (PictureViewDetailForm f = new PictureViewDetailForm(picture, _displayRawValue)) { f.ShowDialog(); } } } } catch (Exception exception) { ShowErrorMessage(exception.Message); } }