private void addbutton_Click(object sender, EventArgs e) { MemoryStream ms = new MemoryStream(); pictureBox.Image.Save(ms, pictureBox.Image.RawFormat); byte[] picturebyte = ms.ToArray(); Entity.Item item1 = new Entity.Item(postServices.GetCount() + 1, typecombo.Text, locationtext.Text , dateTime.Value, descriptiontext.Text, picturebyte); postServices.AddPost(item1); AddQuestion frm = new AddQuestion(); frm.IIdtext.Text = item1.getIID().ToString(); frm.ShowDialog(); this.Close(); }
static void frm_formclosed(object sender, FormClosedEventArgs e) { frm = null; }