Exemplo n.º 1
0
        private async void BtnAbrir_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                if (lblCorte.Content.ToString() != string.Empty && lblEstilo.Content.ToString() != string.Empty)
                {
                    var resp = await CodigosNeg.crearCaja(lblEstilo.Content.ToString(), lblCorte.Content.ToString(), usuario);

                    lblbox.Content = resp.codigoBox.Trim();
                    // idbox = resp.;

                    lblUnidadesCaja.Content = 0;
                    cont = 0;
                    lblCodigoScan.Content = string.Empty;

                    txtcodigo.Text      = string.Empty;
                    txtcodigo.IsEnabled = true;
                    txtcodigo.Focus();
                    txtunidadesScan.Text = string.Empty;

                    lblstatus.Content = "Esperando Lectura de Escanner";

                    lblestadobox.Content = "Pendiente";

                    var total = PorderNeg.Totales(lblCorte.Content.ToString().Trim());

                    lblTotalcajas.Content      = total.Count().ToString();
                    lblTotalEmpaquadas.Content = total.Sum(x => x.unidades);
                }
            }
            catch (Exception ex)
            {
                string r = ex.Message;
            }
        }
Exemplo n.º 2
0
        //listo
        private void txtcorte_TextChanged(object sender, TextChangedEventArgs e)
        {
            var corte = txtcorte.Text;

            if (txtcorte.Text.Count() > 2)
            {
                lista = PorderNeg.GetPordersClienteGeneradosAutocompletado(corte);

                List <string> listas = new List <string>();

                foreach (var item in lista)
                {
                    listas.Add(item.POrder.TrimEnd());
                }

                if (lista.Count > 0)
                {
                    if (lblCondicional.Content.ToString() == "NoSelect")
                    {
                        lblsugestion.ItemsSource = listas;
                        lblsugestion.Visibility  = Visibility.Visible;
                    }
                }
                else if (txtcorte.Text == "")
                {
                    lblsugestion.ItemsSource = null;
                    lblsugestion.Visibility  = Visibility.Collapsed;
                }
                else
                {
                    lblsugestion.ItemsSource = null;
                    lblsugestion.Visibility  = Visibility.Collapsed;
                }
            }
        }
Exemplo n.º 3
0
        private void txtboxscan_KeyUp(object sender, KeyEventArgs e)
        {
            try
            {
                if (e.Key == Key.Enter)
                {
                    limpiarTodo();

                    var box = txtboxscan.Text.Trim().ToLower();

                    var resp = CodigosNeg.BuscarCaja(box);

                    if (resp == null)
                    {
                        MessageBox.Show("El codigo no existe", "Advertencia");
                    }
                    else
                    {
                        cont = (int)resp.totalencaja;

                        lblUnidadesCaja.Content = cont;
                        lblbox.Content          = resp.codigoBox.TrimEnd();

                        lblCorte.Content  = resp.corteCompleto.TrimEnd();
                        lblCorteT.Content = resp.corteCompleto.TrimEnd();

                        lblEstilo.Content  = resp.estilo.TrimEnd();
                        lblEstiloT.Content = resp.estilo.TrimEnd();

                        lblunidades.Content  = resp.Quantity;
                        lblestadobox.Content = resp.clasificacion;//.Trim()==string.Empty?"Pendiente":resp.clasificacion.TrimEnd();
                        idbox = resp.id;

                        txtboxscan.Clear();
                        txtcodigo.Clear();
                        txtcodigo.IsEnabled = true;
                        txtcodigo.Focus();
                        txtcorte.Clear();

                        // idporder = resp.Id_Order;

                        var total = PorderNeg.TotalesLeft(resp.corteCompleto);

                        lblTotalcajas.Content      = (total.Count() - 1).ToString();
                        lblTotalEmpaquadas.Content = total.Sum(x => x.unidades);

                        lblsugestion.Visibility = Visibility.Collapsed;
                        lblCondicional.Content  = "Select";
                    }
                }
            }
            catch (Exception)
            {
                throw;
            }
        }
Exemplo n.º 4
0
        private void lblsugestion_KeyUp(object sender, KeyEventArgs e)
        {
            if (e.Key == Key.Enter)
            {
                if (lblsugestion.ItemsSource != null)
                {
                    lblsugestion.Visibility = Visibility.Collapsed;

                    if (lblsugestion.SelectedIndex != -1)
                    {
                        lblCondicional.Content = "Select";
                        txtcorte.Text          = lblsugestion.SelectedItem.ToString();

                        var obj = lista.FirstOrDefault(x => x.POrder.Trim().Equals(txtcorte.Text));
                        //idporder = obj.Id_Order;
                        lblCorte.Content    = obj.POrder;
                        lblEstilo.Content   = obj.style;
                        lblunidades.Content = obj.Quantity;
                        lblCorteT.Content   = obj.POrder;
                        lblEstiloT.Content  = obj.style;

                        txtcorte.Text = string.Empty;

                        lblstatus.Content = "Crear Caja Para Iniciar Escaneo";

                        if (!string.IsNullOrEmpty(obj.POrder))
                        {
                            //totales por porder
                            var total = PorderNeg.Totales(obj.POrder);

                            lblTotalcajas.Content      = total.Count().ToString();
                            lblTotalEmpaquadas.Content = total.Sum(x => x.unidades);
                        }

                        band = true;
                    }

                    txtcorte.TextChanged += new TextChangedEventHandler(txtcorte_TextChanged);
                }
            }
            else if (e.Key == Key.Up)
            {
                band = false;

                var item = lblsugestion.SelectedIndex;

                if (item == 0)
                {
                    txtcorte.Focus();
                }
            }
        }
Exemplo n.º 5
0
        async Task getinfo(string codigoBarra)
        {
            // PorderNeg.GetPordersClienteGeneradosAutocompletadoCodigoBarra(codigoBarra);
            var obj = PorderNeg.GetPordersClienteGeneradosAutocompletadoCodigoBarra(codigoBarra);

            //idporder = obj.Id_Order;
            lblCorte.Content    = obj.POrder;
            lblEstilo.Content   = obj.style;
            lblunidades.Content = obj.Quantity;
            lblCorteT.Content   = obj.POrder;
            lblEstiloT.Content  = obj.style;

            txtcorte.Text = string.Empty;

            //            lblstatus.Content = "Crear Caja Para Iniciar Escaneo";

            if (!string.IsNullOrEmpty(obj.POrder))
            {
                //totales por porder
                var total = PorderNeg.Totales(obj.POrder);

                lblTotalcajas.Content      = total.Count().ToString();
                lblTotalEmpaquadas.Content = total.Sum(x => x.unidades);


                var resp = await CodigosNeg.crearCaja(lblEstilo.Content.ToString(), lblCorte.Content.ToString(), usuario);

                lblbox.Content = resp.codigoBox.Trim();
                // idbox = resp.;

                lblUnidadesCaja.Content = 0;
                cont = 0;
                //  lblCodigoScan.Content = string.Empty;

                //  txtcodigo.Text = string.Empty;
                //  txtcodigo.IsEnabled = true;
                // txtcodigo.Focus();
                txtunidadesScan.Text = string.Empty;

                // lblstatus.Content = "Esperando Lectura de Escanner";

                lblestadobox.Content = "Pendiente";

                // var total = PorderNeg.Totales(lblCorte.Content.ToString().Trim());

                //  lblTotalcajas.Content = total.Count().ToString();
                //  lblTotalEmpaquadas.Content = total.Sum(x => x.unidades);
            }
        }
Exemplo n.º 6
0
        private void lblsugestion_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            try
            {
                if (lblsugestion.ItemsSource != null && band)
                {
                    lblsugestion.Visibility = Visibility.Collapsed;

                    txtcorte.TextChanged -= new TextChangedEventHandler(txtcorte_TextChanged);

                    if (lblsugestion.SelectedIndex != -1)
                    {
                        lblCondicional.Content = "Select";
                        txtcorte.Text          = lblsugestion.SelectedItem.ToString();

                        var obj = lista.FirstOrDefault(x => x.POrder.Equals(txtcorte.Text));
                        // idporder = obj.Id_Order;
                        lblCorte.Content    = obj.POrder;
                        lblEstilo.Content   = obj.style;
                        lblunidades.Content = obj.Quantity;
                        lblCorteT.Content   = obj.POrder;
                        lblEstiloT.Content  = obj.style;
                        lblstatus.Content   = "Crear Caja Para Iniciar Escaneo";
                        txtcorte.Text       = string.Empty;
                        if (!string.IsNullOrEmpty(obj.POrder))
                        {
                            var total = PorderNeg.Totales(obj.POrder);

                            lblTotalcajas.Content      = total.Count().ToString();
                            lblTotalEmpaquadas.Content = total.Sum(x => x.unidades);
                        }
                    }

                    txtcorte.TextChanged += new TextChangedEventHandler(txtcorte_TextChanged);
                }
            }
            catch (Exception)
            {
                throw;
            }
        }
Exemplo n.º 7
0
        private void BtnBuscar_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                if (lblsugestion.ItemsSource != null && band)
                {
                    lblsugestion.Visibility = Visibility.Collapsed;

                    // txtcorte.TextChanged -= new TextChangedEventHandler(txtcorte_TextChanged);

                    if (lblsugestion.SelectedIndex != -1)
                    {
                        lblCondicional.Content = "Select";
                        txtcorte.Text          = lblsugestion.SelectedItem.ToString();

                        var obj = lista.FirstOrDefault(x => x.POrder.Trim().Equals(txtcorte.Text));
                        idporder            = Convert.ToInt32(obj.Id_Order);
                        lblCorte.Content    = obj.POrder;
                        lblEstilo.Content   = obj.style;
                        lblunidades.Content = obj.Quantity;
                        lblCorteT.Content   = obj.POrder;
                        lblEstiloT.Content  = obj.style;

                        if (idporder != 0)
                        {
                            var total = PorderNeg.Totales(idporder);

                            lblTotalcajas.Content      = total.Count().ToString();
                            lblTotalEmpaquadas.Content = total.Sum(x => x.unidades);
                        }
                    }

                    txtcorte.TextChanged += new TextChangedEventHandler(txtcorte_TextChanged);
                }
            }
            catch (Exception)
            {
                throw;
            }
        }
Exemplo n.º 8
0
        private void BtnCerrar_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                var clasificacion = comboclasificacion.SelectedItem.ToString();

                if ((!lblbox.Content.ToString().Equals(string.Empty)) && string.Compare(clasificacion, "Seleccione...") != 0)
                {
                    var resp = CodigosNeg.imprimirBox2(lblbox.Content.ToString().Trim(), usuario, clasificacion.ToUpper());

                    Barcode b = new Barcode();

                    b.IncludeLabel  = true;
                    b.Alignment     = AlignmentPositions.CENTER;
                    b.LabelFont     = new Font(System.Drawing.FontFamily.GenericMonospace, 20 * Barcode.DotsPerPointAt96Dpi, System.Drawing.FontStyle.Regular, GraphicsUnit.Pixel);
                    b.LabelPosition = LabelPositions.BOTTOMCENTER;

                    var img = b.Encode(TYPE.CODE128, resp.codigoBox.Trim(), System.Drawing.Color.Black, System.Drawing.Color.White, 290, 90);

                    List <resultBox> T = new List <resultBox>();

                    using (MemoryStream ms = new MemoryStream())
                    {
                        img.Save(ms, ImageFormat.Png);

                        var objnewImg = new resultBox
                        {
                            codigoBox  = resp.codigoBox.Trim(),
                            color      = resp.color,
                            corte      = resp.corte,
                            corteguion = resp.corte,
                            estado     = resp.estado,
                            estilo     = resp.estilo,
                            tallas     = resp.tallas,
                            unidades   = resp.unidades,
                            Img        = ms.ToArray()
                        };

                        T.Add(objnewImg);

                        ms.Dispose();
                    }


                    List <object> arg = new List <object>();
                    arg.Add(T);

                    //  Thread tarea = new Thread(new ParameterizedThreadStart(mensajeVoz));
                    //  tarea.Start("Iniciando Proceso de impresión");

                    _worker.RunWorkerAsync(arg);

                    var total = PorderNeg.Totales(resp.corte);

                    InicioEscaneo = false;
                    codigoEscaneo = string.Empty;

                    lblTotalcajas.Content      = total.Count().ToString();
                    lblTotalEmpaquadas.Content = total.Sum(x => x.unidades);

                    limpiarDespuesDImprimir();
                }
                else
                {
                    lblstatus.Content = "";

                    MessageBox.Show("Campos vacíos");
                    //  Thread tarea = new Thread(new ParameterizedThreadStart(mensaje));
                    //  tarea.Start("Campos vacíos");
                }
            }
            catch (Exception)
            {
                MessageBox.Show("No es posible realizar el comando");
            }
        }
Exemplo n.º 9
0
        private void BtnBuscarBox_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                limpiarTodo();

                var box = txtboxscan.Text.Trim().ToLower();

                var resp = CodigosNeg.BuscarCaja2(box);

                if (resp == null)
                {
                    MessageBox.Show("El codigo no existe", "Advertencia");
                }
                else
                {
                    var resp2 = CodigosNeg.GetcodigoBarraXcodBox(box);

                    if (resp2.Equals("error"))
                    {
                        MessageBox.Show("El codigo no contiene datos", "Advertencia");
                    }
                    else
                    {
                        codigoEscaneo = resp2;

                        cont = (int)resp.totalencaja;

                        lblUnidadesCaja.Content = cont;
                        lblbox.Content          = resp.codigoBox.TrimEnd();

                        lblCorte.Content  = resp.corteCompleto.TrimEnd();
                        lblCorteT.Content = resp.corteCompleto.TrimEnd();

                        lblEstilo.Content  = resp.estilo.TrimEnd();
                        lblEstiloT.Content = resp.estilo.TrimEnd();

                        lblunidades.Content = resp.Quantity;
                        // lblestadobox.Content = resp.clasificacion;
                        lblestadobox.Content = resp.clasificacion;// == string.Empty ? "Pendiente" : resp.clasificacion.TrimEnd();
                        idbox = resp.id;

                        txtboxscan.Clear();
                        txtcodigo.Clear();
                        txtcodigo.IsEnabled = true;
                        txtcodigo.Focus();
                        txtcorte.Clear();

                        InicioEscaneo = true;

                        //idporder = resp.Id_Order;

                        var total = PorderNeg.TotalesLeft(resp.corteCompleto);

                        lblTotalcajas.Content      = (total.Count() - 1).ToString();
                        lblTotalEmpaquadas.Content = total.Sum(x => x.unidades);

                        lblsugestion.Visibility = Visibility.Collapsed;
                        lblCondicional.Content  = "Select";

                        lblstatus.Content = "Esperando Lectura de Escanner";
                    }
                }
            }
            catch (Exception)
            {
                throw;
            }
        }