private void PictureBox_DoubleClick(object sender, EventArgs e) { pictureBox = (PictureBox)sender; Products products = (Products)pictureBox.Tag; if (products.ExePath.Contains(".exe")) { FormShow formShow = new FormShow(); formShow.Products = products; formShow.ShowDialog(); } else { bool bPic = false; using (var db = new MyDbContext()) { var productsDetails = db.ProductsDetails.Where(x => x.ProductsID == products.ID).ToList(); if (productsDetails != null && productsDetails.Count > 0) { bPic = true; } } if (bPic == true) { FormGallery formGallery = new FormGallery(); formGallery.Products = products; formGallery.ShowDialog(); } else { Process p = Process.Start(products.ExePath); } } }
private void PictureBox_Click(object sender, EventArgs e) { ProductsDetails productsDetails = (ProductsDetails)((PictureBox)sender).Tag; if (productsDetails.ExePath.Contains(".exe")) { FormShow formShow = new FormShow(); formShow.Products = new Products() { ExePath = productsDetails.ExePath }; formShow.ShowDialog(); } else { Process p = Process.Start(productsDetails.ExePath); } }