private async void OnBuscarPorHuella(string obj = "")
        {
            try
            {
                await Task.Factory.StartNew(() => PopUpsViewModels.ShowPopUp(this, PopUpsViewModels.TipoPopUp.OSCURECER_FONDO));

                await TaskEx.Delay(400);

                var nRet    = -1;
                var bandera = true;
                var requiereGuardarHuellas = Parametro.GuardarHuellaEnBusquedaJuridico;
                if (requiereGuardarHuellas)
                {
                    try
                    {
                        nRet = CLSFPCaptureDllWrapper.CLS_Initialize();
                    }
                    catch
                    {
                        bandera = false;
                    }
                }
                else
                {
                    bandera = false;
                }

                var windowBusqueda = new BusquedaHuella();
                windowBusqueda.DataContext = new BusquedaHuellaViewModel(enumTipoPersona.IMPUTADO, nRet == 0, requiereGuardarHuellas);

                if (nRet != 0 ? ((ControlPenales.Clases.FingerPrintScanner)(windowBusqueda.DataContext)).Readers.Count == 0 : false)
                {
                    PopUpsViewModels.ClosePopUp(PopUpsViewModels.TipoPopUp.OSCURECER_FONDO);
                    PopUpsViewModels.ClosePopUp(PopUpsViewModels.TipoPopUp.HUELLAS);
                    StaticSourcesViewModel.Mensaje("Advertencia", "Asegurese de conectar su lector de huella digital", StaticSourcesViewModel.enumTipoMensaje.MENSAJE_INFORMACION, 5);
                    return;
                }

                windowBusqueda.Owner    = PopUpsViewModels.MainWindow;
                windowBusqueda.KeyDown += (s, e) =>
                {
                    try
                    {
                        if (e.Key == System.Windows.Input.Key.Escape)
                        {
                            windowBusqueda.Close();
                        }
                    }
                    catch (Exception ex)
                    {
                        StaticSourcesViewModel.ShowMessageError("Algo pasó...", "Ocurrió un error al buscar", ex);
                    }
                };
                windowBusqueda.Closed += (s, e) =>
                {
                    try
                    {
                        HuellasCapturadas = ((BusquedaHuellaViewModel)windowBusqueda.DataContext).HuellasCapturadas;
                        if (bandera == true)
                        {
                            CLSFPCaptureDllWrapper.CLS_Terminate();
                        }
                        PopUpsViewModels.ClosePopUp(PopUpsViewModels.TipoPopUp.OSCURECER_FONDO);

                        if (!((BusquedaHuellaViewModel)windowBusqueda.DataContext).IsSucceed)
                        {
                            return;
                        }

                        Imputado = ((BusquedaHuellaViewModel)windowBusqueda.DataContext).SelectRegistro != null ? ((BusquedaHuellaViewModel)windowBusqueda.DataContext).SelectRegistro.Imputado : null;
                        if (Imputado == null)//NO ENCONTRO LAS HUELLAS
                        {
                            ValidacionBiometrica();
                        }
                        else//SI ENCONTRO HUELLAS SE VALIDAN
                        {
                            if (SelectedLiberacion.Liberacion != null)
                            {
                                if (SelectedLiberacion.Liberacion.ID_CENTRO == Imputado.ID_CENTRO && SelectedLiberacion.Liberacion.ID_ANIO == Imputado.ID_ANIO && SelectedLiberacion.Liberacion.ID_IMPUTADO == Imputado.ID_IMPUTADO)
                                {
                                    //Guardar("N");
                                    GuardarLibertadBiometrica("N");
                                    #region Comentado
                                    //if (GuardarLiberacion("N"))
                                    //{
                                    //     new Dialogos().ConfirmacionDialogo("ÉXITO", "Informaci\u00F3n registrada correctamente.");
                                    //     ObtenerTodo();
                                    //}
                                    //else
                                    //    new Dialogos().ConfirmacionDialogo("ERROR", "No se registr\u00F3 la informaci\u00F3n.");
                                    #endregion
                                }
                                else
                                {
                                    ValidacionBiometrica();
                                }
                            }
                            else
                            {
                                //new Dialogos().ConfirmacionDialogo("Validación", "Las huellas del interno no conciden con las huellas interno a liberar.");
                                ValidacionBiometrica();
                            }
                        }
                    }
                    catch (Exception ex)
                    {
                        StaticSourcesViewModel.ShowMessageError("Algo pasó...", "Ocurrió un error al cerrar búsqueda", ex);
                    }
                };
                windowBusqueda.ShowDialog();
                //AceptarBusquedaHuellaFocus = true;
            }
            catch (Exception ex)
            {
                StaticSourcesViewModel.ShowMessageError("Algo pasó...", "Ocurrió un error al buscar imputado por huellas.", ex);
            }
        }
Exemple #2
0
        private async void OnBuscarPorHuella(string obj = "")
        {
            await Task.Factory.StartNew(() => PopUpsViewModels.ShowPopUp(this, PopUpsViewModels.TipoPopUp.OSCURECER_FONDO));

            await TaskEx.Delay(400);

            var nRet    = -1;
            var bandera = true;
            var requiereGuardarHuellas = Parametro.GuardarHuellaEnBusquedaEstatusAdministrativo;

            if (requiereGuardarHuellas)
            {
                try
                {
                    nRet = CLSFPCaptureDllWrapper.CLS_Initialize();
                }
                catch
                {
                    bandera = false;
                }
            }
            else
            {
                bandera = false;
            }

            var windowBusqueda = new BusquedaHuella();

            windowBusqueda.DataContext = new BusquedaHuellaViewModel(enumTipoPersona.IMPUTADO, nRet == 0, requiereGuardarHuellas);

            if (nRet != 0 ? ((ControlPenales.Clases.FingerPrintScanner)(windowBusqueda.DataContext)).Readers.Count == 0 : false)
            {
                PopUpsViewModels.ClosePopUp(PopUpsViewModels.TipoPopUp.OSCURECER_FONDO);
                PopUpsViewModels.ClosePopUp(PopUpsViewModels.TipoPopUp.HUELLAS);
                StaticSourcesViewModel.Mensaje("ADVERTENCIA", "ASEGURESE DE CONECTAR SU LECTOR DE HUELLA DIGITAL", StaticSourcesViewModel.enumTipoMensaje.MENSAJE_INFORMACION, 5);
                return;
            }

            windowBusqueda.Owner    = PopUpsViewModels.MainWindow;
            windowBusqueda.KeyDown += (s, e) =>
            {
                try
                {
                    if (e.Key == System.Windows.Input.Key.Escape)
                    {
                        windowBusqueda.Close();
                    }
                }
                catch (Exception ex)
                {
                    StaticSourcesViewModel.ShowMessageError("Algo pasó...", "Ocurrió un error al buscar", ex);
                }
            };
            windowBusqueda.Closed += (s, e) =>
            {
                try
                {
                    HuellasCapturadas = ((BusquedaHuellaViewModel)windowBusqueda.DataContext).HuellasCapturadas;
                    if (bandera == true)
                    {
                        CLSFPCaptureDllWrapper.CLS_Terminate();
                    }
                    PopUpsViewModels.ClosePopUp(PopUpsViewModels.TipoPopUp.OSCURECER_FONDO);

                    if (!((BusquedaHuellaViewModel)windowBusqueda.DataContext).IsSucceed)
                    {
                        return;
                    }

                    Imputado = ((BusquedaHuellaViewModel)windowBusqueda.DataContext).SelectRegistro != null ? ((BusquedaHuellaViewModel)windowBusqueda.DataContext).SelectRegistro.Imputado : null;

                    if (Imputado == null)
                    {
                        new Dialogos().ConfirmacionDialogo("Validación", "Favor de autentificar al interno por medio de huella");
                        return;
                    }
                    else
                    {
                        if (SelectedAtencionCita != null)
                        {
                            if (SelectedAtencionCita.INGRESO != null)
                            {
                                if (Imputado.ID_CENTRO == SelectedAtencionCita.INGRESO.ID_CENTRO && Imputado.ID_ANIO == SelectedAtencionCita.INGRESO.ID_ANIO && Imputado.ID_IMPUTADO == SelectedAtencionCita.ID_IMPUTADO)
                                {
                                    TabControlEnabled = MenuGuardarEnabled = true;
                                    BHuellasEnabled   = false;
                                }
                                else
                                {
                                    new Dialogos().ConfirmacionDialogo("Validación", "El interno no coincide con el solicitado");
                                }
                            }
                        }
                    }
                }
                catch (Exception ex)
                {
                    StaticSourcesViewModel.ShowMessageError("Algo pasó...", "Ocurrió un error al cerrar busqueda", ex);
                }
            };
            windowBusqueda.ShowDialog();
            //AceptarBusquedaHuellaFocus = true;
        }
Exemple #3
0
        private void OnLoad(BusquedaHuella Window)
        {
            #region [Huellas Digitales]
            var myDoubleAnimation = new DoubleAnimation();
            myDoubleAnimation.From           = 0;
            myDoubleAnimation.To             = 185;
            myDoubleAnimation.Duration       = new Duration(TimeSpan.FromSeconds(1.3));
            myDoubleAnimation.AutoReverse    = true;
            myDoubleAnimation.RepeatBehavior = RepeatBehavior.Forever;

            Storyboard.SetTargetName(myDoubleAnimation, "Ln");
            Storyboard.SetTargetProperty(myDoubleAnimation, new PropertyPath(Canvas.TopProperty));
            var myStoryboard = new Storyboard();
            myStoryboard.Children.Add(myDoubleAnimation);
            myStoryboard.Begin(Window.Ln);
            #endregion

            Window.Closed += (s, e) =>
            {
                try
                {
                    if (OnProgress == null)
                    {
                        return;
                    }

                    if (!_IsSucceed)
                    {
                        SelectRegistro = null;
                    }

                    OnProgress.Abort();
                    CancelCaptureAndCloseReader(OnCaptured);
                }
                catch (Exception ex)
                {
                    StaticSourcesViewModel.ShowMessageError("Algo pasó...", "Ocurrió un error al cargar busqueda", ex);
                }
            };

            if (CurrentReader != null)
            {
                CurrentReader.Dispose();
                CurrentReader = null;
            }

            CurrentReader = Readers[0];

            if (CurrentReader == null)
            {
                return;
            }

            if (!OpenReader())
            {
                Window.Close();
            }

            if (!StartCaptureAsync(OnCaptured))
            {
                Window.Close();
            }

            OnProgress = new Thread(() => InvokeDelegate(Window));

            Application.Current.Dispatcher.Invoke((System.Action)(delegate
            {
                ScannerMessage = "Capture Huella";
                ColorMessage   = new SolidColorBrush(Colors.Green);
            }));
            GuardandoHuellas = true;
        }
Exemple #4
0
        private async void OnBuscarPorHuella(string obj = "")
        {
            try
            {
                await Task.Factory.StartNew(() => PopUpsViewModels.ShowPopUp(this, PopUpsViewModels.TipoPopUp.OSCURECER_FONDO));

                await TaskEx.Delay(400);

                var nRet    = -1;
                var bandera = true;
                var requiereGuardarHuellas = Parametro.GuardarHuellaEnBusquedaPadronVisita;
                if (requiereGuardarHuellas)
                {
                    try
                    {
                        nRet = CLSFPCaptureDllWrapper.CLS_Initialize();
                    }
                    catch
                    {
                        bandera = false;
                    }
                }
                else
                {
                    bandera = false;
                }

                var windowBusqueda = new BusquedaHuella();
                windowBusqueda.DataContext = new BusquedaHuellaViewModel(enumTipoPersona.PERSONA_TODOS, nRet == 0, requiereGuardarHuellas);

                if (nRet != 0)
                {
                    if (((ControlPenales.Clases.FingerPrintScanner)(windowBusqueda.DataContext)).Readers.Count == 0)
                    {
                        PopUpsViewModels.ClosePopUp(PopUpsViewModels.TipoPopUp.OSCURECER_FONDO);
                        PopUpsViewModels.ClosePopUp(PopUpsViewModels.TipoPopUp.HUELLAS);
                        StaticSourcesViewModel.Mensaje("ADVERTENCIA", "ASEGURESE DE CONECTAR SU LECTOR DE HUELLA DIGITAL", StaticSourcesViewModel.enumTipoMensaje.MENSAJE_INFORMACION, 5);
                        return;
                    }
                }
                windowBusqueda.Owner    = PopUpsViewModels.MainWindow;
                windowBusqueda.KeyDown += (s, e) => { if (e.Key == System.Windows.Input.Key.Escape)
                                                      {
                                                          windowBusqueda.Close();
                                                      }
                };
                windowBusqueda.Closed += async(s, e) =>
                {
                    var resultado = ((BusquedaHuellaViewModel)windowBusqueda.DataContext);
                    if (resultado != null)
                    {
                        if (resultado.SelectRegistro != null)
                        {
                            SelectedLiberado = resultado.SelectRegistro.Persona;
                            ObtenerLiberado();
                        }
                    }
                    PopUpsViewModels.ClosePopUp(PopUpsViewModels.TipoPopUp.OSCURECER_FONDO);
                };
                windowBusqueda.ShowDialog();
            }
            catch (Exception ex)
            {
                StaticSourcesViewModel.ShowMessageError("Algo pasó...", "Ocurrió un error al buscar por huella.", ex);
            }
        }
Exemple #5
0
        private async void OnBuscarPorHuella(string obj = "")
        {
            try
            {
                if (!PConsultar)
                {
                    (new Dialogos()).ConfirmacionDialogo("Validación", "No cuenta con suficientes privilegios para realizar esta acción.");
                    return;
                }

                await Task.Factory.StartNew(() => PopUpsViewModels.ShowPopUp(this, PopUpsViewModels.TipoPopUp.OSCURECER_FONDO));

                await TaskEx.Delay(400);

                var nRet    = -1;
                var bandera = true;
                var requiereGuardarHuellas = Parametro.GuardarHuellaEnBusquedaPadronVisita;
                if (requiereGuardarHuellas)
                {
                    try
                    {
                        nRet = CLSFPCaptureDllWrapper.CLS_Initialize();
                    }
                    catch
                    {
                        bandera = false;
                    }
                }
                else
                {
                    bandera = false;
                }

                var windowBusqueda = new BusquedaHuella();
                windowBusqueda.DataContext = this;
                ConstructorHuella(enumTipoPersona.IMPUTADO, nRet == 0, requiereGuardarHuellas);
                windowBusqueda.dgHuella.Columns.Insert(windowBusqueda.dgHuella.Columns.Count, new DataGridTextColumn()
                {
                    Binding = new System.Windows.Data.Binding("Imputado")
                    {
                        Converter = new GetTipoPersona()
                    },
                    Header = "IMPUTADO"
                });
                if (nRet != 0 ? ((ControlPenales.Clases.FingerPrintScanner)(windowBusqueda.DataContext)).Readers.Count == 0 : false)
                {
                    PopUpsViewModels.ClosePopUp(PopUpsViewModels.TipoPopUp.OSCURECER_FONDO);
                    PopUpsViewModels.ClosePopUp(PopUpsViewModels.TipoPopUp.HUELLAS);
                    StaticSourcesViewModel.Mensaje("ADVERTENCIA", "ASEGURESE DE CONECTAR SU LECTOR DE HUELLA DIGITAL", StaticSourcesViewModel.enumTipoMensaje.MENSAJE_INFORMACION, 5);
                    return;
                }
                windowBusqueda.Owner    = PopUpsViewModels.MainWindow;
                windowBusqueda.KeyDown += (s, e) => { if (e.Key == System.Windows.Input.Key.Escape)
                                                      {
                                                          windowBusqueda.Close();
                                                      }
                };
                windowBusqueda.Closed += (s, e) =>
                {
                    HuellasCapturadas = ((NotaMedicaViewModel)windowBusqueda.DataContext).HuellasCapturadas;
                    if (bandera == true)
                    {
                        CLSFPCaptureDllWrapper.CLS_Terminate();
                    }
                    PopUpsViewModels.ClosePopUp(PopUpsViewModels.TipoPopUp.OSCURECER_FONDO);
                    //var huella = ((NotaMedicaViewModel)windowBusqueda.DataContext);
                    if (!IsSucceed)
                    {
                        return;
                    }
                    if (SelectRegistro != null ? SelectRegistro.Imputado == null : null == null)
                    {
                        return;
                    }
                    //SelectPersona = huella.SelectRegistro.Persona;
                };
                windowBusqueda.ShowDialog();
            }
            catch (Exception ex)
            {
                StaticSourcesViewModel.ShowMessageError("Algo pasó...", "Ocurrió un error al buscar por huella.", ex);
            }
        }