Exemplo n.º 1
0
 private void barButtonItem2_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
 {
     if (!msgfilter)
     {
         this.Enabled = false;
         msgfilter    = true;
         Application.AddMessageFilter(this);
     }
     tw.Acquire();
 }
Exemplo n.º 2
0
 /// <summary>
 /// Handles the Click event of the ContinueButton control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="T:System.EventArgs"/> instance containing the event data.</param>
 private void ContinueButton_Click(object sender, EventArgs e)
 {
     try
     {
         if (this.CheckOfficeScanner())
         {
             try
             {
                 if (!msgfilter)
                 {
                     // this.Enabled = false;
                     msgfilter = true;
                     Application.AddMessageFilter(this);
                 }
                 tw.Acquire();
             }
             catch (Exception ex)
             {
                 MessageBox.Show(SharedFunctions.GetResourceString("ErrorOnScanning"), SharedFunctions.GetResourceString("ScanInterface"), MessageBoxButtons.OK, MessageBoxIcon.Error);
             }
         }
     }
     catch (Exception)
     {
         MessageBox.Show(SharedFunctions.GetResourceString("ErrorOnScanning"), SharedFunctions.GetResourceString("ScanInterface"), MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Exemplo n.º 3
0
        private void btnScan_Click(object sender, EventArgs e)
        {
            try
            {
                if (TempData.isFirstScan == 0)
                {
                    TempData.isFirstScan = 1;
                    tw.Select();
                }
                if (!msgfilter)
                {
                    msgfilter = true;
                    Application.AddMessageFilter(this);
                }
                if (!tw.Acquire())
                {
                    MessageBox.Show("Операция отменена, \nлибо необходимо проверить \nподключение сканера", "Сообщение", MessageBoxButtons.OK, MessageBoxIcon.Error);


                    //if (tw.getSRCT()== 0)
                    //{
                    //    MessageBox.Show("Не найдено подключенных сканеров", "Сообщение", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    //}
                    //this.Close();
                }
                //this.Activate();
            }
            catch
            {
                MessageBox.Show("Сканер недоступен");
                tw.CloseSrc();
                EndingScan();
            }
        }
 private void btnDigitalizar_Click(object sender, EventArgs e)
 {
     Cursor.Current         = Cursors.WaitCursor;
     btnDigitalizar.Enabled = false;
     InitializeScan();
     objTwain.Acquire();
     //EndingScan();
 }
Exemplo n.º 5
0
 /// <summary>
 /// 開始掃描
 /// </summary>
 public void Scan()
 {
     if (!msgfilter)
     {
         msgfilter = true;
         Application.AddMessageFilter(this);
     }
     tw.Acquire(ShowGUI, DPI);
 }
Exemplo n.º 6
0
 private void btnScan_Click(object sender, EventArgs e)
 {
     if (!msgfilter)
     {
         this.Enabled = false;
         msgfilter    = true;
         Application.AddMessageFilter(this);
     }
     tw.Acquire();
 }
Exemplo n.º 7
0
 public void BeginPhoto()
 {
     if (!msgfilter)
     {
         // ctr.Enabled = false;
         msgfilter = true;
         Application.AddMessageFilter(this);
     }
     tw.Acquire();
 }
Exemplo n.º 8
0
        private void AcquireVoucher(bool defaultScannerSettings)
        {
            bool   useImprinter = SettingsTable.Get <bool>(Strings.VScan_UseImPrinter, false);
            string voucherText  = null;

            if (useImprinter)
            {
                VoucherData = ScanAppContext.FillFromScanContext(new Voucher());
                string voucherTemplate = SettingsTable.Get <string>(Strings.VScan_ImPrinterTemplate, Strings.VScan_ImPrinterTemplateDefault);
                voucherText = voucherTemplate.format(ms_Aliases);
            }
            m_twain.Acquire(defaultScannerSettings, voucherText);
        }
Exemplo n.º 9
0
        //============================================================================
        // NOMBRE: Adquirir
        //
        // DESCRIPCIÓN: Muestra la ventana de opciones del escáner.
        //
        // ARGUMENTOS: -
        //
        // SALIDA: Booleano que indica si el escáner es accesible
        //============================================================================
        public bool Adquirir()
        {
            TwRC escanerAccesible = escaner.Acquire();

            if (escanerAccesible == TwRC.Success)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Exemplo n.º 10
0
        /// <summary>
        /// Carga una imagen desde el escaner y la coloca en el formulario
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnLoadImage_Click(object sender, EventArgs e)
        {
            try
            {
                if (!bMsgFilter)
                {
                    this.Enabled = false;
                    bMsgFilter   = true;
                    Application.AddMessageFilter(this);
                }

                tw.Acquire();
            }
            catch (Exception ex) { }
        }
Exemplo n.º 11
0
        private void btnGetImage_Click(object sender, EventArgs e)
        {
            // Image image = ImageFromDevice.GetImageFromImageSource();
            // if (image != null)
            // {
            // this.pictureBox1.Image = image;
            // }

            if (!msgfilter)
            {
                this.Enabled = false;
                msgfilter    = true;
                Application.AddMessageFilter(this);
            }
            tw.Acquire();
        }
Exemplo n.º 12
0
        private void btnBegin_Click(object sender, EventArgs e)
        {
            if (this.txtPicPath.Text.Length == 0)
            {
                MessageBoxHelper.Show("请先配置要采集的照片的存放路径!");
                this.txtPicPath.Focus();
                return;
            }
            string idcard = this.txtIdCard.Text.Trim();

            if (idcard.Length == 0)
            {
                MessageBoxHelper.Show("请先输入要采集人的身份证明号码!");
                this.txtIdCard.Focus();
                return;
            }
            if (idcard.Length == 15)
            {
                idcard = FT.Commons.Tools.IDCardHelper.IdCard15To18(idcard);
                this.txtIdCard.Text = idcard;
            }
            if (this.cbIdCardType.SelectedIndex == 0)
            {
                string error = IDCardHelper.Validate(idcard);
                if (error.Length > 0)
                {
                    MessageBoxHelper.Show(error);
                    this.txtIdCard.Focus();
                    return;
                }
            }
            try
            {
                if (!msgfilter)
                {
                    this.Enabled = false;
                    msgfilter    = true;
                    Application.AddMessageFilter(this);
                }
                FileHelper.ClearCapturePhotoes();
                tw.Acquire();
            }
            catch (Exception ex)
            {
                MessageBoxHelper.Show("没有找到合适外设!");
            }
        }
Exemplo n.º 13
0
 private void btnDigitalizar_Click(object sender, EventArgs e)
 {
     try
     {
         // Cursor.Current = Cursors.WaitCursor;
         btnDigitalizar.Enabled = false;
         InitializeScan();
         objTwain.Acquire();
         //EndingScan();
     }
     catch (Exception ex)
     {
         MessageBox.Show("ERRO : " + ex.ToString(), Global.CODAPP + " - " + Global.DESCRICAOAPP, MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
     //finally
     //{
     //    Cursor = Cursors.Default;
     //}
 }
        private void ultraToolbarsTwain_ToolClick(object sender, Infragistics.Win.UltraWinToolbars.ToolClickEventArgs e)
        {
            switch (e.Tool.Key.ToString())
            {
            case "Adquire":
                if (!msgfilter)
                {
                    this.Enabled = false;
                    msgfilter    = true;
                    Application.AddMessageFilter(this);
                }
                tw.Acquire(mnShowUI.Checked ? (short)1 : (short)0, (short)1);
                break;

            case "SetupSchool":
                frmSetupCustomer frm = new frmSetupCustomer();
                frm.ShowDialog();
                GetGlobalParameters();
                break;
            }
        }