///******************************************************************************* ///NOMBRE DE LA FUNCIÓN: Txt_Contenedor_KeyPress ///DESCRIPCIÓN : Evento KeyPress del Txt_Contenedor para consultar la información /// del contenedor al presionar la tecla enter. ///PARAMENTROS : ///CREO : Miguel Angel Bedolla Moreno ///FECHA_CREO : 12/Abr/2013 05:27 p.m. ///MODIFICO : ///FECHA_MODIFICO: ///CAUSA_MODIFICACIÓN: ///******************************************************************************* private void Txt_Contenedor_KeyPress(object sender, KeyPressEventArgs e) { if (e.KeyChar == (char)Keys.Enter) { Cls_Cat_Contenedores_Negocio P_Contenedores = new Cls_Cat_Contenedores_Negocio(); DataTable Dt_Contenedor = new DataTable(); if (Txt_Contenedor.Text.Trim() != "") { P_Contenedores.P_Codigo_Contenedor = Txt_Contenedor.Text.ToUpper().Replace("-", ""); P_Contenedores.P_Estatus = " = 'ACTIVO'"; P_Contenedores.P_Contenedor_No_Embarque = true; Dt_Contenedor = P_Contenedores.Consultar_Contenedores(); if (Dt_Contenedor.Rows.Count > 0) { Txt_Contenedor_Id.Text = Dt_Contenedor.Rows[0][Cat_Contenedores.Campo_Contenedor_Id].ToString(); Txt_Ubicacion_Anterior.Text = Dt_Contenedor.Rows[0][Cat_Ubicaciones.Campo_Ubicacion].ToString(); if (Btn_Transferir.Visible) { Btn_Transferir_Click(null, null); } if (Dt_Contenedor.Rows[0][Cat_Tipos_Contenedores.Campo_Uso].ToString() == "WIP/FG") { Cmb_Ubicacion_Wipfg.Visible = true; Cmb_Ubicacion_Wip.Visible = false; Cmb_Ubicacion_Fg.Visible = false; Cmb_Ubicacion_Wipfg.Focus(); } else if (Dt_Contenedor.Rows[0][Cat_Tipos_Contenedores.Campo_Uso].ToString().Contains("FG")) { Cmb_Ubicacion_Wipfg.Visible = false; Cmb_Ubicacion_Wip.Visible = false; Cmb_Ubicacion_Fg.Visible = true; Cmb_Ubicacion_Fg.Focus(); } else if (Dt_Contenedor.Rows[0][Cat_Tipos_Contenedores.Campo_Uso].ToString().Contains("WIP")) { Cmb_Ubicacion_Wipfg.Visible = false; Cmb_Ubicacion_Wip.Visible = true; Cmb_Ubicacion_Fg.Visible = false; Cmb_Ubicacion_Wip.Focus(); } } else { Txt_Contenedor_Id.Text = ""; Txt_Contenedor.Focus(); MessageBox.Show("El contenedor no existe en el sistema", "Trasferencia de contenedores", MessageBoxButtons.OK, MessageBoxIcon.Asterisk, MessageBoxDefaultButton.Button1); } } } }
///******************************************************************************* ///NOMBRE DE LA FUNCIÓN: Txt_Observaciones_Contenedor_KeyPress ///DESCRIPCIÓN : Evento KeyPress del Txt_Observaciones_Contenedor para cambiar el foco del componente /// al presionar la tecla Enter ///PARAMENTROS : ///CREO : Miguel Angel Bedolla Moreno ///FECHA_CREO : 12/Abr/2013 05:27 p.m. ///MODIFICO : ///FECHA_MODIFICO: ///CAUSA_MODIFICACIÓN: ///******************************************************************************* private void Txt_Observaciones_Contenedor_KeyPress(object sender, KeyPressEventArgs e) { if (e.KeyChar == (char)Keys.Enter) { if (Cmb_Ubicacion_Fg.Visible) { Cmb_Ubicacion_Fg.Focus(); } else { Cmb_Ubicacion_Wip_Fg.Focus(); } } }
///******************************************************************************* ///NOMBRE DE LA FUNCIÓN: Txt_Contenedor_KeyPress ///DESCRIPCIÓN : Consulta el contenedor al presionar la tecla enter ///PARAMENTROS : ///CREO : Miguel Angel Bedolla Moreno ///FECHA_CREO : 12/Abr/2013 05:27 p.m. ///MODIFICO : ///FECHA_MODIFICO: ///CAUSA_MODIFICACIÓN: ///******************************************************************************* private void Txt_Contenedor_KeyPress(object sender, KeyPressEventArgs e) { Lbl_Cantidad.Visible = false; Txt_Cantidad.Visible = false; Txt_Cantidad.Enabled = false; if (e.KeyChar == (char)Keys.Enter) { if (Txt_Contenedor.Text.Trim() != "") { Cls_Ope_Entradas_Negocio P_Contenedores = new Cls_Ope_Entradas_Negocio(); DataTable Dt_Contenedor = new DataTable(); P_Contenedores.P_Codigo_Contenedor = Txt_Contenedor.Text.ToUpper().Replace("-", "");; P_Contenedores.P_Estatus_Contenedor = "ACTIVO"; Dt_Contenedor = P_Contenedores.Consultar_Detalles_Entrada(); if (Dt_Contenedor.Rows.Count > 0) { Txt_Contenedor_Id.Text = Dt_Contenedor.Rows[0][Ope_Det_Movimientos_Entrada.Campo_Contenedor_Id].ToString(); Txt_Comentarios.Text = Dt_Contenedor.Rows[0][Ope_Det_Movimientos_Entrada.Campo_Comentarios].ToString(); Txt_Destino.Text = Dt_Contenedor.Rows[0][Cat_Destinos.Campo_Destino].ToString(); Txt_Orden_Entrada.Text = Dt_Contenedor.Rows[0][Ope_Entradas.Campo_Orden_Entrada].ToString(); Txt_Fecha.Text = Convert.ToDateTime(Dt_Contenedor.Rows[0][Ope_Entradas.Campo_Fecha_Envio].ToString()).ToString("dd/MMM/yyyy hh:mm:ss tt"); Txt_Cantidad.Text = Dt_Contenedor.Rows[0][Ope_Det_Movimientos_Entrada.Campo_Cantidad].ToString(); Txt_No_Entrada.Text = Dt_Contenedor.Rows[0][Ope_Entradas.Campo_No_Entrada].ToString(); if (Dt_Contenedor.Rows[0][Cat_Tipos_Contenedores.Campo_Es_Charola].ToString().Trim() == "S") { Lbl_Cantidad.Visible = true; Txt_Cantidad.Visible = true; Txt_Cantidad.Enabled = true; } if (Dt_Contenedor.Rows[0][Cat_Tipos_Contenedores.Campo_Uso].ToString().Contains("WIP")) { Cmb_Ubicacion_Wip_Fg.Visible = true; Cmb_Ubicacion_Fg.Visible = false; Cmb_Ubicacion_Wip_Fg.Focus(); } else { Cmb_Ubicacion_Wip_Fg.Visible = false; Cmb_Ubicacion_Fg.Visible = true; Cmb_Ubicacion_Fg.Focus(); } DataTable Dt_Contenedores = (DataTable)Grid_Contenedores_Entrada.DataSource; for (int Cont_Contenedores = 0; Cont_Contenedores < Dt_Contenedores.Rows.Count; Cont_Contenedores++) { if (Dt_Contenedores.Rows[Cont_Contenedores][Cat_Contenedores.Campo_Contenedor_Id].ToString() == Txt_Contenedor_Id.Text) { Txt_Contenedor.Text = ""; Txt_Contenedor_Id.Text = ""; Txt_Observaciones_Contenedor.Text = ""; Txt_Destino.Text = ""; Txt_Fecha.Text = ""; Txt_Cantidad.Text = ""; Txt_No_Entrada.Text = ""; Txt_Orden_Entrada.Text = ""; Txt_Contenedor.Focus(); MessageBox.Show("El contenedor ya se encuentra cargado para su recepción.", "Recepción de contenedores", MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1); } } Txt_Observaciones_Contenedor.Focus(); if (Txt_Cantidad.Visible) { Txt_Cantidad.Focus(); } } else { Txt_Contenedor_Id.Text = ""; Txt_Comentarios.Text = ""; Txt_Destino.Text = ""; Txt_Fecha.Text = ""; Txt_Cantidad.Text = ""; Txt_No_Entrada.Text = ""; Txt_Contenedor.Focus(); MessageBox.Show("No existe salida para el contenedor ingresado", "Recepción de contenedores", MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1); } } else { MessageBox.Show("Ingrese el código del contenedor", "Recepción de contenedores", MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1); } } }
///******************************************************************************* ///NOMBRE DE LA FUNCIÓN: Txt_Contenedor_KeyPress ///DESCRIPCIÓN : Consulta el contenedor al presionar la tecla enter ///PARAMENTROS : ///CREO : Miguel Angel Bedolla Moreno ///FECHA_CREO : 12/Abr/2013 05:27 p.m. ///MODIFICO : ///FECHA_MODIFICO: ///CAUSA_MODIFICACIÓN: ///******************************************************************************* private void Txt_Contenedor_KeyPress(object sender, KeyPressEventArgs e) { Cls_Metodos_Generales.Validar_Caracter(e, Cls_Metodos_Generales.Enum_Tipo_Caracteres.Alfa_Numerico_Extendido); Cls_Metodos_Generales.Convertir_Caracter_Mayuscula(e); if (e.KeyChar == (char)Keys.Enter) { if (Txt_Contenedor.Text.Trim() != "") { Cls_Ope_Entradas_Negocio P_Contenedores = new Cls_Ope_Entradas_Negocio(); DataTable Dt_Contenedor = new DataTable(); P_Contenedores.P_Codigo_Contenedor = Txt_Contenedor.Text.ToUpper().Replace("-", "").Replace("'", "");; P_Contenedores.P_Estatus_Contenedor = "ACTIVO"; Dt_Contenedor = P_Contenedores.Consultar_Detalles_Entradas(); if (Dt_Contenedor.Rows.Count > 0) { Txt_Contenedor_Id.Text = Dt_Contenedor.Rows[0][Ope_Det_Movimientos_Entradas.Campo_Contenedor_Id].ToString(); Txt_Orden_Entrada.Text = Dt_Contenedor.Rows[0][Ope_Entradas.Campo_Orden_Entrada].ToString(); Txt_Destino.Text = Dt_Contenedor.Rows[0][Cat_Destinos.Campo_Destino].ToString(); Txt_Fecha.Text = Convert.ToDateTime(Dt_Contenedor.Rows[0][Ope_Entradas.Campo_Fecha_Envio].ToString()).ToString("dd/MMM/yyyy hh:mm:ss tt"); Txt_No_Entrada.Text = Dt_Contenedor.Rows[0][Ope_Entradas.Campo_No_Entrada].ToString(); Txt_Contenedor.Text = Dt_Contenedor.Rows[0]["CONTENEDOR"].ToString(); if (Dt_Contenedor.Rows[0][Cat_Tipos_Contenedores.Campo_Uso].ToString().Contains("WIP")) { Cmb_Ubicacion_Wip_Fg.Visible = true; Cmb_Ubicacion_Fg.Visible = false; Cmb_Ubicacion_Wip_Fg.Focus(); } else { Cmb_Ubicacion_Wip_Fg.Visible = false; Cmb_Ubicacion_Fg.Visible = true; Cmb_Ubicacion_Fg.Focus(); } for (int Cont_Contenedores = 0; Cont_Contenedores < Grid_Movimientos.Rows.Count; Cont_Contenedores++) { if (Grid_Movimientos.Rows[Cont_Contenedores].Cells[1].Value.ToString() == Txt_Contenedor_Id.Text) { Txt_Contenedor.Text = ""; Txt_Contenedor_Id.Text = ""; Txt_Observaciones.Text = ""; Txt_Destino.Text = ""; Txt_Fecha.Text = ""; Txt_No_Entrada.Text = ""; Txt_Orden_Entrada.Text = ""; Txt_Contenedor.Focus(); MessageBox.Show("El contenedor ya se encuentra cargado para su recepción.", "Recepción de contenedores", MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1); } } } else { Txt_Contenedor.Text = ""; Txt_Contenedor_Id.Text = ""; Txt_Observaciones.Text = ""; Txt_Destino.Text = ""; Txt_Fecha.Text = ""; Txt_No_Entrada.Text = ""; Txt_Orden_Entrada.Text = ""; Txt_Contenedor.Focus(); MessageBox.Show("No existe entreda para el contenedor ingresado", "Recepción de contenedores", MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1); } } else { MessageBox.Show("Ingrese el código del contenedor", "Recepción de contenedores", MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1); } } }
///******************************************************************************* ///NOMBRE DE LA FUNCIÓN: Btn_Transferir_Click ///DESCRIPCIÓN : Evento click del botón transferir ///PARAMENTROS : ///CREO : Miguel Angel Bedolla Moreno ///FECHA_CREO : 21/Feb/2013 01:01 p.m. ///MODIFICO : ///FECHA_MODIFICO: ///CAUSA_MODIFICACIÓN: ///******************************************************************************* private void Btn_Transferir_Click(object sender, EventArgs e) { if (Btn_Transferir.Text == "Modificar") { if (Txt_Contenedor_Id.Text.Trim() != "") { String Contenedor_Id = Txt_Contenedor_Id.Text; String Contenedor = Txt_Contenedor.Text; String Ubicacion_Actual = Txt_Ubicacion_Anterior.Text; Cls_Metodos_Generales.Habilita_Deshabilita_Controles(Pnl_Generales, true); Cls_Metodos_Generales.Limpia_Controles(Pnl_Generales); Txt_Contenedor_Id.Text = Contenedor_Id; Txt_Contenedor.Text = Contenedor; Txt_Ubicacion_Anterior.Text = Ubicacion_Actual; Habilitar_Controles("Transferir"); Txt_Contenedor.Enabled = false; Txt_Ubicacion_Anterior.Enabled = false; Cmb_Ubicacion_Fg.Focus(); } } else { if (Validar_Componentes()) { String P_Ubicacion_Anterior_Id = ""; Cls_Ope_Embarques_Negocio P_Movimiento = new Cls_Ope_Embarques_Negocio(); P_Movimiento.P_Contenedor_Id = Txt_Contenedor_Id.Text; P_Movimiento.P_Observaciones = Txt_Observaciones.Text.ToUpper(); if (Cmb_Ubicacion_Fg.Visible) { P_Movimiento.P_Ubicacion_Id = Cmb_Ubicacion_Fg.SelectedValue.ToString(); } else if (Cmb_Ubicacion_Wip.Visible) { P_Movimiento.P_Ubicacion_Id = Cmb_Ubicacion_Wip.SelectedValue.ToString(); } else if (Cmb_Ubicacion_Wipfg.Visible) { P_Movimiento.P_Ubicacion_Id = Cmb_Ubicacion_Wipfg.SelectedValue.ToString(); } P_Movimiento.P_Usuario = Txt_Nombre_Usuario.Text.ToUpper(); Cls_Cat_Contenedores_Negocio P_Contenedor = new Cls_Cat_Contenedores_Negocio(); P_Contenedor.P_Contenedor_Id = Txt_Contenedor_Id.Text; P_Ubicacion_Anterior_Id = P_Contenedor.Consultar_Contenedores().Rows[0][Cat_Contenedores.Campo_Ubicacion_Id].ToString(); if (P_Movimiento.Alta_Transferencia_Contenedor()) { //Enviar_Correo(P_Ubicacion_Anterior_Id); Cls_Metodos_Generales.Habilita_Deshabilita_Controles(Pnl_Generales, false); Cls_Metodos_Generales.Limpia_Controles(Pnl_Generales); Habilitar_Controles("Inicial"); Txt_Contenedor.Enabled = true; Limpiar_Grid(); Llenar_Combo_Fg(); Llenar_Combo_Wip(); Llenar_Combo_Wip_Fg(); MessageBox.Show("Transferencia del contenedor exitosa", "Trasferencia de contenedores", MessageBoxButtons.OK, MessageBoxIcon.Asterisk, MessageBoxDefaultButton.Button1); Txt_Contenedor.Enabled = true; Txt_Contenedor.Focus(); Grid_Movimientos.Visible = false; } } } }