示例#1
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            try
            {
                if (txtIMGid.Text.Equals("") && picImage.Image != null)
                {
                    int addIMG = ClassDocument.insertImgToDoc(arr, int.Parse(DocID));
                    dt = ClassDocument.selectImgForOneDoc(int.Parse(DocID));

                    MessageBox.Show("Done . .");
                    numOfImag = dt.Rows.Count;
                    btnFirstIMG_Click(null, null);
                }
            }
            catch (Exception) { }
        }
示例#2
0
        private void dgvDoc_DoubleClick(object sender, EventArgs e)
        {
            try
            {
                DocID = dgvDoc.CurrentRow.Cells[0].Value.ToString();
                dt    = ClassDocument.selectImgForOneDoc(int.Parse(dgvDoc.CurrentRow.Cells[0].Value.ToString()));

                byte[]       arr = (byte[])(dt.Rows[0][1]);
                MemoryStream ms  = new MemoryStream(arr);
                pic1.Image = Image.FromStream(ms);

                byte[]       arr1 = (byte[])(dt.Rows[1][1]);
                MemoryStream ms1  = new MemoryStream(arr1);
                pic2.Image = Image.FromStream(ms1);
            }
            catch (Exception) { }
        }
示例#3
0
        private void btnDelete_Click(object sender, EventArgs e)
        {
            if (txtIMGid.Text.Equals(""))
            {
                picImage.Image = null;
            }
            else
            {
                int delImage = ClassDocument.DeleteImg(int.Parse(txtIMGid.Text));
                dt = ClassDocument.selectImgForOneDoc(int.Parse(DocID));

                MessageBox.Show("Done . .");
                txtIMGid.Text  = "";
                picImage.Image = null;
            }
            numOfImag = dt.Rows.Count;
            btnFirstIMG_Click(null, null);
        }
示例#4
0
 public Frm_ImgDoc(string id, string Rep_status)
 {
     InitializeComponent();
     DocID = id;
     if (Rep_status.Equals("Report"))
     {
         btnSave.Visible = btnDelete.Visible = btnSelectOne.Visible = false;
     }
     dt        = ClassDocument.selectImgForOneDoc(int.Parse(DocID));
     numOfImag = dt.Rows.Count;
     try
     {
         txtIMGid.Text = dt.Rows[0][0].ToString();
         byte[]       arr = (byte[])(dt.Rows[0][1]);
         MemoryStream ms  = new MemoryStream(arr);
         picImage.Image = Image.FromStream(ms);
     }
     catch (Exception) {  }
 }