private void inOp_KeyUp(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter) { btnFinish.Enabled = false; inCantidad.Enabled = false; currentOp = new OPInfoMapper(); detailOp.Text = ""; try { ControlDePlacasService api = new ControlDePlacasService(); api.OPInfoApi(inOp.Text.ToString()); if (api.hasResponse) { if (api.opinfo.error == null) { #region OP INFO if (api.opinfo.smt != null) { // Carga modelo lote panel y op en palet detailOp.Text = string.Concat( "OP: ", api.opinfo.smt.op, System.Environment.NewLine, "Modelo: ", api.opinfo.smt.modelo, System.Environment.NewLine, "Lote: ", api.opinfo.smt.lote, System.Environment.NewLine, "Panel: ", api.opinfo.smt.panel, System.Environment.NewLine, "Semielaborado: ", api.opinfo.wip.wip_ot.codigo_producto); btnFinish.Enabled = true; inCantidad.Enabled = true; currentOp = api.opinfo; } else { btnFinish.Enabled = false; inCantidad.Enabled = false; currentOp = new OPInfoMapper(); detailOp.Text = "No fue posible obtener datos de OP"; } #endregion } else { detailOp.Text = "Error: " + api.opinfo.error; } } else { detailOp.Text = "Error: " + api.exception; } } catch (Exception ex) { MessageBox.Show(ex.Message); } } }