private void SeniasDorsoLoad(SeniasDorsoView Window = null)
 {
     try
     {
         if (Window == null)
         {
             return;
         }
         if (ListRadioButonsDorso != null ? ListRadioButonsDorso.Any() : false)
         {
             return;
         }
         ListRadioButonsDorso = new List <RadioButton>();
         ListRadioButonsDorso = new FingerPrintScanner().FindVisualChildren <RadioButton>(((Grid)Window.FindName("GridDorso"))).ToList();
         if (SelectLesion != null)
         {
             foreach (var item in ListRadioButonsDorso)
             {
                 item.IsChecked = item.CommandParameter != null?item.CommandParameter.ToString().Split('-')[0] == SelectLesion.REGION.ID_REGION.ToString() : false;
             }
         }
     }
     catch (Exception ex)
     {
         StaticSourcesViewModel.ShowMessageError("Algo pasó...", "Ocurrio un error al cargar datos iniciales de las lesiones.", ex);
     }
 }
예제 #2
0
        public void OnComplete(object Capture, string ReaderSerialNumber, DPFP.Sample Sample)
        {
            foreach (var i in biometrics)
            {
                if (FingerPrintScanner.VerificationResult(Sample, verify, i.biometrics.ToArray()).Verified)
                {
                    capture.StopCapture();
                    capture.StartCapture();
                    Invoke(new Action(() =>
                    {
                        if (this.Tag != null)
                        {
                            if (i.cn == Convert.ToInt32(this.Tag.ToString()))
                            {
                                SaveDtr();
                                DailyTimeRecordSELECT();

                                new Messaging().sendSms(PhoneNo.Replace("-", ""), lblName.Text + " \n Time: " + DateTime.Now);

                                lblUseFingerprint.Text = "Confirmed.";
                                this.Tag = null;
                            }
                        }
                    }));

                    //Insert DTR
                }
            }
        }
예제 #3
0
        public void OnComplete(object Capture, string ReaderSerialNumber, DPFP.Sample Sample)
        {
            foreach (var i in biometrics)
            {
                if (FingerPrintScanner.VerificationResult(Sample, verify, i.biometrics.ToArray()).Verified)
                {
                    capture.StopCapture();
                    capture.StartCapture();
                    Invoke(new Action(() =>
                    {
                        fmain.fullname = i.fullname;
                        fmain.lbl_current_username.Text = i.fullname;
                        fmain.UserLevel = i.level_cn.ToString();


                        fmain.UserCn = i.cn.ToString();
                        if (fmain.UserLevel != "3")
                        {
                            this.Close();
                            fmain.Text = Tool.Systemname;
                            fmain.buttonSelectection(fmain.pb1);
                            fmain.DailyTimeRecordSELECT();
                            fmain.Show();
                        }
                    }));
                    DataClasses1DataContext db = new DataClasses1DataContext(Tool.ConnectionString);
                    db.sp_insertLog__("Login", fmain.fullname, "Login");
                }
            }
        }
예제 #4
0
 public void OnSampleQuality(object Capture, string ReaderSerialNumber, CaptureFeedback CaptureFeedback)
 {
     if (CaptureFeedback == DPFP.Capture.CaptureFeedback.Good)
     {
         FingerPrintScanner.MakeReport(txtStatus, "The quality of the fingerprint sample is good.");
     }
     else
     {
         FingerPrintScanner.MakeReport(txtStatus, "The quality of the fingerprint sample is poor.");
     }
 }
예제 #5
0
 public void OnComplete(object Capture, string ReaderSerialNumber, DPFP.Sample Sample)
 {
     if (rdleft.Checked)
     {
         FingerPrintScanner.DrawPicture(pic_left, FingerPrintScanner.ConvertSampleToBitmap(Sample));
     }
     else
     {
         FingerPrintScanner.DrawPicture(pic_Right, FingerPrintScanner.ConvertSampleToBitmap(Sample));
     }
 }
예제 #6
0
    public int fpsConnect()
    {
        if (_helper == null)
        {
            _helper = new Helper();
        }

        try
        {
            fpsDisconnect();

            /* Opening the FPS system */
            _fps = new FingerPrintScanner();    /* Object for the FPS system */

/*
 *          int i = _fps.TestPowerState();
 *
 *          if (_fps.TestPowerState() != 0)
 *          {
 *              ErrorMessage = "The power is off";
 *              return -1;
 *          }
 */
            /* Validity check */
            if (!_fps.IsValid())
            {
                ErrorMessage = "Failed to initialize!";
                return(1303);
            }

            /* Connecting to the first device */
            _fps.UseDevice(0, (int)FPS_USAGEMODE.FPS_UMODE_FULL_CONTROL);

            //int i = _fps.TestPowerState();
        }
        catch (gxException e)
        {
            return(_helper.GetErrorMessage(e, out _errorMessage));
        }
        catch (Exception e)
        {
            _errorMessage = e.Message + " --- fpsConnect()";
            return(1305);
        }

        return(0);
    }
예제 #7
0
    public int fpsDisconnect()
    {
        /* Closing the device */
        while (_fps != null)
        {
            try
            {
                _fps.CloseDevice();
                _fps.Dispose();
                _fps = null;

                break;
            }
            catch (Exception)
            {
                //if (gxSystem.GetErrorCode() == (int)GX_ERROR_CODES.GX_EBUSY)
                continue;
            }
        }
        return(0);
    }
예제 #8
0
        public void OnComplete(object Capture, string ReaderSerialNumber, DPFP.Sample Sample)
        {
            FingerPrintScanner.DrawPicture(pic_left, FingerPrintScanner.ConvertSampleToBitmap(Sample));
            try
            {
                FeatureSet feature = FingerPrintScanner.ExtractFeatures(Sample, DataPurpose.Enrollment);
                enroller.AddFeatures(feature);
                FingerPrintScanner.MakeReport(txtStatus, String.Format("Fingerprint samples needed: {0}", enroller.FeaturesNeeded));
                switch (enroller.TemplateStatus)
                {
                case Enrollment.Status.Failed:
                    FingerPrintScanner.MakeReport(txtStatus, String.Format("Fingerprint samples needed: {0}", enroller.FeaturesNeeded));
                    break;

                case Enrollment.Status.Insufficient:
                    break;

                case Enrollment.Status.Ready:
                    FingerPrintScanner.MakeReport(txtStatus, String.Format("Fingerprint samples needed: {0}", enroller.FeaturesNeeded));
                    capture.StopCapture();
                    FingerPrintScanner.MakeTemplate(enroller.Template, this);
                    break;

                case Enrollment.Status.Unknown:
                    FingerPrintScanner.MakeReport(txtStatus, String.Format("Fingerprint samples needed: {0}", enroller.FeaturesNeeded));
                    break;

                default:
                    FingerPrintScanner.MakeReport(txtStatus, String.Format("Fingerprint samples needed: {0}", enroller.FeaturesNeeded));
                    break;
                }
            }
            catch (Exception)
            {
                FingerPrintScanner.MakeReport(txtStatus, String.Format("Fingerprint samples needed: {0}", enroller.FeaturesNeeded));
                capture.StopCapture();
                enroller.Clear();
                capture.StartCapture();
            }
        }
        private async void clickSwitch(Object obj)
        {
            switch (obj.ToString())
            {
            case "limpiar_lesion":
                BotonLesionEnabled    = true;
                TextDescripcionLesion = string.Empty;
                var radioButons = new FingerPrintScanner().FindVisualChildren <RadioButton>(((CertificadoMedicoIngresoView)((ContentControl)Application.Current.Windows[0].FindName("contentControl")).Content)).ToList();
                foreach (var item in radioButons)
                {
                    item.IsChecked = false;
                }
                SelectLesion = null;
                break;

            case "agregar_lesion":
                await StaticSourcesViewModel.CargarDatosMetodoAsync(() =>
                {
                    if (SelectIngreso == null)
                    {
                        Application.Current.Dispatcher.Invoke((Action)(delegate
                        {
                            new Dialogos().ConfirmacionDialogo("Validación", "Favor de seleccionar un ingreso.");
                        }));
                        return;
                    }
                    ;
                    if (string.IsNullOrEmpty(TextDescripcionLesion))
                    {
                        Application.Current.Dispatcher.Invoke((Action)(delegate
                        {
                            new Dialogos().ConfirmacionDialogo("Validación", "Debes ingresar una descripcion de la lesión.");
                        }));
                        return;
                    }
                    if (SelectRegion == null)
                    {
                        Application.Current.Dispatcher.Invoke((Action)(delegate
                        {
                            new Dialogos().ConfirmacionDialogo("Validación", "Debes seleccionar la region donde se encuentra la lesión.");
                        }));
                        return;
                    }
                    ;
                    if (ListLesiones == null)
                    {
                        ListLesiones = new ObservableCollection <LesionesCustom>();
                    }
                    ListLesiones.Add(new LesionesCustom {
                        DESCR = TextDescripcionLesion, REGION = new cAnatomiaTopografica().Obtener((int)SelectRegion)
                    });
                });

                break;

            case "agendar_cita":

                break;

            case "nueva_busqueda":
                NombreBuscar   = ApellidoPaternoBuscar = ApellidoMaternoBuscar = string.Empty;
                FolioBuscar    = AnioBuscar = new int?();
                ListExpediente = new RangeEnabledObservableCollection <IMPUTADO>();
                break;

            case "salir_menu":
                PrincipalViewModel.SalirMenu();
                break;

            case "buscar_visible":
                PopUpsViewModels.ShowPopUp(this, PopUpsViewModels.TipoPopUp.BUSQUEDA);
                break;

            case "buscar_salir":
                PopUpsViewModels.ClosePopUp(PopUpsViewModels.TipoPopUp.BUSQUEDA);
                break;

            case "limpiar_menu":
                ((System.Windows.Controls.ContentControl)PopUpsViewModels.MainWindow.FindName("contentControl")).Content     = new CertificadoMedicoIngresoView();
                ((System.Windows.Controls.ContentControl)PopUpsViewModels.MainWindow.FindName("contentControl")).DataContext = new ControlPenales.CertificadoMedicoIngresoViewModel();
                break;

            case "buscar_menu":
                ListExpediente         = new RangeEnabledObservableCollection <IMPUTADO>();
                SelectExpediente       = new IMPUTADO();
                EmptyExpedienteVisible = true;
                ApellidoPaternoBuscar  = ApellidoMaternoBuscar = NombreBuscar = string.Empty;
                FolioBuscar            = AnioBuscar = null;
                ImagenImputado         = ImagenIngreso = new Imagenes().getImagenPerson();
                PopUpsViewModels.ShowPopUp(this, PopUpsViewModels.TipoPopUp.BUSQUEDA);
                break;

            case "buscar_seleccionar":
                if (SelectIngreso == null)
                {
                    new Dialogos().ConfirmacionDialogo("Validación", "Favor de seleccionar un ingreso");
                    break;
                }
                ;
                if (SelectIngreso.ID_UB_CENTRO != GlobalVar.gCentro)
                {
                    new Dialogos().ConfirmacionDialogo("Validación", "El ingreso seleccionado no pertenece a su centro.");
                    break;
                }
                ;
                var toleranciaTraslado = Parametro.TOLERANCIA_TRASLADO_EDIFICIO;
                if (SelectIngreso.TRASLADO_DETALLE.Any(a => (a.ID_ESTATUS != "CA" ? a.TRASLADO.ORIGEN_TIPO != "F" : false) && a.TRASLADO.TRASLADO_FEC.AddHours(-toleranciaTraslado) <= Fechas.GetFechaDateServer))
                {
                    new Dialogos().ConfirmacionDialogo("Notificación!", "El interno [" + SelectIngreso.ID_ANIO.ToString() + "/" + SelectIngreso.ID_IMPUTADO.ToString() + "] tiene un traslado proximo y no puede recibir visitas.");
                    break;
                }
                ;
                SelectedIngreso = SelectIngreso;
                StaticSourcesViewModel.SourceChanged = false;
                PopUpsViewModels.ClosePopUp(PopUpsViewModels.TipoPopUp.BUSQUEDA);
                //OnBuscarPorHuella();///Inmediatamente que se valida, continua con la siguiente validacion(busqueda por biometria), comentar en caso de pruebas omitiendo biometria
                break;

            case "guardar_menu":
                if (SelectExpediente == null)
                {
                    new Dialogos().ConfirmacionDialogo("Validación", "Debes seleccionar un imputado.");
                    break;
                }
                if (SelectIngreso == null)
                {
                    new Dialogos().ConfirmacionDialogo("Validación", "Debes seleccionar un ingreso valido.");
                    break;
                }


                break;
            }
        }
예제 #10
0
    public int fpsDisconnect()
    {
        /* Closing the device */
        while (_fps != null)
        {
            try
            {
                _fps.CloseDevice();
                _fps.Dispose();
                _fps = null;

                break;
            }
            catch (Exception)
            {
                //if (gxSystem.GetErrorCode() == (int)GX_ERROR_CODES.GX_EBUSY)
                continue;
            }
        }
        return 0;
    }
예제 #11
0
    public int fpsConnect()
    {
        if (_helper == null)
            _helper = new Helper();

        try
        {
            fpsDisconnect();

            /* Opening the FPS system */
            _fps = new FingerPrintScanner();	/* Object for the FPS system */
        /*
            int i = _fps.TestPowerState();

            if (_fps.TestPowerState() != 0)
            {
                ErrorMessage = "The power is off";
                return -1;
            }
        */
            /* Validity check */
            if (!_fps.IsValid())
            {
                ErrorMessage = "Failed to initialize!";
                return 1303;
            }

            /* Connecting to the first device */
            _fps.UseDevice(0, (int)FPS_USAGEMODE.FPS_UMODE_FULL_CONTROL);

            //int i = _fps.TestPowerState();

        }
        catch (gxException e)
        {
            return _helper.GetErrorMessage(e, out _errorMessage);
        }
        catch (Exception e)
        {
            _errorMessage = e.Message + " --- fpsConnect()";
            return 1305;
        }

        return 0;
    }
예제 #12
0
 public void OnReaderDisconnect(object Capture, string ReaderSerialNumber)
 {
     FingerPrintScanner.MakeReport(txtStatus, "Reader Disconnected");
 }
예제 #13
0
 public void OnFingerTouch(object Capture, string ReaderSerialNumber)
 {
     FingerPrintScanner.MakeReport(txtStatus, "Finger Touch");
 }