private void InicializaPantalla(AutoFacturacionInfo info)
        {
            try
            {
                var autoFacturacionDeCompraImagenesPL = new AutoFacturacionDeCompraImagenesPL();
                var imagen = autoFacturacionDeCompraImagenesPL.ObtenerImagenIneCurp(info);
                if (imagen != null)
                {
                    _imagen                = imagen;
                    _imagen.ProveedorId    = info.ProveedorId;
                    _imagen.OrganizacionId = info.OrganizacionId;
                    if ((imagen.ImgINE != null) || (imagen.ImgCURP != null))
                    {
                        if (imagen.ImgINE != null)
                        {
                            var imgIne = byteArrayToImage(imagen.ImgINE);
                            ImgINE.Image            = imgIne;
                            btnDescargar.Visibility = Visibility.Visible;
                            btnGirar.Visibility     = Visibility.Visible;
                            btnSiguiente.Visibility = Visibility.Visible;
                        }
                        else
                        {
                            SkMessageBox.Show(Application.Current.Windows[ConstantesVista.WindowPrincipal], Properties.Resources.AutoRefacturacionImagen_INE, MessageBoxButton.OK, MessageImage.Warning);
                        }

                        if (imagen.ImgCURP != null)
                        {
                            var imgCurp = byteArrayToImage(imagen.ImgCURP);
                            ImgCURP.Image = imgCurp;
                            btnDescargarCurp.Visibility = Visibility.Visible;
                            btnGirarCurp.Visibility     = Visibility.Visible;
                            btnSiguienteCurp.Visibility = Visibility.Visible;
                        }
                        else
                        {
                            SkMessageBox.Show(Application.Current.Windows[ConstantesVista.WindowPrincipal], Properties.Resources.AutoRefacturacionImagen_CURP, MessageBoxButton.OK, MessageImage.Warning);
                        }
                    }
                    else
                    {
                        SkMessageBox.Show(Application.Current.Windows[ConstantesVista.WindowPrincipal], Properties.Resources.AutoRefacturacionImagen_ValidaImagenes, MessageBoxButton.OK, MessageImage.Warning);
                    }
                }
                else
                {
                    SkMessageBox.Show(Application.Current.Windows[ConstantesVista.WindowPrincipal], Properties.Resources.AutoRefacturacionImagen_ValidaImagenes, MessageBoxButton.OK, MessageImage.Warning);
                }
            }
            catch (Exception)
            {
                SkMessageBox.Show(Application.Current.Windows[ConstantesVista.WindowPrincipal], Properties.Resources.AutoRefacturacionDocumentos_ErrorImagen, MessageBoxButton.OK, MessageImage.Warning);
            }
        }
 private void BuscarSiguienteImagen(AutoFacturacionInfo info, bool esCurp)
 {
     try
     {
         var autoFacturacionDeCompraImagenesPL = new AutoFacturacionDeCompraImagenesPL();
         var imagen = autoFacturacionDeCompraImagenesPL.ObtenerImagenIneCurp(_imagen);
         if (imagen != null)
         {
             if (esCurp)
             {
                 if (imagen.ImgCURP != null)
                 {
                     var imgCurp = byteArrayToImage(imagen.ImgCURP);
                     ImgCURP.Image     = imgCurp;
                     _imagen.ImgCURPId = imagen.ImgCURPId;
                 }
                 else
                 {
                     SkMessageBox.Show(Application.Current.Windows[ConstantesVista.WindowPrincipal], Properties.Resources.AutoRefacturacionImagen_CURP, MessageBoxButton.OK, MessageImage.Warning);
                 }
             }
             else
             {
                 if (imagen.ImgINE != null)
                 {
                     var imgIne = byteArrayToImage(imagen.ImgINE);
                     ImgINE.Image     = imgIne;
                     _imagen.ImgINEId = imagen.ImgINEId;
                 }
                 else
                 {
                     SkMessageBox.Show(Application.Current.Windows[ConstantesVista.WindowPrincipal], Properties.Resources.AutoRefacturacionImagen_INE, MessageBoxButton.OK, MessageImage.Warning);
                 }
             }
         }
         else
         {
             SkMessageBox.Show(Application.Current.Windows[ConstantesVista.WindowPrincipal], Properties.Resources.AutoRefacturacionImagen_ValidaImagenes, MessageBoxButton.OK, MessageImage.Warning);
         }
     }
     catch (Exception)
     {
         SkMessageBox.Show(Application.Current.Windows[ConstantesVista.WindowPrincipal], Properties.Resources.AutoRefacturacionDocumentos_ErrorImagen, MessageBoxButton.OK, MessageImage.Warning);
     }
 }
Пример #3
0
 private void InicializaPantalla(AutoFacturacionInfo info)
 {
     try
     {
         var autoFacturacionDeCompraImagenesPL = new AutoFacturacionDeCompraImagenesPL();
         _imagen = autoFacturacionDeCompraImagenesPL.ObtenerImagenDocumento(info);
         if (_imagen != null)
         {
             var IMG = byteArrayToImage(_imagen.ImgDocmento);
             ImgDocumento.Image = IMG;
         }
         else
         {
             SkMessageBox.Show(Application.Current.Windows[ConstantesVista.WindowPrincipal], Properties.Resources.AutoRefacturacionDocumentos_ValidarImagen, MessageBoxButton.OK, MessageImage.Error);
             btnDescargar.IsEnabled = false;
             btnGirar.IsEnabled     = false;
         }
     }
     catch (Exception)
     {
         SkMessageBox.Show(Application.Current.Windows[ConstantesVista.WindowPrincipal], Properties.Resources.AutoRefacturacionDocumentos_ErrorImagen, MessageBoxButton.OK, MessageImage.Error);
         btnDescargar.IsEnabled = false;
     }
 }