private async void Aceptar(BuscarNUCView Window)
        {
            AceptarEnabled = false;
            if (ScannerMessage.Contains("Procesando..."))
            {
                AceptarEnabled = true;
                return;
            }

            if (SelectedInterconexion != null)
            {
                if (SelectRegistro != null)
                {
                    Imputado = SelectRegistro.Imputado;
                }
                MediaFiliacion();
                _IsSucceed          = true;
                CancelKeepSearching = true;
                isKeepSearching     = true;
                if (SelectRegistro != null)
                {
                    await WaitForFingerPrints();
                }
                Window.Close();
            }
            else
            {
                mensajeAlerta("Validación", "Favor de seleccionar un NUC.");
            }
            AceptarEnabled = true;
        }
        public override void OnCaptured(DPUruNet.CaptureResult captureResult)
        {
            if (ScannerMessage.Contains("Procesando..."))
            {
                return;
            }

            ShowLoadingCustodio = Visibility.Visible;
            ShowLinea           = Visibility.Visible;
            CapturarShow        = Visibility.Collapsed;

            Application.Current.Dispatcher.Invoke((System.Action)(delegate
            {
                ShowLinea      = Visibility.Visible;
                ScannerMessage = "Procesando...";
                ColorMensaje   = new SolidColorBrush(System.Windows.Media.Color.FromRgb(51, 115, 242));
            }));
            base.OnCaptured(captureResult);

            switch (Buscar)
            {
            case enumTipoPersona.PERSONA_EMPLEADO:
                CompararHuellaCustodio();
                break;

            default:
                break;
            }
            GuardandoHuellas    = true;
            ShowLoadingCustodio = Visibility.Collapsed;
            CapturarShow        = Conect ? Visibility.Visible : Visibility.Collapsed;
            ShowLinea           = Visibility.Collapsed;
        }
        public override void OnCaptured(DPUruNet.CaptureResult captureResult)
        {
            if (ScannerMessage.Contains("Procesando..."))
            {
                return;
            }

            ShowLoading  = Visibility.Visible;
            ShowLine     = Visibility.Visible;
            ShowCapturar = Visibility.Collapsed;

            Application.Current.Dispatcher.Invoke((System.Action)(delegate
            {
                ShowLine       = Visibility.Visible;
                ScannerMessage = "Procesando...";
                ColorMessage   = new SolidColorBrush(System.Windows.Media.Color.FromRgb(51, 115, 242));
            }));


            base.OnCaptured(captureResult);

            ListResultado = null;

            CompareImputado();

            GuardandoHuellas = true;
            ShowLoading      = Visibility.Collapsed;
            ShowCapturar     = Conectado ? Visibility.Visible : Visibility.Collapsed;
            ShowLine         = Visibility.Collapsed;
        }
Esempio n. 4
0
        public async override void OnCaptured(DPUruNet.CaptureResult captureResult)
        {
            try
            {
                if (ScannerMessage.Contains("Procesando..."))
                {
                    return;
                }

                Application.Current.Dispatcher.Invoke((System.Action)(delegate
                {
                    TextNipBusqueda = string.Empty;
                    PropertyImage   = new BitmapImage();
                    ShowLoading     = Visibility.Visible;
                    //ShowLine = Visibility.Visible;
                    ShowCapturar   = Visibility.Collapsed;
                    ShowLine       = Visibility.Visible;
                    ScannerMessage = "Procesando...";
                    ColorMessage   = new SolidColorBrush(System.Windows.Media.Color.FromRgb(51, 115, 242));
                }));

                //await TaskEx.Delay(500);


                Application.Current.Dispatcher.Invoke((Action)(delegate
                {
                    base.OnCaptured(captureResult);
                }));
                ListResultado = null;

                switch (BuscarPor)
                {
                case enumTipoPersona.IMPUTADO:
                    CompareImputado();
                    break;

                case enumTipoPersona.PERSONA_TODOS:
                case enumTipoPersona.PERSONA_VISITA:
                case enumTipoPersona.PERSONA_ABOGADO:
                case enumTipoPersona.PERSONA_EMPLEADO:
                case enumTipoPersona.PERSONA_EXTERNA:
                    //ComparePersona();
                    break;

                default:
                    break;
                }

                GuardandoHuellas = true;
                ShowLoading      = Visibility.Collapsed;
                ShowCapturar     = Conectado ? Visibility.Visible : Visibility.Collapsed;
                ShowLine         = Visibility.Collapsed;
            }
            catch (Exception ex)
            {
                StaticSourcesViewModel.ShowMessageError("Algo pasó...", "Ocurrió un error al realizar la busqueda por huella.", ex);
            }
        }
        private void Aceptar(Window Window)
        {
            if (ScannerMessage.Contains("Procesando..."))
            {
                return;
            }

            IsSucceded = true;
            Window.Close();
        }
Esempio n. 6
0
        private async void Aceptar(Window Window)
        {
            if (ScannerMessage.Contains("Procesando..."))
            {
                return;
            }
            CancelKeepSearching = true;
            isKeepSearching     = true;
            await WaitForFingerPrints();

            _IsSucceed = true;
            Window.Close();
        }
Esempio n. 7
0
        public void UpdateUI(ScannerMessage scannMessage)
        {
            DataGridView grid = (DataGridView)uiControl;

            rowCounter++;

            grid.Rows.Add();
            grid[RANK_IDX, rowCounter].Value       = scannMessage.Rank;
            grid[CONTRACT_IDX, rowCounter].Value   = Utils.ContractToString(scannMessage.ContractDetails.Contract);
            grid[DISTANCE_IDX, rowCounter].Value   = scannMessage.Distance;
            grid[BENCHMARK_IDX, rowCounter].Value  = scannMessage.Benchmark;
            grid[PROJECTION_IDX, rowCounter].Value = scannMessage.Projection;
            grid[LEGS_IDX, rowCounter].Value       = scannMessage.LegsStr;
        }
Esempio n. 8
0
        public override void OnCaptured(DPUruNet.CaptureResult captureResult)
        {
            if (ScannerMessage.Contains("Procesando..."))
            {
                return;
            }

            ShowLoading  = Visibility.Visible;
            ShowLine     = Visibility.Visible;
            ShowCapturar = Visibility.Collapsed;

            Application.Current.Dispatcher.Invoke((System.Action)(delegate
            {
                ShowLine       = Visibility.Visible;
                ScannerMessage = "Procesando...";
                ColorMessage   = new SolidColorBrush(System.Windows.Media.Color.FromRgb(51, 115, 242));
            }));


            base.OnCaptured(captureResult);

            ListResultado = null;

            switch (BuscarPor)
            {
            case enumTipoPersona.IMPUTADO:
                CompareImputado();
                break;

            case enumTipoPersona.PERSONA_TODOS:
            case enumTipoPersona.PERSONA_VISITA:
            case enumTipoPersona.PERSONA_ABOGADO:
            case enumTipoPersona.PERSONA_EMPLEADO:
            case enumTipoPersona.PERSONA_EXTERNA:
                ComparePersona();
                break;

            default:
                break;
            }

            GuardandoHuellas = true;
            ShowLoading      = Visibility.Collapsed;
            ShowCapturar     = Conectado ? Visibility.Visible : Visibility.Collapsed;
            ShowLine         = Visibility.Collapsed;
        }
 public override void UpdateUI(IBMessage message)
 {
     if (message.Type == MessageType.ScannerParameters)
     {
         ScannerParametersMessage scanParamsMessage = (ScannerParametersMessage)message;
         parametersOutput.Text = scanParamsMessage.XmlData;
     }
     else
     {
         ScannerMessage scannMessage = (ScannerMessage)message;
         DataGridView   grid         = (DataGridView)uiControl;
         rowCounter++;
         grid.Rows.Add();
         grid[RANK_IDX, rowCounter].Value       = scannMessage.Rank;
         grid[CONTRACT_IDX, rowCounter].Value   = Utils.ContractToString(scannMessage.ContractDetails.Summary);
         grid[DISTANCE_IDX, rowCounter].Value   = scannMessage.Distance;
         grid[BENCHMARK_IDX, rowCounter].Value  = scannMessage.Benchmark;
         grid[PROJECTION_IDX, rowCounter].Value = scannMessage.Projection;
         grid[LEGS_IDX, rowCounter].Value       = scannMessage.LegsStr;
     }
 }
Esempio n. 10
0
        private void HandleScan(string message)
        {
            ScannerMessage scannerMessage = JsonConvert.DeserializeObject <ScannerMessage>(message);

            Console.WriteLine("do something with ScannerMessage attributes:" + scannerMessage.Text);
        }
Esempio n. 11
0
        private void HandleScan(string message)
        {
            ScannerMessage    scannerMessage = JsonConvert.DeserializeObject <ScannerMessage>(message);
            Publisher         publisher      = new Publisher(channel); // to send response back.
            List <ProductDTO> products       = productsFacade.GetAll();
            ProductDTO        product        = products.Find(p => p.Sku.Equals(scannerMessage.Barcode, StringComparison.InvariantCultureIgnoreCase));

            if (product != null)
            {
                scannerMessage.ProductName  = product.Name;
                scannerMessage.ProductPrice = product.Price;
                int totalStock = 0;
                foreach (StockDTO s in stocksFacade.GetAll().FindAll(s => s.ProductId == product.Id))
                {
                    totalStock += s.Amount;
                }
                scannerMessage.ProductStock = totalStock;
                // is there a stock with the same date?
                StockDTO stock = stocksFacade.GetAll().Find(s => s.ProductId == product.Id && s.Date.Year == DateTime.Now.Year && s.Date.Month == DateTime.Now.Month &&
                                                            s.Date.Day == DateTime.Now.Day);
                if (stock != null)
                {
                    stock.Amount += 1; // add 1
                    //product.Stocks.Find(s => s.Id == stock.Id).Amount += 1;
                    product.Stocks.Clear();
                    stocksFacade.Modify(stock);
                    productsFacade.Modify(product);
                    scannerMessage.ProductStock += 1;
                    stock.Date = DateTime.Now; // adjust time to now to reflect change.
                    if (true)
                    {
                        // send message back
                        scannerMessage.ScannerResult = ScannerResult.AddedToStock; // indicate success
                        publisher.Publish(Environment.GetEnvironmentVariable("SCANNER_RESPONSE_EXCHANGE"),
                                          JsonConvert.SerializeObject(scannerMessage));
                    }
                    else
                    {
                        // send message back
                        scannerMessage.ScannerResult = ScannerResult.UnknownError; // indicate unknown error
                        publisher.Publish(Environment.GetEnvironmentVariable("SCANNER_RESPONSE_EXCHANGE"),
                                          JsonConvert.SerializeObject(scannerMessage));
                    }
                }
                else
                {
                    // create new stock
                    StockDTO stockDTO = new StockDTO();
                    stockDTO.Amount              = 1;
                    scannerMessage.ProductStock += 1;
                    stockDTO.Date      = DateTime.Now;
                    stockDTO.Product   = product;
                    stockDTO.ProductId = product.Id;
                    stockDTO           = stocksFacade.Add(stockDTO);
                    product.Stocks.Add(stockDTO);
                    productsFacade.Modify(product); // needed to update product in memory cache with stock.

                    if (stockDTO.Id > 0)
                    {
                        // send message back
                        scannerMessage.ScannerResult = ScannerResult.AddedToStock; // indicate success
                        publisher.Publish(Environment.GetEnvironmentVariable("SCANNER_RESPONSE_EXCHANGE"),
                                          JsonConvert.SerializeObject(scannerMessage));
                    }
                    else
                    {
                        // send message back
                        scannerMessage.ScannerResult = ScannerResult.UnknownError; // indicate unknown error
                        publisher.Publish(Environment.GetEnvironmentVariable("SCANNER_RESPONSE_EXCHANGE"),
                                          JsonConvert.SerializeObject(scannerMessage));
                    }
                }
            }
            else
            {                                                            // product not found, send message back
                scannerMessage.ScannerResult = ScannerResult.UnknownSku; // indicate unknown error
                publisher.Publish(Environment.GetEnvironmentVariable("SCANNER_RESPONSE_EXCHANGE"),
                                  JsonConvert.SerializeObject(scannerMessage));
            }

            //Console.WriteLine("do something with ScannerMessage attributes:" + scannerMessage.Barcode);
        }
Esempio n. 12
0
        private async void Aceptar(Window Window)
        {
            try
            {
                if (ScannerMessage.Contains("Procesando..."))
                {
                    return;
                }
                CancelKeepSearching = true;
                isKeepSearching     = true;
                await WaitForFingerPrints();

                _IsSucceed = true;
                await StaticSourcesViewModel.CargarDatosMetodoAsync(() =>
                {
                    try
                    {
                        if (SelectRegistro == null)
                        {
                            return;
                        }
                        SelectExpediente = SelectRegistro.Imputado;
                        if (SelectExpediente.INGRESO.Count == 0)
                        {
                            SelectExpediente = null;
                            SelectIngreso    = null;
                            ImagenImputado   = ImagenIngreso = new Imagenes().getImagenPerson();
                            PopUpsViewModels.ShowPopUp(this, PopUpsViewModels.TipoPopUp.BUSQUEDA);
                        }
                        if (Parametro.ESTATUS_ADMINISTRATIVO_INACT.Any(a => a.HasValue ? a.Value == SelectExpediente.INGRESO.OrderByDescending(o => o.ID_INGRESO).FirstOrDefault().ID_ESTATUS_ADMINISTRATIVO : false))
                        {
                            Application.Current.Dispatcher.Invoke((Action)(delegate
                            {
                                new Dialogos().ConfirmacionDialogo("Notificación!", "No se encontró ningun ingreso activo en este imputado.");
                            }));
                            return;
                        }

                        if (SelectExpediente.INGRESO.OrderByDescending(o => o.ID_INGRESO).FirstOrDefault().ID_UB_CENTRO.HasValue ?
                            SelectExpediente.INGRESO.OrderByDescending(o => o.ID_INGRESO).FirstOrDefault().ID_UB_CENTRO != GlobalVar.gCentro : false)
                        {
                            SelectExpediente = null;
                            SelectIngreso    = null;
                            ImagenImputado   = ImagenIngreso = new Imagenes().getImagenPerson();
                            PopUpsViewModels.ShowPopUp(this, PopUpsViewModels.TipoPopUp.BUSQUEDA);
                            Application.Current.Dispatcher.Invoke((Action)(delegate
                            {
                                new Dialogos().ConfirmacionDialogo("Validación", "El ingreso seleccionado no pertenece a su centro.");
                            }));
                            return;
                        }
                        SelectIngreso          = SelectExpediente.INGRESO.OrderByDescending(o => o.ID_INGRESO).FirstOrDefault();
                        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).TimeOfDay <= Fechas.GetFechaDateServer.TimeOfDay))
                        {
                            new Dialogos().ConfirmacionDialogo("Notificación!", "El interno [" + SelectIngreso.ID_ANIO.ToString() + "/" +
                                                               SelectIngreso.ID_IMPUTADO.ToString() + "] tiene un traslado proximo y no puede recibir visitas.");
                            return;
                        }

                        GetDatosImputadoSeleccionado();
                    }
                    catch (Exception ex)
                    {
                        StaticSourcesViewModel.ShowMessageError("Algo pasó...", "Ocurrió un error al cargar los datos del imputado seleccionado.", ex);
                    }
                });
            }
            catch (Exception ex)
            {
                StaticSourcesViewModel.ShowMessageError("Algo pasó...", "Ocurrió un error al cargar los datos del imputado seleccionado.", ex);
            }
        }