private void Upd_ImageB_Click(object sender, EventArgs e) { ImageDataService imageDataService = new ImageDataService(); int result = imageDataService.UpdateImage(imageDataService.ByteConversion(pictureBox.Image), Upd_StoryBox.Text, Upd_DateBox.Text, Convert.ToInt32(Upd_ImageId.Text)); if (result > 0) { MessageBox.Show("Image Updated Succesfully!"); imageListView.DataSource = imageDataService.GetImageList(this.usingEventId); pictureBox.Image = null; textBox1.Text = null; } else { MessageBox.Show("Sorry There Was An Error!"); imageListView.DataSource = imageDataService.GetImageList(this.usingEventId); } }
private void AImageB_Click(object sender, EventArgs e) { ImageDataService imageDataService = new ImageDataService(); byte[] pictures = imageDataService.ByteConversion(pictureBox.Image); int result = imageDataService.AddImage(pictures, ImageStoryBox.Text, ModificationDateBox.Text, this.usingEventId); if (result > 0) { MessageBox.Show("Image Added Succesfully!"); imageListView.DataSource = imageDataService.GetImageList(this.usingEventId); pictureBox.Image = null; textBox1.Text = null; } else { MessageBox.Show("Sorry There Was An Error!"); imageListView.DataSource = imageDataService.GetImageList(this.usingEventId); } }