コード例 #1
0
        private void btTerminar_Click(object sender, EventArgs e)
        {
            try
            {
                if (this.iCodCarro != -1)
                {
                    MessageBox.Show("Carro abierto todavia", "SCPP", MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1);

                    this.txEtiqueta.Text = String.Empty;
                    this.txEtiqueta.Focus();
                }
                else
                {
                    // No se envian los datos aqui, sino hasta 'Configuracion Inicial' - Proceso 'Vaciado' - Opcion 'Enviar datos al servidor'.
                    //this.EnviarDatosAlServidor();

                    //Regresar a Configuracion Inicial.
                    a03_ConfiguracionInicial frmObj = new a03_ConfiguracionInicial(this.lu);
                    frmObj.Show();
                    this.Close();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1);
            }
        }
コード例 #2
0
        private void btRegresar_Click(object sender, EventArgs e)
        {
            a03_ConfiguracionInicial frmObj = new a03_ConfiguracionInicial(this.lu);

            frmObj.Show();
            this.Close();
        }
コード例 #3
0
 private void btCancelar_Click(object sender, EventArgs e)
 {
     try
     {
         DialogResult dr = MessageBox.Show("¿Cancelar Captura de Hornos?", "SCPP", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2);
         if (dr == DialogResult.Yes)
         {
             if ((this.lu.CodPlanta == 1 || this.lu.CodPlanta == 2 || this.lu.CodPlanta == 3))
             {
                 this.lu.CodCarro = -1;
             }
             // Regresar a Configuracion Inicial.
             a03_ConfiguracionInicial frmObj = new a03_ConfiguracionInicial(this.lu);
             frmObj.Show();
             this.Close();
         }
         else
         {
             //this.txZona.Text = string.Empty;
             this.txEtiqueta.SelectAll();
             this.txEtiqueta.Focus();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1);
     }
 }
コード例 #4
0
        private void btProcesar_Click(object sender, EventArgs e)
        {
            try
            {
                if (this.ObtenerPiezasCapturadas() == this.iNumPiezasACapturar)
                {
                    MessageBox.Show("Banco Terminado!", "SCPP", MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1);
                }
                else
                {
                    DialogResult dr = MessageBox.Show("Aún hay pendientes, ¿deseas terminar?", "SCPP", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2);
                    if (dr == DialogResult.No)
                    {
                        return;
                    }
                }

                // Insertar las Piezas.
                this.InsertarPiezas();

                // No se envian los datos aqui, sino hasta 'Configuracion Inicial' - Proceso 'Vaciado' - Opcion 'Enviar datos al servidor'.
                //this.EnviarDatosAlServidor();

                // Regresar a Configuracion Inicial.
                a03_ConfiguracionInicial frmObj = new a03_ConfiguracionInicial(this.lu);
                frmObj.Show();
                this.Close();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1);
            }
        }
コード例 #5
0
        private void btCancelar_Click(object sender, EventArgs e)
        {
            try
            {
                DialogResult dr = MessageBox.Show("¿Cancelar Captura inicial?", "SCPP", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2);
                if (dr == DialogResult.Yes)
                {
                    // Obtener Supervisor por defecto.
                    this.lu.CodSupervisor = this.iCodSupervisor;

                    //Regresar a Configuracion Inicial.
                    a03_ConfiguracionInicial frmObj = new a03_ConfiguracionInicial(this.lu);
                    frmObj.Show();
                    this.Close();
                }
                else
                {
                    this.txSupervisor.SelectAll();
                    this.txSupervisor.Focus();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1);
            }
        }
コード例 #6
0
        private void btCancelar_Click(object sender, EventArgs e)
        {
            try
            {
                DialogResult dr = MessageBox.Show("¿Cancelar Captura de Vaciado?", "SCPP", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2);
                if (dr == DialogResult.Yes)
                {
                    // Eliminar registros creados por la Captura de Defectos.
                    this.EliminarRegistros();

                    // Regresar a Configuracion Inicial.
                    a03_ConfiguracionInicial frmObj = new a03_ConfiguracionInicial(this.lu);
                    frmObj.Show();
                    this.Close();
                }
                else
                {
                    this.txEtiqueta.Text = string.Empty;
                    this.txEtiqueta.Focus();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1);
            }
        }
コード例 #7
0
        private void btnCancelar_Click(object sender, EventArgs e)
        {
            DialogResult dr = MessageBox.Show("¿Salir del Vaciado?", "SCPP", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2);

            if (dr == DialogResult.Yes)
            {
                a03_ConfiguracionInicial oconfig = new a03_ConfiguracionInicial(this.lu);
                oconfig.Show();
                this.Close();
            }
        }
コード例 #8
0
        private void btnMenu_Click(object sender, EventArgs e)
        {
            btCancelar_Click(null, null);

            //Regresar a Configuracion Inicial.
            if (this.iCodTarima == -1)
            {
                a03_ConfiguracionInicial frmObj = new a03_ConfiguracionInicial(this.lu);
                frmObj.Show();
                this.Close();
            }
        }
コード例 #9
0
 private void btTerminar_Click(object sender, EventArgs e)
 {
     try
     {
         //Regresar a Configuracion Inicial.
         a03_ConfiguracionInicial frmObj = new a03_ConfiguracionInicial(this.lu);
         frmObj.Show();
         this.Close();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1);
     }
 }
コード例 #10
0
 private void tbxModelo_KeyPress(object sender, KeyPressEventArgs e)
 {
     try
     {
         if (e.KeyChar == 13)
         {
             DataTable dtModelo = this.cbxModelo.DataSource as DataTable;
             bool      flag     = true;
             do
             {
                 if (!flag)
                 {
                     MessageBox.Show("No se encontró modelos disponibles por favor contacte al administrador", "Captura Vaciado", MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1);
                     this.EliminarRegistros();
                     a03_ConfiguracionInicial frmObj = new a03_ConfiguracionInicial(this.lu);
                     frmObj.Show();
                     this.Close();
                     return;
                 }
                 if (dtModelo == null || dtModelo.Rows.Count == 0)
                 {
                     this.Form_Load(sender, e);
                     dtModelo = this.cbxModelo.DataSource as DataTable;
                     flag     = false;
                 }
             } while (!flag);
             DataRow[] rows = dtModelo.Select("ClaveArticulo = '" + (sender as TextBox).Text + "'");
             if (rows.Length == 0)
             {
                 throw new Exception("No se encontró el modelo capturado.");
             }
             if (rows.Length > 0)
             {
                 this.cbxModelo.SelectedValue = rows[0]["CodArticulo"];
             }
             //this.btAceptar_Click(sender, e);
         }
         else
         {
             e.Handled = EsDidigo(e.KeyChar);
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1);
         (sender as TextBox).SelectAll();
     }
 }
コード例 #11
0
 private void btCancelar_Click(object sender, EventArgs e)
 {
     try
     {
         if (bDesperdicio)
         {
             a03_ConfiguracionInicial frmObj = new a03_ConfiguracionInicial(this.lu);
             frmObj.Show();
         }
         this.Close();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1);
     }
 }
コード例 #12
0
        private void btAceptar_Click(object sender, EventArgs e)
        {
            try
            {
                this.encabezado.Titulo = "Login";
                // Validar Usuario.
                if (string.IsNullOrEmpty(this.txUsuario.Text))
                {
                    this.encabezado.Mensaje = "Capture Usuario";

                    this.txUsuario.Focus();
                    return;
                }

                // Validar Contraseña.
                if (string.IsNullOrEmpty(this.txContrasena.Text))
                {
                    this.encabezado.Mensaje = "Capture Contraseña";

                    this.txContrasena.Focus();
                    return;
                }

                LoginUsuario lu = this.oDA.Login(this.txUsuario.Text, this.txContrasena.Text);

                if (lu.IsLogin)
                {
                    //a02_SeleccionPlanta frmObj = new a02_SeleccionPlanta(lu);
                    a03_ConfiguracionInicial frmObj = new a03_ConfiguracionInicial(lu);
                    frmObj.Show();
                    this.Hide();
                }
                else
                {
                    this.encabezado.Mensaje = lu.Mensaje;

                    this.txUsuario.Text    = String.Empty;
                    this.txContrasena.Text = String.Empty;

                    this.txUsuario.Focus();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1);
            }
        }
コード例 #13
0
 private void tbxColor_KeyPress(object sender, KeyPressEventArgs e)
 {
     try
     {
         if (e.KeyChar == 13)
         {
             DataTable dtColor = this.cbxColor.DataSource as DataTable;
             bool      flag    = true;
             do
             {
                 if (!flag)
                 {
                     MessageBox.Show("No se encontró colores disponibles por favor contacte al administrador", "Captura Vaciado", MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1);
                     a03_ConfiguracionInicial frmObj = new a03_ConfiguracionInicial(this.lu);
                     frmObj.Show();
                     this.Close();
                     return;
                 }
                 if (dtColor == null || dtColor.Rows.Count == 0)
                 {
                     SetComboColor();
                     dtColor = this.cbxColor.DataSource as DataTable;
                     flag    = false;
                 }
             } while (!flag);
             DataRow[] rows = dtColor.Select("ClaveColor = '" + (sender as TextBox).Text + "'");
             if (rows.Length == 0)
             {
                 throw new Exception("No se encontró el color capturado.");
             }
             if (rows.Length > 0)
             {
                 this.cbxColor.SelectedValue = rows[0]["CodColor"];
             }
         }
         else
         {
             e.Handled = EsDidigo(e.KeyChar);
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1);
         (sender as TextBox).SelectAll();
     }
 }
コード例 #14
0
 private void btCancelar_Click(object sender, EventArgs e)
 {
     try
     {
         DialogResult dr = MessageBox.Show("¿Desea Cancelar la Captura de esta Etiqueta Inventario?", "SCPP", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2);
         if (dr == DialogResult.Yes)
         {
             // Regresar a Configuracion Inicial.
             a03_ConfiguracionInicial frmObj = new a03_ConfiguracionInicial(this.lu);
             frmObj.Show();
             this.Close();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1);
     }
 }
コード例 #15
0
        private void btTerminar_Click(object sender, EventArgs e)
        {
            try
            {
                if (this.iCodCarro == -1)
                {
                    this.lbMensaje.Text = "Capture número de Carro";
                    this.txCodCarro.SelectAll();
                    this.txCodCarro.Focus();
                }
                else
                {
                    DataTable dtRes = this.oDA.ObtenerPiezasCarro(this.lu.CodPlanta, this.lu.CodProceso, this.iCodCarro);
                    if (dtRes.Rows.Count == 0)
                    {
                        this.lbMensaje.Text        = "Carro sin Piezas registradas";
                        this.txCodBarrasPieza.Text = "";
                        this.txCodBarrasPieza.Focus();
                    }
                    else
                    {
                        // Enviar el carro con las piezas asociadas al Servidor.
                        // ?????????????????????

                        // Borrar el carro armado.
                        this.oDA.EliminarCarro(this.lu.CodPlanta, this.lu.CodProceso, this.iCodCarro);

                        this.lbMensaje.Text = "";
                        DialogResult dr = MessageBox.Show("Armado de Carro para Secado completado.", "SCPP", MessageBoxButtons.OK, MessageBoxIcon.None, MessageBoxDefaultButton.Button1);

                        //Regresar a Configuracion Inicial.
                        a03_ConfiguracionInicial frmObj = new a03_ConfiguracionInicial(this.lu);
                        frmObj.Show();
                        this.Close();
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1);
            }
        }
コード例 #16
0
 private void btContinuar_Click(object sender, EventArgs e)
 {
     try
     {
         if (this.lu.CodPlanta == -1)
         {
             this.lbMensaje.Text = "Seleccione una planta";
             this.cbxPlanta.Focus();
         }
         else
         {
             a03_ConfiguracionInicial frmObj = new a03_ConfiguracionInicial(this.lu);
             frmObj.Show();
             this.Close();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1);
     }
 }
コード例 #17
0
        private void btnTerminar_Click(object sender, EventArgs e)
        {
            if (this.num_escaneado != cont_pos)
            {
                DialogResult dr = MessageBox.Show("¿Aún hay pendientes, deseas terminar?", "SCPP", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2);
                if (dr == DialogResult.No)
                {
                    return;
                }
            }



            MessageBox.Show("Banco Terminado!", "SCPP", MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1);


            a03_ConfiguracionInicial oconfig = new a03_ConfiguracionInicial(this.lu);

            oconfig.Show();
            this.Close();
        }
コード例 #18
0
        private void btTerminar_Click(object sender, EventArgs e)
        {
            try
            {
                if (new c00_Transacciones().EnviarDatosReemplazoEtiqueta())
                {
                    MessageBox.Show("Informacion enviada correctamente", "Reemplazo", MessageBoxButtons.OK, MessageBoxIcon.None, MessageBoxDefaultButton.Button1);
                }
                else
                {
                    MessageBox.Show("Hubo un error al enviar tu informacion consulta a tu personal de sistemas.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1);
                }

                // Regresar a Configuracion Inicial.
                a03_ConfiguracionInicial frmObj = new a03_ConfiguracionInicial(this.lu);
                frmObj.Show();
                this.Close();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1);
            }
        }
コード例 #19
0
        private void btTerminar_Click(object sender, EventArgs e)
        {
            if (this.ObtenerPiezasCapturadas() == this.iNumPiezasACapturar)
            {
                MessageBox.Show("Banco Terminado!", "SCPP", MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1);
            }
            else
            {
                DialogResult dr = MessageBox.Show("Aún hay pendientes, ¿deseas terminar?", "SCPP", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2);
                if (dr == DialogResult.No)
                {
                    return;
                }
            }

            // Insertar las Piezas.
            this.InsertarPiezas();

            // Regresar a Configuracion Inicial.
            a03_ConfiguracionInicial frmObj = new a03_ConfiguracionInicial(this.lu);

            frmObj.Show();
            this.Close();
        }
コード例 #20
0
        private void btCancelar_Click(object sender, EventArgs e)
        {
            try
            {
                if (this.iCodCarro != -1)
                {
                    DialogResult dr = MessageBox.Show("¿Cancelar armado de Carro?", "SCPP", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2);
                    if (dr == DialogResult.Yes)
                    {
                        // Borrar el carro armado.
                        this.oDA.EliminarCarro(this.lu.CodPlanta, this.lu.CodProceso, this.iCodCarro);

                        //Regresar a Configuracion Inicial.
                        //a03_ConfigInicial frmObj = new a03_ConfigInicial(this.lu);
                        //frmObj.Show();
                        this.Close();
                    }
                    else
                    {
                        this.txCodBarrasPieza.Text = "";
                        this.txCodBarrasPieza.Focus();
                    }
                }
                else
                {
                    //Regresar a Configuracion Inicial.
                    a03_ConfiguracionInicial frmObj = new a03_ConfiguracionInicial(this.lu);
                    frmObj.Show();
                    this.Close();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1);
            }
        }
コード例 #21
0
        private void btPaletizar_Click(object sender, EventArgs e)
        {
            try
            {
                if (this.ExisteUnaPiezaRechazada())
                {
                    DialogResult drRes = MessageBox.Show("Existe al menos una pieza rechazada. ¿Acepta eliminar tarima?", "SCPP", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2);
                    if (drRes == DialogResult.Yes)
                    {
                        // Si se encuentra por lo menos una pieza rechazada:
                        // Se da de baja la tarima.
                        // Se establece el campo 'Auditada' en 'false' de la tabla 'pieza'.
                        // Se establece el campo 'UltimoProceso' en 'Clasificado'.
                        this.oDA.RechazarTarimaPieza(DA.eTipoConexion.Local, this.iCodTarima);
                        int iCodPieza = -1;
                        foreach (DataRow dr in this.dtPiezasTarima.Rows)
                        {
                            iCodPieza = Convert.ToInt32(dr["CodPieza"]);
                            this.oDA.ActualizarPiezaAuditada(DA.eTipoConexion.Local, iCodPieza, false);
                            this.oDA0.ActulizarUltimoProcesoPieza(DA.eTipoConexion.Local, iCodPieza, this.oDA0.ObtenerCodProcesoClasificado());
                        }
                        // Regresar a Configuracion Inicial.
                        a03_ConfiguracionInicial frmObj = new a03_ConfiguracionInicial(this.lu);
                        frmObj.ShowDialog();
                        this.Close();
                    }
                }
                else if (this.ExisteUnaPiezaAuditada() || this.ExisteUnaPiezaAceptada())
                {
                    DialogResult drRes = MessageBox.Show("Existe al menos una pieza auditada. ¿Acepta paletizar tarima?", "SCPP", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2);
                    if (drRes == DialogResult.Yes)
                    {
                        // Si se encuentra por lo menos una pieza rechazada:
                        // Se paletiza la tarima.
                        // Se establece el campo 'Auditada' en 'true' de la tabla 'pieza'.
                        // Se establece el campo 'UltimoProceso' en 'Auditado'.

                        this.oDA.ActualizarTarimaPaletizado(this.iCodTarima, true);

                        int iCodPieza = -1;
                        foreach (DataRow dr in this.dtPiezasTarima.Rows)
                        {
                            iCodPieza = Convert.ToInt32(dr["CodPieza"]);

                            long lCodPiezaTransaccion = this.oDA0.InsertarPiezaTransaccion(DA.eTipoConexion.Local,
                                                                                           this.lu.CodConfigHandHeld,
                                                                                           iCodPieza,
                                                                                           this.lu.Fecha);
                            this.oDA.ActualizarPiezaAuditada(DA.eTipoConexion.Local, iCodPieza, false);
                            this.oDA0.ActulizarUltimoProcesoPieza(DA.eTipoConexion.Local, iCodPieza, this.iCodProcesoAct);
                        }

                        this.EnviarDatosAlServidor();

                        // Regresar a Configuracion Inicial.
                        a03_ConfiguracionInicial frmObj = new a03_ConfiguracionInicial(this.lu);
                        frmObj.Show();
                        this.Close();
                    }
                }
                else
                {
                    this.encabezado.Mensaje = "No hay piezas auditadas en tarima";
                    this.txEtiqueta.Focus();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1);
            }
        }
コード例 #22
0
        private void btAceptar_Click(object sender, EventArgs e)
        {
            try
            {
                this.encabezado.Mensaje = String.Empty;

                int codPieza = this.oDA0.ObtenerCodPiezaCodBarras(this.txEtiqueta.Text, false);
                if (codPieza != -1 && bNuevaPieza)
                {
                    this.txEtiqueta.Text = String.Empty;
                    this.txEtiqueta.Focus();
                    return;
                }
                if (String.IsNullOrEmpty(this.txEtiqueta.Text.ToString().Trim()) && bNuevaPieza)
                {
                    this.encabezado.Mensaje = "Ingrese Etiqueta";
                    this.txEtiqueta.Focus();
                    return;
                }
                else
                {
                    this.lu.CodBarras = this.txEtiqueta.Text;
                }
                if (this.iCodProceso == -1)
                {
                    this.encabezado.Mensaje = "Seleccione Proceso";
                    this.cbxProceso.Focus();
                    return;
                }
                if (this.iCodTipoModelo == -1)
                {
                    this.encabezado.Mensaje = "Seleccione Tipo Modelo";
                    this.cbxTipoModelo.Focus();
                    return;
                }
                if (this.iCodModelo == -1)
                {
                    this.encabezado.Mensaje = "Seleccione Modelo";
                    this.cbxModelo.Focus();
                    return;
                }

                if (this.iCodProceso >= this.oDA0.ObtenerCodProcesoEsmaltado())
                {
                    if (this.iCodColor == -1)
                    {
                        this.encabezado.Mensaje = "Seleccione Color";
                        this.cbxColor.Focus();
                        return;
                    }
                }
                if (this.iCodProceso >= this.oDA0.ObtenerCodProcesoClasificado())
                {
                    if (this.iCodCalidad == -1)
                    {
                        this.encabezado.Mensaje = "Seleccione Calidad";
                        this.cbxCalidad.Focus();
                        return;
                    }
                }

                // Validar existe combinacion MODELO-COLOR-CALIDAD en Articulos.
                string sClaveModelo = string.Empty;
                if (this.iCodProceso <= this.oDA0.ObtenerCodProcesoRevisado())
                {
                    sClaveModelo = this.sClaveModelo;
                }
                else if (this.iCodProceso <= this.oDA0.ObtenerCodProcesoHornos())
                {
                    sClaveModelo = this.sClaveModelo + "-" + this.sClaveColor;
                }
                else
                {
                    sClaveModelo = this.sClaveModelo + "-" + this.sClaveColor + "-" + this.sClaveCalidad;
                }

                int iCodModelo = this.oDA0.ExisteModelo(sClaveModelo);
                if (iCodModelo == -1)
                {
                    this.encabezado.Mensaje = "Modelo-Color-Calidad invalido";
                    this.cbxModelo.Focus();
                    return;
                }

                // Insertar Pieza Inventario.
                this.oDA.InsertarPiezaInventario(this.lu.CodBarras, this.lu.CodPlanta, this.iCodProceso, this.iCodModelo, this.iCodColor, this.iCodCalidad, 1);
                if (bNuevaPieza)
                {
                    a03_ConfiguracionInicial frmObj = new a03_ConfiguracionInicial(this.lu);
                    frmObj.Show();
                    this.Close();
                }
                this.Close();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1);
            }
        }