Ejemplo n.º 1
0
 private void Scan()
 {
     try
     {
         Nwuram.Framework.scan.scanImg fImg = new Nwuram.Framework.scan.scanImg();
         fImg.ShowDialog();
         this.TopMost = true;
         byte[] img_array = fImg.img_array;
         this.TopMost = false;
         if (img_array != null)
         {
             NameFileForm frmNF = new NameFileForm();
             if (DialogResult.OK == frmNF.ShowDialog())
             {
                 string fileName = frmNF.getComment;
                 byte[] byteFile = img_array;
                 saveFileToDataBase(byteFile, fileName, ".jpg");
             }
         }
     }
     catch
     {
         MessageBox.Show("Ошибка при работе со сканером!");
     }
 }
Ejemplo n.º 2
0
 private void btEditName_Click(object sender, EventArgs e)
 {
     try
     {
         int          indexRow = dgvScan.CurrentRow.Index;
         NameFileForm frmNF    = new NameFileForm();
         if (DialogResult.OK == frmNF.ShowDialog())
         {
             if (id_Req != 0 && Sql.bufferDataTable != null && Sql.bufferDataTable.DefaultView.Count > 0 && dgvScan.CurrentRow != null)
             {
                 int ind = dgvScan.CurrentRow.Index;
                 int id  = int.Parse(Sql.bufferDataTable.DefaultView[ind]["id"].ToString());
                 lRename.Add(id);
             }
             string fileName = frmNF.getComment;
             Sql.bufferDataTable.DefaultView[indexRow]["cName"] = fileName;
             Sql.bufferDataTable.AcceptChanges();
         }
     }
     catch (Exception)
     {
     }
 }