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; } }
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(); } } }
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); } }
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; } }
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; } }
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"); } }