Exemplo n.º 1
0
 //*****Método que permite ingresar un registro de cheque a la BD*****//
 public void AgregarCheque(EntidadCheque cheque)
 {
     using (Model1 bd = new Model1())
     {
         var nuevoCheque = new Cheques();
         nuevoCheque.imagePath    = cheque.ImagePath;
         nuevoCheque.monto        = cheque.Monto;
         nuevoCheque.cliente      = cheque.Cliente;
         nuevoCheque.montoEscrito = cheque.MontoEscrito;
         nuevoCheque.serie        = cheque.Serie;
         nuevoCheque.numero       = cheque.Numero;
         nuevoCheque.tipoCheque   = cheque.TipoCheque;
         nuevoCheque.fecha        = cheque.Fecha;
         bd.Cheques.Add(nuevoCheque);
         bd.SaveChanges();
     }
 }
Exemplo n.º 2
0
        //******Método que convierte a texto la imagen cargada*********//
        private void btnConvertirImagen_Click(object sender, EventArgs e)
        {
            this.progressBar1.Value   = 0;
            this.progressBar1.Maximum = contador;

            //Contadores
            int comercial = 0;
            int bbva      = 0;

            foreach (string path in fileNames)
            {
                progressBar1.Refresh();
                label1.Refresh();

                label1.Text = this.progressBar1.Value + " de " + this.progressBar1.Maximum;

                this.progressBar1.Value++;
                progressBar1.Refresh();
                label1.Refresh();
                DetectLogo(path);
                label1.Text = this.progressBar1.Value + " de " + this.progressBar1.Maximum;

                if (TipoCheque.Contains("BBVA"))

                {
                    EntidadCheque c = new EntidadCheque(path, DetectMontoBBVA(path), DetectClienteBBVA(path), DetectMontoEscritoBBVA(path), DetectSerieBBVA(path), DetectNumeroBBVA(path), "Cheque BANCO BBVA", DetectFechaBBVA(path));
                    AgregarCheque(c);

                    //Contador cheque bbva
                    bbva = bbva + 1;
                }
                else
                {
                    EntidadCheque c = new EntidadCheque(path, DetectMontoCom(path), DetectClienteCom(path), DetectMontoEscritoCom(path), DetectSerieCom(path), DetectNumeroCom(path), "Cheque BANCO COMERCIAL", DetectFechaCom(path));
                    AgregarCheque(c);

                    //Contador cheque comercial
                    comercial = comercial + 1;
                }
            }
            txtResultado.Text = " CHEQUES PROCESADOS :" + Environment.NewLine + "Banco Comercial :\t" + comercial + Environment.NewLine + "Banco BBVA\t:" + bbva
            ;
        }