private void button1_Click(object sender, EventArgs e) { string namefile = ""; var ofd = new OpenFileDialog(); ofd.Filter = "jpg|*.jpg"; if (ofd.ShowDialog() == DialogResult.OK) { namefile = System.Guid.NewGuid() + ".jpeg"; pictureBox7.Image = Image.FromFile(ofd.FileName); pictureBox7.Image.Save(Application.StartupPath + @"..\..\..\docs\" + namefile); Doc.DocAdd(namefile, id_ticket, currentdoc); docs = Doc.GetDocsTicket(id_ticket).Tables[0]; label2.Text = "Документ загружен"; } // GC.Collect(5, GCCollectionMode.Optimized); }
private void button1_Click(object sender, EventArgs e) { string namefile = ""; var ofd = new OpenFileDialog(); ofd.Filter = "jpg|*.jpg"; if (ofd.ShowDialog() == DialogResult.OK) { namefile = System.Guid.NewGuid() + ".jpeg"; pictureBox7.Image = Image.FromFile(ofd.FileName); pictureBox7.Image.Save(Application.StartupPath + @"..\..\..\docs\" + namefile); Doc.DocAdd(namefile, id_ticket, currentdoc); docs = Doc.GetDocsTicket(id_ticket).Tables[0]; label2.Text = "Документ загружен"; tabledoc.Rows[(Convert.ToInt32(currentdoc)) - 1].Cells[2].Value = "Загружено✓"; tabledoc.Rows[(Convert.ToInt32(currentdoc)) - 1].Cells[2].Style.BackColor = Color.FromArgb(119, 221, 119); checkdocstatus(); } // GC.Collect(5, GCCollectionMode.Optimized); }