///******************************************************************************* ///NOMBRE DE LA FUNCIÓN: Txt_Contenedor_KeyPress ///DESCRIPCIÓN :Evento KeyPress del Txt_Contenedor para validar la tecla enter /// como disparador de consulta ///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(); 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_Baja.Visible) { Btn_Baja_Click(null, null); } } else { Txt_Contenedor_Id.Text = ""; Txt_Contenedor.Focus(); MessageBox.Show("*El contenedor no existe en el sistema ó \n*El contenedor esta INACTIVO ó, \n*El contenedor se encuentra en un embarque.", "Baja de contenedores", MessageBoxButtons.OK, MessageBoxIcon.Asterisk, MessageBoxDefaultButton.Button1); Limpiar_Grid(); } } }
///******************************************************************************* ///NOMBRE DE LA FUNCIÓN: Txt_Contenedor_TextChanged ///DESCRIPCIÓN : Evento TextChanged de la caja de texto contenedor ///PARAMENTROS : ///CREO : Miguel Angel Bedolla Moreno ///FECHA_CREO : 21/Feb/2013 01:01 p.m. ///MODIFICO : ///FECHA_MODIFICO: ///CAUSA_MODIFICACIÓN: ///******************************************************************************* private void Txt_Contenedor_TextChanged(object sender, EventArgs e) { Cls_Cat_Contenedores_Negocio P_Contenedores = new Cls_Cat_Contenedores_Negocio(); DataTable Dt_Contenedor = new DataTable(); P_Contenedores.P_Codigo_Contenedor = Txt_Contenedor.Text.ToUpper().Replace("-", ""); 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_Estatus.Text = Dt_Contenedor.Rows[0][Cat_Contenedores.Campo_Estatus].ToString(); if (Dt_Contenedor.Rows[0][Cat_Destinos.Campo_Destino].ToString().Trim() == "") { Txt_Ubicacion_Anterior.Text = Dt_Contenedor.Rows[0][Cat_Ubicaciones.Campo_Ubicacion].ToString(); } else { Txt_Ubicacion_Anterior.Text = Dt_Contenedor.Rows[0][Cat_Destinos.Campo_Destino].ToString(); } Txt_Observaciones.Text = Dt_Contenedor.Rows[0][Cat_Contenedores.Campo_Observaciones].ToString(); } else { Txt_Estatus.Text = ""; Txt_Contenedor_Id.Text = ""; Txt_Contenedor.Focus(); MessageBox.Show("El contenedor no existe en el sistema", "Consulta de estatus por contenedor", MessageBoxButtons.OK, MessageBoxIcon.Asterisk, MessageBoxDefaultButton.Button1); } Cls_Ope_Embarques_Negocio P_Movimientos = new Cls_Ope_Embarques_Negocio(); P_Movimientos.P_Contenedor_Id = Txt_Contenedor_Id.Text; Dt_Contenedor = P_Movimientos.Consultar_Movimientos_Contenedor(); Dt_Contenedor.TableName = "HISTORIAL_CONTENEDORES"; Grid_Movimientos.DataSource = Dt_Contenedor; }
///******************************************************************************* ///NOMBRE DE LA FUNCIÓN: Btn_Salir_Click ///DESCRIPCIÓN : Evento Click del botón Btn_Salir ///PARAMENTROS : ///CREO : Miguel Angel Bedolla Moreno ///FECHA_CREO : 12/Abr/2013 05:27 p.m. ///MODIFICO : ///FECHA_MODIFICO: ///CAUSA_MODIFICACIÓN: ///******************************************************************************* private void Btn_Salir_Click(object sender, EventArgs e) { if (Btn_Salir.Text == "Salir") { Frm_Principal Frm_Principal_Sistema = Get_Frm_Principal(); Frm_Principal_Sistema.Set_Nombre_Usuario(Txt_Nombre_Usuario.Text); Frm_Principal_Sistema.Set_Rol_Id(Txt_Rol_Id.Text); Frm_Principal_Sistema.Set_Usuario_Id(Txt_Usuario_Id.Text); this.Close(); Frm_Principal_Sistema.Show(); } else { Cls_Metodos_Generales.Limpia_Controles(Pnl_Generales); Cls_Metodos_Generales.Habilita_Deshabilita_Controles(Pnl_Generales, false); Btn_Baja.Enabled = true; Btn_Salir.Enabled = true; Pnl_Generales.Visible = true; Habilitar_Controles("Inicial"); Btn_Baja.Focus(); Txt_Contenedor.Enabled = true; Txt_Contenedor.Focus(); Limpiar_Grid(); Grid_Movimientos.Visible = false; } }
///******************************************************************************* ///NOMBRE DE LA FUNCIÓN: Frm_Traspaso_Contenedores_Load ///DESCRIPCIÓN : Evento Load del formulario ///PARAMENTROS : ///CREO : Miguel Angel Bedolla Moreno ///FECHA_CREO : 21/Feb/2013 01:01 p.m. ///MODIFICO : ///FECHA_MODIFICO: ///CAUSA_MODIFICACIÓN: ///******************************************************************************* private void Frm_Ope_Transferencia_Contenedores_Load(object sender, EventArgs e) { Llenar_Combo_Fg(); Llenar_Combo_Wip(); Llenar_Combo_Wip_Fg(); Cls_Metodos_Generales.Habilita_Deshabilita_Controles(Fra_Datos_Generales, false); Cls_Metodos_Generales.Limpia_Controles(Fra_Datos_Generales); Habilitar_Controles("Inicial"); Txt_Contenedor.Enabled = true; Limpiar_Grid(); Txt_Contenedor.Focus(); Cls_Apl_Roles_Negocio P_Rol = new Cls_Apl_Roles_Negocio(); DataTable Dt_Accesos; P_Rol.P_Rol_Id = MDI_Frm_Apl_Principal.Rol_ID; P_Rol.P_Nombre_Menu = "Transferencia de contenedores"; Dt_Accesos = P_Rol.Consultar_Acceso_Roles(); Btn_Transferir.Visible = false; Btn_Buscar.Visible = false; foreach (DataRow Dr_Renglon_Actual in Dt_Accesos.Rows) { if (Dr_Renglon_Actual[Apl_Acceso.Campo_Cambio].ToString() == "S") { Btn_Transferir.Visible = true; } if (Dr_Renglon_Actual[Apl_Acceso.Campo_Consultar].ToString() == "S") { Btn_Buscar.Visible = true; } } }
///******************************************************************************* ///NOMBRE DE LA FUNCIÓN: Frm_Modificacion_Estatus_Contenedor_Load ///DESCRIPCIÓN :Evento Load del formulario Frm_Modificacion_Estatus_Contenedor ///PARAMENTROS : ///CREO : Miguel Angel Bedolla Moreno ///FECHA_CREO : 12/Abr/2013 05:27 p.m. ///MODIFICO : ///FECHA_MODIFICO: ///CAUSA_MODIFICACIÓN: ///******************************************************************************* private void Frm_Ope_Baja_Contenedores_Load(object sender, EventArgs e) { Consultar_Destino_Baja(); Limpiar_Grid(); Txt_Ubicacion.Enabled = false; Txt_Observaciones.Enabled = false; Habilitar_Controles("Inicial"); Btn_Baja.Focus(); Txt_Contenedor.Enabled = true; Txt_Contenedor.Focus(); Btn_Baja.Visible = false; Cls_Apl_Roles_Negocio P_Rol = new Cls_Apl_Roles_Negocio(); DataTable Dt_Accesos; P_Rol.P_Rol_Id = MDI_Frm_Apl_Principal.Rol_ID; P_Rol.P_Nombre_Menu = "Baja de contenedores"; Dt_Accesos = P_Rol.Consultar_Acceso_Roles(); foreach (DataRow Dr_Renglon_Actual in Dt_Accesos.Rows) { if (Dr_Renglon_Actual[Apl_Acceso.Campo_Cambio].ToString() == "S") { Btn_Baja.Visible = true; } if (Dr_Renglon_Actual[Apl_Acceso.Campo_Consultar].ToString() == "S") { Txt_Contenedor.Enabled = true; } } }
///******************************************************************************* ///NOMBRE DE LA FUNCIÓN: Txt_Observaciones_KeyPress ///DESCRIPCIÓN : Evento KeyPress del Txt_Observaciones 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_KeyPress(object sender, KeyPressEventArgs e) { if (e.KeyChar == (char)Keys.Enter) { Txt_Contenedor.Focus(); } }
///******************************************************************************* ///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) { 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) { try { 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("-", "").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; } 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; } 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; } } 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); } } } catch { MessageBox.Show("Error al consultar los contenedores, favor de notificar a su administrador del sistema.", "Trasferencia de contenedores", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1); } } }
///******************************************************************************* ///NOMBRE DE LA FUNCIÓN: Txt_Contenedor_TextChanged ///DESCRIPCIÓN : Evento TextChanged de la caja de texto contenedor ///PARAMENTROS : ///CREO : Miguel Angel Bedolla Moreno ///FECHA_CREO : 21/Feb/2013 01:01 p.m. ///MODIFICO : ///FECHA_MODIFICO: ///CAUSA_MODIFICACIÓN: ///******************************************************************************* private void Txt_Contenedor_TextChanged(object sender, EventArgs e) { try { Cls_Cat_Contenedores_Negocio P_Contenedores = new Cls_Cat_Contenedores_Negocio(); DataTable Dt_Contenedor = new DataTable(); P_Contenedores.P_Codigo_Contenedor = Txt_Contenedor.Text.ToUpper().Replace("-", "").Replace("'", ""); 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_Estatus.Text = Dt_Contenedor.Rows[0][Cat_Contenedores.Campo_Estatus].ToString(); if (Dt_Contenedor.Rows[0][Cat_Destinos.Campo_Destino].ToString().Trim() == "") { Txt_Ubicacion_Anterior.Text = Dt_Contenedor.Rows[0][Cat_Ubicaciones.Campo_Ubicacion].ToString(); } else { Txt_Ubicacion_Anterior.Text = Dt_Contenedor.Rows[0][Cat_Destinos.Campo_Destino].ToString(); } Txt_Observaciones.Text = Dt_Contenedor.Rows[0][Cat_Contenedores.Campo_Observaciones].ToString(); } else { Txt_Estatus.Text = ""; Txt_Contenedor_Id.Text = ""; Txt_Contenedor.Focus(); MessageBox.Show("El contenedor no existe en el sistema", "Consulta de estatus por contenedor", MessageBoxButtons.OK, MessageBoxIcon.Asterisk, MessageBoxDefaultButton.Button1); } Cls_Ope_Embarques_Negocio P_Movimientos = new Cls_Ope_Embarques_Negocio(); P_Movimientos.P_Contenedor_Id = Txt_Contenedor_Id.Text; Dt_Contenedor = P_Movimientos.Consultar_Movimientos_Contenedor_Formulario(); Grid_Movimientos.Rows.Clear(); for (int Cont_Movimientos = 0; Cont_Movimientos < Dt_Contenedor.Rows.Count; Cont_Movimientos++) { Grid_Movimientos.Rows.Add(); Grid_Movimientos.Rows[Cont_Movimientos].Cells[0].Value = Dt_Contenedor.Rows[Cont_Movimientos]["LOCACION"].ToString(); Grid_Movimientos.Rows[Cont_Movimientos].Cells[0].ToolTipText = Dt_Contenedor.Rows[Cont_Movimientos]["LOCACION"].ToString(); Grid_Movimientos.Rows[Cont_Movimientos].Cells[1].Value = Convert.ToDateTime(Dt_Contenedor.Rows[Cont_Movimientos]["FECHA"].ToString()).ToString("dd/MMM/yyyy hh:mm:ss tt"); Grid_Movimientos.Rows[Cont_Movimientos].Cells[1].ToolTipText = Convert.ToDateTime(Dt_Contenedor.Rows[Cont_Movimientos]["FECHA"].ToString()).ToString("dd/MMM/yyyy hh:mm:ss tt"); Grid_Movimientos.Rows[Cont_Movimientos].Cells[2].Value = Dt_Contenedor.Rows[Cont_Movimientos]["USUARIO"].ToString(); Grid_Movimientos.Rows[Cont_Movimientos].Cells[2].ToolTipText = Dt_Contenedor.Rows[Cont_Movimientos]["USUARIO"].ToString(); Grid_Movimientos.Rows[Cont_Movimientos].Cells[3].Value = Dt_Contenedor.Rows[Cont_Movimientos]["OBSERVACIONES"].ToString(); Grid_Movimientos.Rows[Cont_Movimientos].Cells[3].ToolTipText = Dt_Contenedor.Rows[Cont_Movimientos]["OBSERVACIONES"].ToString(); } } catch { MessageBox.Show("Error al consultar los movimientos, favor de notificar a su administrador del sistema.", "Consulta de estatus", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1); } }
///******************************************************************************* ///NOMBRE DE LA FUNCIÓN: Btn_Baja_Click ///DESCRIPCIÓN : Evento encargado de dar de baja el contenedor ///PARAMENTROS : ///CREO : Miguel Angel Bedolla Moreno ///FECHA_CREO : 12/Abr/2013 05:27 p.m. ///MODIFICO : ///FECHA_MODIFICO: ///CAUSA_MODIFICACIÓN: ///******************************************************************************* private void Btn_Baja_Click(object sender, EventArgs e) { if (Txt_Contenedor_Id.Text.Trim() != "") { if (Btn_Baja.Text == "Modificar") { 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; Consultar_Destino_Baja(); Habilitar_Controles("Baja"); Txt_Contenedor.Enabled = false; Txt_Observaciones.Focus(); Txt_Ubicacion.Enabled = false; Txt_Ubicacion_Anterior.Enabled = false; } else { if (Validar_Componentes()) { if (MessageBox.Show("Está seguro de dar de baja el contenedor: " + Txt_Contenedor.Text.ToUpper() + ".", "Baja de contenedores", MessageBoxButtons.YesNo, MessageBoxIcon.Asterisk, MessageBoxDefaultButton.Button2) == DialogResult.Yes) { Cls_Ope_Embarques_Negocio P_Baja = new Cls_Ope_Embarques_Negocio(); P_Baja.P_Contenedor_Id = Txt_Contenedor_Id.Text; P_Baja.P_Estatus = "INACTIVO"; P_Baja.P_Usuario = Txt_Nombre_Usuario.Text.ToUpper(); P_Baja.P_Ubicacion_Id = Txt_Ubicacion_Id.Text; P_Baja.P_Observaciones = Txt_Observaciones.Text.ToUpper(); if (P_Baja.Baja_Contenedor()) { Cls_Metodos_Generales.Limpia_Controles(Pnl_Generales); Cls_Metodos_Generales.Habilita_Deshabilita_Controles(Pnl_Generales, false); Limpiar_Grid(); Consultar_Destino_Baja(); Habilitar_Controles("Inicial"); MessageBox.Show("Baja del contenedor exitosa", "Baja de contenedores", MessageBoxButtons.OK, MessageBoxIcon.Asterisk, MessageBoxDefaultButton.Button1); Btn_Baja.Focus(); Txt_Contenedor.Enabled = true; Txt_Contenedor.Focus(); Grid_Movimientos.Visible = false; } } } } } }
///******************************************************************************* ///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: Btn_Nuevo_Click ///DESCRIPCIÓN : Evento del botón Nuevo ///PARAMENTROS : ///CREO : Miguel Angel Bedolla Moreno ///FECHA_CREO : 12/Abr/2013 06:41 p.m. ///MODIFICO : ///FECHA_MODIFICO: ///CAUSA_MODIFICACIÓN: ///******************************************************************************* private void Btn_Nuevo_Click(object sender, EventArgs e) { if (Btn_Nuevo.Text == "Nuevo") { Habilitar_Controles("Nuevo"); Cls_Metodos_Generales.Habilita_Deshabilita_Controles(Fra_Contenedores, true); Cls_Metodos_Generales.Habilita_Deshabilita_Controles(Fra_Datos_Generales, false); Cls_Metodos_Generales.Habilita_Deshabilita_Controles(Fra_Busqueda, false); Cls_Metodos_Generales.Limpia_Controles(Fra_Busqueda); Fra_Contenedores.Visible = true; Fra_Datos_Generales.Visible = true; Fra_Busqueda.Visible = false; Txt_Contenedor_Id.Text = ""; Txt_Contenedor.Focus(); Grid_Contenedores.Rows.Clear(); } else { if (Validar_Componentes()) { Cls_Ope_Embarques_Negocio P_Embarque = new Cls_Ope_Embarques_Negocio(); P_Embarque.P_No_Embarque = Txt_No_Embarque.Text; P_Embarque.P_Estatus = "CERRADO"; P_Embarque.P_Grid_Detalles = Grid_Contenedores; if (P_Embarque.Cerrar_Embarque()) { //Enviar_Correo(P_Embarque.P_No_Embarque, P_Embarque.P_Dt_Contenedores); Habilitar_Controles("Inicial"); Cls_Metodos_Generales.Habilita_Deshabilita_Controles(Fra_Contenedores, false); Cls_Metodos_Generales.Habilita_Deshabilita_Controles(Fra_Datos_Generales, false); Cls_Metodos_Generales.Habilita_Deshabilita_Controles(Fra_Busqueda, true); Cls_Metodos_Generales.Limpia_Controles(Fra_Contenedores); Cls_Metodos_Generales.Limpia_Controles(Fra_Datos_Generales); Cls_Metodos_Generales.Limpia_Controles(Fra_Busqueda); Grid_Contenedores.Enabled = true; Fra_Contenedores.Visible = false; Fra_Datos_Generales.Visible = false; Fra_Busqueda.Visible = true; Consultar_Embarques(false); DataTable Dt_Contenedores = new DataTable(); Cls_Cat_Destinos_Negocio P_Contenedores = new Cls_Cat_Destinos_Negocio(); P_Contenedores.P_Estatus = " = 'ACTIVO'"; Dt_Contenedores = P_Contenedores.Consultar_Destinos(); Cls_Metodos_Generales.Rellena_Combo_Box(Cmb_Destino, Dt_Contenedores, Cat_Destinos.Campo_Destino, Cat_Destinos.Campo_Destino_Id); MessageBox.Show("Transferencia exitosa. La fecha de envío es: " + P_Embarque.P_Fecha_Envio + "", "Salida de contenedores", MessageBoxButtons.OK, MessageBoxIcon.Asterisk, MessageBoxDefaultButton.Button1); } } } }
///******************************************************************************* ///NOMBRE DE LA FUNCIÓN: Btn_Nuevo_Click ///DESCRIPCIÓN : Evento del botón Nuevo ///PARAMENTROS : ///CREO : Miguel Angel Bedolla Moreno ///FECHA_CREO : 12/Abr/2013 06:41 p.m. ///MODIFICO : ///FECHA_MODIFICO: ///CAUSA_MODIFICACIÓN: ///******************************************************************************* private void Btn_Nuevo_Click(object sender, EventArgs e) { if (Btn_Nuevo.Text == "Nuevo") { Habilitar_Controles("Nuevo"); Cls_Metodos_Generales.Habilita_Deshabilita_Controles(Fra_Datos_Generales, true); Grid_Movimientos.Enabled = true; Txt_Fecha.Enabled = false; Txt_Destino.Enabled = false; Fra_Datos_Generales.Visible = true; Txt_Contenedor_Id.Text = ""; Txt_Contenedor.Text = ""; Txt_Fecha.Enabled = false; Txt_Contenedor.Focus(); Txt_Observaciones.Text = ""; Txt_Orden_Entrada.Text = ""; Grid_Movimientos.Rows.Clear(); } else { if (Validar_Componentes()) { Cls_Ope_Entradas_Negocio P_Entrada = new Cls_Ope_Entradas_Negocio(); P_Entrada.P_Orden_Entrada = Txt_No_Entrada.Text; P_Entrada.P_Estatus = "INACTIVO"; P_Entrada.P_Recibio = MDI_Frm_Apl_Principal.Nombre_Usuario; P_Entrada.P_Grid_Detalles = Grid_Movimientos; if (P_Entrada.Alta_Recepcion_Entrada()) { //Enviar_Correo(P_Entrada.P_No_Embarque, P_Entrada.P_Dt_Contenedores); Habilitar_Controles("Inicial"); Cls_Metodos_Generales.Habilita_Deshabilita_Controles(Fra_Datos_Generales, false); Cls_Metodos_Generales.Limpia_Controles(Fra_Datos_Generales); Fra_Datos_Generales.Visible = true; DataTable Dt_Contenedores; Cls_Cat_Ubicaciones_Negocio P_Ubicaciones = new Cls_Cat_Ubicaciones_Negocio(); P_Ubicaciones.P_Estatus = " = 'ACTIVO'"; P_Ubicaciones.P_Clasificacion = " LIKE '%FG%'"; Dt_Contenedores = P_Ubicaciones.Consultar_Ubicaciones(); Cls_Metodos_Generales.Rellena_Combo_Box(Cmb_Ubicacion_Fg, Dt_Contenedores, Cat_Ubicaciones.Campo_Ubicacion, Cat_Ubicaciones.Campo_Ubicacion_Id); P_Ubicaciones.P_Clasificacion = " LIKE '%FG%' OR " + Cat_Ubicaciones.Campo_Clasificacion + " LIKE '%WIP%'"; Dt_Contenedores = P_Ubicaciones.Consultar_Ubicaciones(); Cls_Metodos_Generales.Rellena_Combo_Box(Cmb_Ubicacion_Wip_Fg, Dt_Contenedores, Cat_Ubicaciones.Campo_Ubicacion, Cat_Ubicaciones.Campo_Ubicacion_Id); Limpiar_Grid(); MessageBox.Show("Transferencia exitosa. La fecha de recepción es: " + P_Entrada.P_Fecha_Recepcion + "", "Recepción de contenedores", MessageBoxButtons.OK, MessageBoxIcon.Asterisk, MessageBoxDefaultButton.Button1); } } } }
///******************************************************************************* ///NOMBRE DE LA FUNCIÓN: Btn_Salir_Click ///DESCRIPCIÓN : Evento del boton salir ///PARAMENTROS : ///CREO : Miguel Angel Bedolla Moreno ///FECHA_CREO : 21/Feb/2013 01:01 p.m. ///MODIFICO : ///FECHA_MODIFICO: ///CAUSA_MODIFICACIÓN: ///******************************************************************************* private void Btn_Salir_Click(object sender, EventArgs e) { if (Btn_Salir.Text == "Salir") { this.Close(); } else { Cls_Metodos_Generales.Limpia_Controles(Fra_Datos_Generales); Cls_Metodos_Generales.Habilita_Deshabilita_Controles(Fra_Datos_Generales, false); Btn_Transferir.Enabled = true; Btn_Salir.Enabled = true; Fra_Datos_Generales.Visible = true; Habilitar_Controles("Inicial"); Txt_Contenedor.Enabled = true; Txt_Contenedor.Focus(); Limpiar_Grid(); } }
///******************************************************************************* ///NOMBRE DE LA FUNCIÓN: Txt_Contenedor_KeyPress ///DESCRIPCIÓN :Evento KeyPress del Txt_Contenedor para validar la tecla enter /// como disparador de consulta ///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) { try { Cls_Cat_Contenedores_Negocio P_Contenedores = new Cls_Cat_Contenedores_Negocio(); DataTable Dt_Contenedor = new DataTable(); P_Contenedores.P_Codigo_Contenedor = Txt_Contenedor.Text.ToUpper().Replace("-", "").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_Baja.Visible) { Btn_Baja_Click(null, null); } } else { Txt_Contenedor_Id.Text = ""; Txt_Contenedor.Focus(); MessageBox.Show("*El contenedor no existe en el sistema ó \n*El contenedor esta INACTIVO ó, \n*El contenedor se encuentra en un embarque.", "Baja de contenedores", MessageBoxButtons.OK, MessageBoxIcon.Asterisk, MessageBoxDefaultButton.Button1); Limpiar_Grid(); } } catch { MessageBox.Show("Error al consultar los contenedores, favor de notificar a su administrador del sistema.", "Baja de contenedores", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1); } } }
///******************************************************************************* ///NOMBRE DE LA FUNCIÓN: Btn_Cargar_Contenedor_Click ///DESCRIPCIÓN : Evento del botón Nuevo cargar contenedor ///PARAMENTROS : ///CREO : Miguel Angel Bedolla Moreno ///FECHA_CREO : 12/Abr/2013 06:41 p.m. ///MODIFICO : ///FECHA_MODIFICO: ///CAUSA_MODIFICACIÓN: ///******************************************************************************* private void Btn_Cargar_Contenedor_Click(object sender, EventArgs e) { Cls_Cat_Contenedores_Negocio P_Contenedores = new Cls_Cat_Contenedores_Negocio(); DataTable Dt_Contenedor_Cargar = new DataTable(); P_Contenedores.P_Codigo_Contenedor = Txt_Contenedor.Text.ToUpper(); P_Contenedores.P_Estatus = " = 'ACTIVO'"; P_Contenedores.P_Contenedor_No_Embarque = true; Dt_Contenedor_Cargar = P_Contenedores.Consultar_Contenedores(); if (Dt_Contenedor_Cargar.Rows.Count > 0) { Txt_Contenedor_Id.Text = Dt_Contenedor_Cargar.Rows[0][Cat_Contenedores.Campo_Contenedor_Id].ToString(); Txt_Comentarios.Focus(); } else { Txt_Contenedor_Id.Text = ""; Txt_Contenedor.Focus(); MessageBox.Show("*El contenedor no existe en el sistema ó \n*El contenedor esta INACTIVO ó, \n*El contenedor se encuentra en un embarque.", "Entrada de contenedores", MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1); } if (Txt_Contenedor_Id.Text.Trim() != "") { DataRow Dr_Renglon_Nuevo; DataTable Dt_Contenedor = (DataTable)Grid_Contenedores_Entrada.DataSource; Dr_Renglon_Nuevo = Dt_Contenedor.NewRow(); Dr_Renglon_Nuevo["CONTENEDOR_ID"] = Txt_Contenedor_Id.Text; Dr_Renglon_Nuevo["COMENTARIOS"] = Txt_Comentarios.Text.ToUpper(); Dr_Renglon_Nuevo["CONTENEDOR"] = Txt_Contenedor.Text.ToUpper(); Dt_Contenedor.Rows.Add(Dr_Renglon_Nuevo); Dt_Contenedor.TableName = "CONT_ENTRADA"; Grid_Contenedores_Entrada.DataSource = Dt_Contenedor; Txt_Comentarios.Text = ""; Txt_Contenedor.Text = ""; Txt_Contenedor_Id.Text = ""; Txt_Contenedor.Focus(); } }
///******************************************************************************* ///NOMBRE DE LA FUNCIÓN: Txt_Contenedor_KeyPress ///DESCRIPCIÓN : Evento KeyPress del Txt_Contenedor para consultar el contenedor ingresado /// 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_Cat_Contenedores_Negocio P_Contenedores = new Cls_Cat_Contenedores_Negocio(); DataTable Dt_Contenedor_Cargar = new DataTable(); P_Contenedores.P_Codigo_Contenedor = Txt_Contenedor.Text.ToUpper().Replace("-", "").Replace("'", ""); P_Contenedores.P_Estatus = " = 'ACTIVO'"; P_Contenedores.P_Uso = " LIKE '%FG%'"; P_Contenedores.P_Contenedor_No_Embarque = true; Dt_Contenedor_Cargar = P_Contenedores.Consultar_Contenedores(); if (Dt_Contenedor_Cargar.Rows.Count > 0) { Txt_Contenedor_Id.Text = Dt_Contenedor_Cargar.Rows[0][Cat_Contenedores.Campo_Contenedor_Id].ToString(); Txt_Tipo_Contenedor_Id.Text = Dt_Contenedor_Cargar.Rows[0][Cat_Contenedores.Campo_Tipo_Contenedor_Id].ToString(); Txt_Tipo_Contenedor.Text = Dt_Contenedor_Cargar.Rows[0]["TIPO_CONTENEDOR"].ToString(); Txt_Contenedor_Modificar.Text = Txt_Contenedor.Text; } else { Txt_Contenedor_Id.Text = ""; Txt_Contenedor.Text = ""; Txt_Tipo_Contenedor.Text = ""; Txt_Tipo_Contenedor_Id.Text = ""; MessageBox.Show("*El contenedor no existe en el sistema ó, \n*El contenedor esta INACTIVO ó, \n*El contenedor es de uso interno ó, \n*El contenedor se encuentra en un embarque.", "Salida de contenedores", MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1); } if (Txt_Contenedor_Id.Text.Trim() != "") { for (int Cont_Contenedores = 0; Cont_Contenedores < Grid_Contenedores.Rows.Count; Cont_Contenedores++) { if (Grid_Contenedores.Rows[Cont_Contenedores].Cells[0].Value.ToString() == Txt_Contenedor_Id.Text) { Txt_Contenedor_Id.Text = ""; Txt_Contenedor.Text = ""; Txt_Tipo_Contenedor.Text = ""; Txt_Tipo_Contenedor_Id.Text = ""; MessageBox.Show("*El contenedor ya se encuentra cargado.", "Salida de contenedores", MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1); } } } if (Txt_Contenedor_Id.Text.Trim() != "") { Boolean Entro = false; for (int Cont_Contenedores = 0; Cont_Contenedores < Dt_Configuracion.Rows.Count; Cont_Contenedores++) { if (Dt_Configuracion.Rows[Cont_Contenedores][Cat_Tipos_Contenedores.Campo_Tipo_Contenedor_Id].ToString() == Txt_Tipo_Contenedor_Id.Text) { Entro = true; } } if (!Entro) { Txt_Contenedor_Id.Text = ""; Txt_Contenedor.Text = ""; Txt_Tipo_Contenedor.Text = ""; Txt_Tipo_Contenedor_Id.Text = ""; if (MessageBox.Show(this, "*El tipo de contenedor no se encuentra especificado en la órden de salida , ¿Está seguro que desea modificar la órden de Salida ?", "Salida de contenedores", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { Fra_Datos_Generales.Visible = false; Fra_Contenedores.Visible = false; Fra_Configuracion_Contenedores.Visible = true; Btn_Salir.Visible = false; Cmb_Tipo_Contenedor.Text = Dt_Contenedor_Cargar.Rows[0]["TIPO_CONTENEDOR"].ToString(); Cmb_Tipo_Contenedor.SelectedValue = Dt_Contenedor_Cargar.Rows[0][Ope_Detalles_Orden_Salida.Campo_Tipo_Contenedor_Id].ToString(); Txt_Cantidad.Enabled = true; Cmb_Tipo_Contenedor.Enabled = false; if (Txt_Contenedor_Modificar.Text.Trim() != "") { Cls_Ope_Embarques_Negocio P_Embarques = new Cls_Ope_Embarques_Negocio(); DataTable Dt_Contenedor_Cargar_Orden = new DataTable(); P_Embarques.P_No_Embarque = Txt_Embarque.Text; Dt_Contenedor_Cargar_Orden = P_Embarques.Consultar_Configuracion_Orden_Salida(); Grid_Orden_Salida_Contenedor.Rows.Clear(); for (int Cont_Contenedores = 0; Cont_Contenedores < Dt_Contenedor_Cargar_Orden.Rows.Count; Cont_Contenedores++) { Grid_Orden_Salida_Contenedor.Rows.Add(); Grid_Orden_Salida_Contenedor.Rows[Cont_Contenedores].Cells[0].Value = Dt_Contenedor_Cargar_Orden.Rows[Cont_Contenedores][Cat_Tipos_Contenedores.Campo_Tipo_Contenedor_Id].ToString(); Grid_Orden_Salida_Contenedor.Rows[Cont_Contenedores].Cells[1].Value = Dt_Contenedor_Cargar_Orden.Rows[Cont_Contenedores]["TIPO_CONTENEDOR"].ToString(); Grid_Orden_Salida_Contenedor.Rows[Cont_Contenedores].Cells[2].Value = Dt_Contenedor_Cargar_Orden.Rows[Cont_Contenedores]["CANTIDAD_CONTENEDOR"].ToString(); } } } else { Fra_Datos_Generales.Visible = true; Fra_Contenedores.Visible = true; Fra_Configuracion_Contenedores.Visible = false; Btn_Salir.Visible = true; } //MessageBox.Show("*El tipo de contenedor no se encuentra especificado en la órden de salida", "Salida de contenedores", MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1); } } if (Txt_Contenedor_Id.Text.Trim() != "") { Boolean Entro = false; for (int Cont_Contenedores = 0; Cont_Contenedores < Dt_Configuracion.Rows.Count; Cont_Contenedores++) { if (Dt_Configuracion.Rows[Cont_Contenedores][Cat_Tipos_Contenedores.Campo_Tipo_Contenedor_Id].ToString() == Txt_Tipo_Contenedor_Id.Text && (Convert.ToDouble(Dt_Configuracion.Rows[Cont_Contenedores]["CONTENEDORES"].ToString()) < Convert.ToDouble(Dt_Configuracion.Rows[Cont_Contenedores][Ope_Detalles_Orden_Salida.Campo_Cantidad_Contenedores].ToString()))) { Entro = true; } } if (!Entro) { Txt_Contenedor_Id.Text = ""; Txt_Contenedor.Text = ""; MessageBox.Show("*El tipo de contenedor: " + Txt_Tipo_Contenedor.Text + " se encuentra completo en la orden de salida.", "Salida de contenedores", MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1); Txt_Tipo_Contenedor.Text = ""; Txt_Tipo_Contenedor_Id.Text = ""; } } if (Txt_Contenedor_Id.Text.Trim() != "") { Grid_Contenedores.Rows.Add(); Grid_Contenedores.Rows[Grid_Contenedores.Rows.Count - 1].Cells[0].Value = Txt_Contenedor_Id.Text; Grid_Contenedores.Rows[Grid_Contenedores.Rows.Count - 1].Cells[1].Value = Dt_Contenedor_Cargar.Rows[0]["CODIGO_CONTENEDOR"].ToString(); for (int Cont_Contenedores = 0; Cont_Contenedores < Dt_Configuracion.Rows.Count; Cont_Contenedores++) { if (Dt_Configuracion.Rows[Cont_Contenedores][Cat_Tipos_Contenedores.Campo_Tipo_Contenedor_Id].ToString() == Txt_Tipo_Contenedor_Id.Text) { Dt_Configuracion.Rows[Cont_Contenedores]["CONTENEDORES"] = Convert.ToDouble(Dt_Configuracion.Rows[Cont_Contenedores]["CONTENEDORES"].ToString()) + 1; } } Txt_Contenedor_Id.Text = ""; Txt_Contenedor.Text = ""; Txt_Tipo_Contenedor.Text = ""; Txt_Tipo_Contenedor_Id.Text = ""; Txt_Contenedor.Focus(); Boolean Entro = false; for (int Cont_Contenedores = 0; Cont_Contenedores < Dt_Configuracion.Rows.Count; Cont_Contenedores++) { if ((Convert.ToDouble(Dt_Configuracion.Rows[Cont_Contenedores]["CONTENEDORES"].ToString()) < Convert.ToDouble(Dt_Configuracion.Rows[Cont_Contenedores][Ope_Detalles_Orden_Salida.Campo_Cantidad_Contenedores].ToString()))) { Entro = true; } } if (!Entro) { Btn_Nuevo_Click(null, null); } } } } }
///******************************************************************************* ///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(Fra_Datos_Generales, true); Cls_Metodos_Generales.Limpia_Controles(Fra_Datos_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.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(); } 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(Fra_Datos_Generales, false); Cls_Metodos_Generales.Limpia_Controles(Fra_Datos_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(); } } } }
///******************************************************************************* ///NOMBRE DE LA FUNCIÓN: Btn_Actualizar_Click ///DESCRIPCIÓN :Evento click del botón Btn_Actualizar ///PARAMENTROS : ///CREO : Yazmin Flores Ramirez ///FECHA_CREO : 22/Octubre/2014 ///MODIFICO : ///FECHA_MODIFICO: ///CAUSA_MODIFICACIÓN: ///******************************************************************************* private void Btn_Actualizar_Click(object sender, EventArgs e) { Boolean Entro = false; //if (Grid_Movimientos.Rows.Count > 0) //{ if (Grid_Movimientos.CurrentRow != null) { if (Grid_Movimientos.CurrentRow.Index > -1 && (Cmb_Ubicacion_Wip_Fg.SelectedIndex > 0 || Cmb_Ubicacion_Fg.SelectedIndex > 0)) { for (int Cont_Configuracion = 0; Cont_Configuracion < Grid_Movimientos.Rows.Count; Cont_Configuracion++) { if (Cmb_Ubicacion_Fg.Visible && Cmb_Ubicacion_Fg.SelectedIndex > 0) { if (Grid_Movimientos.Rows[Cont_Configuracion].Cells[0].Value.ToString() == Cmb_Ubicacion_Fg.SelectedValue.ToString() && Cont_Configuracion != Grid_Movimientos.CurrentRow.Index) { Entro = true; break; } } else if (Cmb_Ubicacion_Wip_Fg.Visible && Cmb_Ubicacion_Wip_Fg.SelectedIndex > 0) { if (Grid_Movimientos.Rows[Cont_Configuracion].Cells[0].Value.ToString() == Cmb_Ubicacion_Wip_Fg.SelectedValue.ToString() && Cont_Configuracion != Grid_Movimientos.CurrentRow.Index) { Entro = true; break; } } } if (!Entro) { if (Txt_Contenedor_Id.Text.Trim() != "" && Cmb_Ubicacion_Fg.Visible && Cmb_Ubicacion_Fg.SelectedIndex > 0) { Grid_Movimientos.Rows[Grid_Movimientos.Rows.Count - 1].Cells[0].Value = Txt_No_Entrada.Text; Grid_Movimientos.Rows[Grid_Movimientos.Rows.Count - 1].Cells[1].Value = Txt_Contenedor_Id.Text; Grid_Movimientos.Rows[Grid_Movimientos.Rows.Count - 1].Cells[2].Value = Txt_Contenedor.Text; Grid_Movimientos.Rows[Grid_Movimientos.Rows.Count - 1].Cells[3].Value = Cmb_Ubicacion_Fg.Text; Grid_Movimientos.Rows[Grid_Movimientos.Rows.Count - 1].Cells[4].Value = ""; Grid_Movimientos.Rows[Grid_Movimientos.Rows.Count - 1].Cells[5].Value = Txt_Observaciones.Text.ToUpper(); Grid_Movimientos.Rows[Grid_Movimientos.Rows.Count - 1].Cells[6].Value = Cmb_Ubicacion_Fg.SelectedValue.ToString(); Grid_Movimientos.Rows[Grid_Movimientos.Rows.Count - 1].Cells[6].ToolTipText = Cmb_Ubicacion_Fg.SelectedValue.ToString(); Grid_Movimientos.Rows[Grid_Movimientos.Rows.Count - 1].Cells[7].Value = Txt_Orden_Entrada.Text; Grid_Movimientos.Rows[Grid_Movimientos.Rows.Count - 1].Cells[8].Value = Txt_Fecha.Text; Grid_Movimientos.Rows[Grid_Movimientos.Rows.Count - 1].Cells[9].Value = Txt_Destino.Text; Txt_Contenedor.Text = ""; Txt_Contenedor_Id.Text = ""; Txt_Observaciones.Text = ""; Txt_Destino.Text = ""; Txt_Fecha.Text = ""; Txt_Orden_Entrada.Text = ""; Txt_No_Entrada.Text = ""; Txt_Contenedor.Focus(); Cmb_Ubicacion_Fg.SelectedIndex = 0; } else if (Txt_Contenedor_Id.Text.Trim() != "" && Cmb_Ubicacion_Wip_Fg.Visible && Cmb_Ubicacion_Wip_Fg.SelectedIndex > 0) { Grid_Movimientos.Rows[Grid_Movimientos.Rows.Count - 1].Cells[0].Value = Txt_No_Entrada.Text; Grid_Movimientos.Rows[Grid_Movimientos.Rows.Count - 1].Cells[1].Value = Txt_Contenedor_Id.Text; Grid_Movimientos.Rows[Grid_Movimientos.Rows.Count - 1].Cells[2].Value = Txt_Contenedor.Text; Grid_Movimientos.Rows[Grid_Movimientos.Rows.Count - 1].Cells[3].Value = Cmb_Ubicacion_Wip_Fg.Text; Grid_Movimientos.Rows[Grid_Movimientos.Rows.Count - 1].Cells[4].Value = ""; Grid_Movimientos.Rows[Grid_Movimientos.Rows.Count - 1].Cells[5].Value = Txt_Observaciones.Text.ToUpper(); Grid_Movimientos.Rows[Grid_Movimientos.Rows.Count - 1].Cells[6].Value = Cmb_Ubicacion_Wip_Fg.SelectedValue.ToString(); Grid_Movimientos.Rows[Grid_Movimientos.Rows.Count - 1].Cells[6].ToolTipText = Cmb_Ubicacion_Wip_Fg.SelectedValue.ToString(); Grid_Movimientos.Rows[Grid_Movimientos.Rows.Count - 1].Cells[7].Value = Txt_Orden_Entrada.Text; Grid_Movimientos.Rows[Grid_Movimientos.Rows.Count - 1].Cells[8].Value = Txt_Fecha.Text; Grid_Movimientos.Rows[Grid_Movimientos.Rows.Count - 1].Cells[9].Value = Txt_Destino.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(); Cmb_Ubicacion_Wip_Fg.SelectedIndex = 0; } ////Grid_Movimientos.Rows.Add(); //Grid_Movimientos.Rows[Grid_Movimientos.Rows.Count - 1].Cells[0].Value = Txt_No_Embarque.Text; //Grid_Movimientos.Rows[Grid_Movimientos.Rows.Count - 1].Cells[1].Value = Txt_Contenedor_Id.Text; //Grid_Movimientos.Rows[Grid_Movimientos.Rows.Count - 1].Cells[2].Value = Txt_Contenedor.Text; //Grid_Movimientos.Rows[Grid_Movimientos.Rows.Count - 1].Cells[3].Value = Cmb_Ubicacion_Wip_Fg.Text; //Grid_Movimientos.Rows[Grid_Movimientos.Rows.Count - 1].Cells[4].Value = ""; //Grid_Movimientos.Rows[Grid_Movimientos.Rows.Count - 1].Cells[5].Value = Txt_Observaciones.Text.ToUpper(); //Grid_Movimientos.Rows[Grid_Movimientos.Rows.Count - 1].Cells[3].Value = Cmb_Ubicacion_Wip_Fg.SelectedValue.ToString(); //Grid_Movimientos.Rows[Grid_Movimientos.Rows.Count - 1].Cells[6].ToolTipText = Cmb_Ubicacion_Wip_Fg.SelectedValue.ToString(); //Grid_Movimientos.Rows[Grid_Movimientos.Rows.Count - 1].Cells[7].Value = Txt_Orden_Salida.Text; //Grid_Movimientos.Rows[Grid_Movimientos.Rows.Count - 1].Cells[8].Value = Txt_Fecha.Text; //Grid_Movimientos.Rows[Grid_Movimientos.Rows.Count - 1].Cells[9].Value = Txt_Destino.Text; //Txt_Contenedor.Text = ""; //Txt_Contenedor_Id.Text = ""; //Txt_Observaciones.Text = ""; //Txt_Destino.Text = ""; //Txt_Fecha.Text = ""; //Txt_No_Embarque.Text = ""; //Txt_Orden_Salida.Text = ""; //Txt_Contenedor.Focus(); //Cmb_Ubicacion_Wip_Fg.SelectedIndex = -1; } else { MessageBox.Show(this, "No se puede actualizar el registro seleccionado", "Recepcion de contenedores", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } } } //else //{ // MessageBox.Show(this, "No se puede actualizar no se encuentar ningun registro seleccionado", "Recepcion de contenedores", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); //} //} }
///******************************************************************************* ///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_Nuevo_Click ///DESCRIPCIÓN : Evento del botón Nuevo ///PARAMENTROS : ///CREO : Miguel Angel Bedolla Moreno ///FECHA_CREO : 12/Abr/2013 06:41 p.m. ///MODIFICO : ///FECHA_MODIFICO: ///CAUSA_MODIFICACIÓN: ///******************************************************************************* private void Btn_Nuevo_Click(object sender, EventArgs e) { if (Btn_Nuevo.Text == "Nuevo") { Habilitar_Controles("Nuevo"); Cls_Metodos_Generales.Habilita_Deshabilita_Controles(Pnl_Generales, true); Lbl_Cantidad.Visible = false; Txt_Cantidad.Visible = false; Grid_Contenedores_Entrada.Enabled = true; Txt_Fecha.Enabled = false; Txt_Cantidad.Enabled = false; Txt_Destino.Enabled = false; Pnl_Generales.Visible = true; Txt_Contenedor_Id.Text = ""; Txt_Contenedor.Text = ""; Txt_Comentarios.Text = ""; Txt_Observaciones_Contenedor.Text = ""; Txt_Comentarios.Enabled = false; Txt_Fecha.Enabled = false; Txt_Cantidad.Enabled = false; Txt_Orden_Entrada.Enabled = false; Txt_Contenedor.Focus(); DataTable Dt_Contenedor = new DataTable(); Dt_Contenedor.Columns.Add("NO_ENTRADA", typeof(String)); Dt_Contenedor.Columns.Add("CONTENEDOR", typeof(String)); Dt_Contenedor.Columns.Add("CONTENEDOR_ID", typeof(String)); Dt_Contenedor.Columns.Add("UBICACION", typeof(String)); Dt_Contenedor.Columns.Add("UBICACION_ID", typeof(String)); Dt_Contenedor.Columns.Add("OBSERVACIONES_CONTENEDOR", typeof(String)); Dt_Contenedor.Columns.Add("COMENTARIOS", typeof(String)); Dt_Contenedor.Columns.Add("CANTIDAD", typeof(String)); Dt_Contenedor.TableName = "ENTRADAS"; Grid_Contenedores_Entrada.DataSource = Dt_Contenedor; } else { if (Validar_Componentes()) { Cls_Ope_Entradas_Negocio P_Entrada = new Cls_Ope_Entradas_Negocio(); P_Entrada.P_No_Entrada = Txt_No_Entrada.Text; P_Entrada.P_Estatus = "INACTIVO"; P_Entrada.P_Recibio = Txt_Nombre_Usuario.Text.ToUpper(); P_Entrada.P_Usuario = Txt_Nombre_Usuario.Text.ToUpper(); P_Entrada.P_Cantidad = Txt_Cantidad.Text.ToUpper(); P_Entrada.P_Dt_Contenedores = (DataTable)Grid_Contenedores_Entrada.DataSource; if (P_Entrada.Alta_Recepcion_Entrada()) { //Enviar_Correo(P_Entrada.P_No_Entrada, P_Entrada.P_Dt_Contenedores); Habilitar_Controles("Inicial"); Cls_Metodos_Generales.Habilita_Deshabilita_Controles(Pnl_Generales, false); Cls_Metodos_Generales.Limpia_Controles(Pnl_Generales); Lbl_Cantidad.Visible = false; Txt_Cantidad.Visible = false; Pnl_Generales.Visible = true; DataTable Dt_Contenedores = new DataTable(); Cls_Cat_Ubicaciones_Negocio P_Ubicaciones = new Cls_Cat_Ubicaciones_Negocio(); P_Ubicaciones.P_Estatus = " = 'ACTIVO'"; P_Ubicaciones.P_Clasificacion = " LIKE '%FG%'"; Dt_Contenedores = P_Ubicaciones.Consultar_Ubicaciones(); Cls_Metodos_Generales.Rellena_Combo_Box(Cmb_Ubicacion_Fg, Dt_Contenedores, Cat_Ubicaciones.Campo_Ubicacion, Cat_Ubicaciones.Campo_Ubicacion_Id); P_Ubicaciones.P_Clasificacion = " LIKE '%FG%' OR " + Cat_Ubicaciones.Campo_Clasificacion + " LIKE '%WIP%'"; Dt_Contenedores = P_Ubicaciones.Consultar_Ubicaciones(); Cls_Metodos_Generales.Rellena_Combo_Box(Cmb_Ubicacion_Wip_Fg, Dt_Contenedores, Cat_Ubicaciones.Campo_Ubicacion, Cat_Ubicaciones.Campo_Ubicacion_Id); Limpiar_Grid(); MessageBox.Show("Transferencia exitosa. La fecha de recepción es: " + P_Entrada.P_Fecha_Recepcion + "", "Recepción de contenedores", MessageBoxButtons.OK, MessageBoxIcon.Asterisk, MessageBoxDefaultButton.Button1); } } } }
///******************************************************************************* ///NOMBRE DE LA FUNCIÓN: Btn_Cargar_Contenedor_Click ///DESCRIPCIÓN : Evento del botón Nuevo cargar contenedor ///PARAMENTROS : ///CREO : Miguel Angel Bedolla Moreno ///FECHA_CREO : 12/Abr/2013 06:41 p.m. ///MODIFICO : ///FECHA_MODIFICO: ///CAUSA_MODIFICACIÓN: ///******************************************************************************* private void Btn_Cargar_Contenedor_Click(object sender, EventArgs e) { if (Txt_Contenedor_Id.Text.Trim() != "") { for (int Cont_Contenedores = 0; Cont_Contenedores < Grid_Movimientos.Rows.Count; Cont_Contenedores++) { if (Grid_Movimientos.Rows[Cont_Contenedores].Cells[1].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 fue registrado anteriormente en esta recepción de contenedores.", "Recepción de contenedores", MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1); return; } } } if (Txt_Contenedor_Id.Text.Trim() != "" && Cmb_Ubicacion_Fg.Visible && Cmb_Ubicacion_Fg.SelectedIndex > 0) { Grid_Movimientos.Rows.Add(); Grid_Movimientos.Rows[Grid_Movimientos.Rows.Count - 1].Cells[0].Value = Txt_No_Entrada.Text; Grid_Movimientos.Rows[Grid_Movimientos.Rows.Count - 1].Cells[1].Value = Txt_Contenedor_Id.Text; Grid_Movimientos.Rows[Grid_Movimientos.Rows.Count - 1].Cells[2].Value = Txt_Contenedor.Text; Grid_Movimientos.Rows[Grid_Movimientos.Rows.Count - 1].Cells[3].Value = Cmb_Ubicacion_Fg.Text; Grid_Movimientos.Rows[Grid_Movimientos.Rows.Count - 1].Cells[4].Value = ""; Grid_Movimientos.Rows[Grid_Movimientos.Rows.Count - 1].Cells[5].Value = Txt_Observaciones.Text.ToUpper(); Grid_Movimientos.Rows[Grid_Movimientos.Rows.Count - 1].Cells[6].Value = Cmb_Ubicacion_Fg.SelectedValue.ToString(); Grid_Movimientos.Rows[Grid_Movimientos.Rows.Count - 1].Cells[6].ToolTipText = Cmb_Ubicacion_Fg.SelectedValue.ToString(); Grid_Movimientos.Rows[Grid_Movimientos.Rows.Count - 1].Cells[7].Value = Txt_Orden_Entrada.Text; Grid_Movimientos.Rows[Grid_Movimientos.Rows.Count - 1].Cells[8].Value = Txt_Fecha.Text; Grid_Movimientos.Rows[Grid_Movimientos.Rows.Count - 1].Cells[9].Value = Txt_Destino.Text; Txt_Contenedor.Text = ""; Txt_Contenedor_Id.Text = ""; Txt_Observaciones.Text = ""; Txt_Destino.Text = ""; Txt_Fecha.Text = ""; Txt_Orden_Entrada.Text = ""; Txt_No_Entrada.Text = ""; Txt_Contenedor.Focus(); Cmb_Ubicacion_Fg.SelectedIndex = 0; } else if (Txt_Contenedor_Id.Text.Trim() != "" && Cmb_Ubicacion_Wip_Fg.Visible && Cmb_Ubicacion_Wip_Fg.SelectedIndex > 0) { Grid_Movimientos.Rows.Add(); Grid_Movimientos.Rows[Grid_Movimientos.Rows.Count - 1].Cells[0].Value = Txt_No_Entrada.Text; Grid_Movimientos.Rows[Grid_Movimientos.Rows.Count - 1].Cells[1].Value = Txt_Contenedor_Id.Text; Grid_Movimientos.Rows[Grid_Movimientos.Rows.Count - 1].Cells[2].Value = Txt_Contenedor.Text; Grid_Movimientos.Rows[Grid_Movimientos.Rows.Count - 1].Cells[3].Value = Cmb_Ubicacion_Wip_Fg.Text; Grid_Movimientos.Rows[Grid_Movimientos.Rows.Count - 1].Cells[4].Value = ""; Grid_Movimientos.Rows[Grid_Movimientos.Rows.Count - 1].Cells[5].Value = Txt_Observaciones.Text.ToUpper(); Grid_Movimientos.Rows[Grid_Movimientos.Rows.Count - 1].Cells[6].Value = Cmb_Ubicacion_Wip_Fg.SelectedValue.ToString(); Grid_Movimientos.Rows[Grid_Movimientos.Rows.Count - 1].Cells[6].ToolTipText = Cmb_Ubicacion_Wip_Fg.SelectedValue.ToString(); Grid_Movimientos.Rows[Grid_Movimientos.Rows.Count - 1].Cells[7].Value = Txt_Orden_Entrada.Text; Grid_Movimientos.Rows[Grid_Movimientos.Rows.Count - 1].Cells[8].Value = Txt_Fecha.Text; Grid_Movimientos.Rows[Grid_Movimientos.Rows.Count - 1].Cells[9].Value = Txt_Destino.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(); Cmb_Ubicacion_Wip_Fg.SelectedIndex = 0; } else { MessageBox.Show("Faltan datos por llenar", "Recepción de contenedores", MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1); } }
///******************************************************************************* ///NOMBRE DE LA FUNCIÓN: Btn_Cargar_Contenedor_Click ///DESCRIPCIÓN : Evento del botón Nuevo cargar contenedor ///PARAMENTROS : ///CREO : Miguel Angel Bedolla Moreno ///FECHA_CREO : 12/Abr/2013 06:41 p.m. ///MODIFICO : ///FECHA_MODIFICO: ///CAUSA_MODIFICACIÓN: ///******************************************************************************* private void Btn_Cargar_Contenedor_Click(object sender, EventArgs e) { if (Txt_Contenedor_Id.Text.Trim() != "") { DataTable Dt_Contenedores = (DataTable)Grid_Contenedores_Entrada.DataSource; foreach (DataRow Dr_Contenedor in Dt_Contenedores.Rows) { if (Dr_Contenedor["CONTENEDOR_ID"].ToString() == Txt_Contenedor_Id.Text) { Txt_Comentarios.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 fue registrado anteriormente en esta recepción de contenedores.", "Recepción de contenedores", MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1); return; } } } if (Txt_Contenedor_Id.Text.Trim() != "" && Cmb_Ubicacion_Fg.Visible && Cmb_Ubicacion_Fg.SelectedIndex > 0) { DataRow Dr_Renglon_Nuevo; DataTable Dt_Contenedor = (DataTable)Grid_Contenedores_Entrada.DataSource; Dr_Renglon_Nuevo = Dt_Contenedor.NewRow(); Dr_Renglon_Nuevo["NO_ENTRADA"] = Txt_No_Entrada.Text; Dr_Renglon_Nuevo["CONTENEDOR_ID"] = Txt_Contenedor_Id.Text; Dr_Renglon_Nuevo["COMENTARIOS"] = Txt_Comentarios.Text.ToUpper(); Dr_Renglon_Nuevo["CONTENEDOR"] = Txt_Contenedor.Text.ToUpper(); Dr_Renglon_Nuevo["OBSERVACIONES_CONTENEDOR"] = Txt_Observaciones_Contenedor.Text.ToUpper(); Dr_Renglon_Nuevo["UBICACION_ID"] = Cmb_Ubicacion_Fg.SelectedValue.ToString(); Dr_Renglon_Nuevo["UBICACION"] = Cmb_Ubicacion_Fg.Text; if (Txt_Cantidad.Text.Trim() != "") { Dr_Renglon_Nuevo["CANTIDAD"] = Txt_Cantidad.Text; } Dt_Contenedor.Rows.Add(Dr_Renglon_Nuevo); Dt_Contenedor.TableName = "ENTRADAS"; Grid_Contenedores_Entrada.DataSource = Dt_Contenedor; Txt_Comentarios.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(); } else if (Txt_Contenedor_Id.Text.Trim() != "" && Cmb_Ubicacion_Wip_Fg.Visible && Cmb_Ubicacion_Wip_Fg.SelectedIndex > 0) { DataRow Dr_Renglon_Nuevo; DataTable Dt_Contenedor = (DataTable)Grid_Contenedores_Entrada.DataSource; Dr_Renglon_Nuevo = Dt_Contenedor.NewRow(); Dr_Renglon_Nuevo["NO_ENTRADA"] = Txt_No_Entrada.Text; Dr_Renglon_Nuevo["CONTENEDOR_ID"] = Txt_Contenedor_Id.Text; Dr_Renglon_Nuevo["COMENTARIOS"] = Txt_Comentarios.Text.ToUpper(); Dr_Renglon_Nuevo["CONTENEDOR"] = Txt_Contenedor.Text.ToUpper(); Dr_Renglon_Nuevo["OBSERVACIONES_CONTENEDOR"] = Txt_Observaciones_Contenedor.Text.ToUpper(); Dr_Renglon_Nuevo["UBICACION_ID"] = Cmb_Ubicacion_Wip_Fg.SelectedValue.ToString(); Dr_Renglon_Nuevo["UBICACION"] = Cmb_Ubicacion_Wip_Fg.Text; if (Txt_Cantidad.Text.Trim() != "") { Dr_Renglon_Nuevo["CANTIDAD"] = Txt_Cantidad.Text; } Dt_Contenedor.Rows.Add(Dr_Renglon_Nuevo); Dt_Contenedor.TableName = "ENTRADAS"; Grid_Contenedores_Entrada.DataSource = Dt_Contenedor; Txt_Comentarios.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(); } else { MessageBox.Show("Faltan datos por llenar", "Recepción de contenedores", MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1); } }
///******************************************************************************* ///NOMBRE DE LA FUNCIÓN: Btn_Nuevo_Click ///DESCRIPCIÓN : Evento del botón Nuevo ///PARAMENTROS : ///CREO : Miguel Angel Bedolla Moreno ///FECHA_CREO : 12/Abr/2013 06:41 p.m. ///MODIFICO : ///FECHA_MODIFICO: ///CAUSA_MODIFICACIÓN: ///******************************************************************************* private void Btn_Nuevo_Click(object sender, EventArgs e) { if (Btn_Nuevo.Text == "Nuevo") { Habilitar_Controles("Nuevo"); Cls_Metodos_Generales.Habilita_Deshabilita_Controles(Pnl_Generales, true); Cls_Metodos_Generales.Habilita_Deshabilita_Controles(Pnl_Busqueda, false); Cls_Metodos_Generales.Limpia_Controles(Pnl_Busqueda); Grid_Contenedores_Entrada.Enabled = true; Txt_Fecha.Enabled = false; Txt_Realizo.Enabled = false; Txt_Realizo.Text = Txt_Nombre_Usuario.Text.ToUpper(); Pnl_Generales.Visible = true; Pnl_Busqueda.Visible = false; Txt_Orden_Entrada.Enabled = false; Txt_Contenedor_Id.Text = ""; Cmb_Destinos.Enabled = false; Txt_Observaciones.Enabled = false; DataTable Dt_Contenedor = new DataTable(); Dt_Contenedor.Columns.Add("CONTENEDOR_ID", typeof(String)); Dt_Contenedor.Columns.Add("CONTENEDOR", typeof(String)); Dt_Contenedor.Columns.Add("COMENTARIOS", typeof(String)); Dt_Contenedor.TableName = "CONT_ENTRADA"; Grid_Contenedores_Entrada.DataSource = Dt_Contenedor; Txt_Contenedor.Enabled = true; Txt_Contenedor.Focus(); } else { if (Validar_Componentes()) { Cls_Ope_Entradas_Negocio P_Entrada = new Cls_Ope_Entradas_Negocio(); P_Entrada.P_No_Entrada = Txt_No_Entrada.Text; P_Entrada.P_Estatus = "CERRADO"; P_Entrada.P_Dt_Contenedores = (DataTable)Grid_Contenedores_Entrada.DataSource; if (P_Entrada.Cerrar_Entrada_Handheld()) { //Enviar_Correo(P_Entrada.P_No_Entrada, P_Entrada.P_Dt_Contenedores); Habilitar_Controles("Inicial"); Cls_Metodos_Generales.Habilita_Deshabilita_Controles(Pnl_Generales, false); Cls_Metodos_Generales.Habilita_Deshabilita_Controles(Pnl_Busqueda, true); Cls_Metodos_Generales.Limpia_Controles(Pnl_Generales); Cls_Metodos_Generales.Limpia_Controles(Pnl_Busqueda); Grid_Contenedores.Enabled = true; Pnl_Generales.Visible = false; Pnl_Busqueda.Visible = true; Consultar_Entradas(false); DataTable Dt_Contenedores = new DataTable(); Cls_Cat_Destinos_Negocio P_Contenedores = new Cls_Cat_Destinos_Negocio(); P_Contenedores.P_Estatus = " = 'ACTIVO'"; Dt_Contenedores = P_Contenedores.Consultar_Destinos(); DataTable Dt_Destinos = Dt_Contenedores.Copy(); Cls_Metodos_Generales.Rellena_Combo_Box(Cmb_Destinos, Dt_Contenedores, Cat_Destinos.Campo_Destino, Cat_Destinos.Campo_Destino_Id); Cls_Metodos_Generales.Rellena_Combo_Box(Cmb_Busqueda_Destino, Dt_Destinos, Cat_Destinos.Campo_Destino, Cat_Destinos.Campo_Destino_Id); MessageBox.Show("Transferencia exitosa. La fecha de envío es: " + P_Entrada.P_Fecha_Envio + "", "Entrada de contenedores", MessageBoxButtons.OK, MessageBoxIcon.Asterisk, MessageBoxDefaultButton.Button1); Grid_Contenedores_Entrada.Enabled = true; } } } }
///******************************************************************************* ///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 : Evento KeyPress del Txt_Contenedor para consultar el contenedor ingresado /// 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) { if (Txt_Contenedor.Text.Trim() != "") { Cls_Cat_Contenedores_Negocio P_Contenedores = new Cls_Cat_Contenedores_Negocio(); DataTable Dt_Contenedor_Cargar = new DataTable(); P_Contenedores.P_Codigo_Contenedor = Txt_Contenedor.Text.ToUpper().Replace("-", ""); P_Contenedores.P_Estatus = " = 'ACTIVO'"; P_Contenedores.P_Uso = " LIKE '%FG%'"; P_Contenedores.P_Contenedor_No_Embarque = true; Dt_Contenedor_Cargar = P_Contenedores.Consultar_Contenedores(); if (Dt_Contenedor_Cargar.Rows.Count > 0) { Txt_Contenedor_Id.Text = Dt_Contenedor_Cargar.Rows[0][Cat_Contenedores.Campo_Contenedor_Id].ToString(); Txt_Tipo_Contenedor_Id.Text = Dt_Contenedor_Cargar.Rows[0][Cat_Contenedores.Campo_Tipo_Contenedor_Id].ToString(); Txt_Tipo_Contenedor.Text = Dt_Contenedor_Cargar.Rows[0]["TIPO_CONTENEDOR"].ToString(); } else { Txt_Contenedor_Id.Text = ""; Txt_Contenedor.Text = ""; Txt_Tipo_Contenedor.Text = ""; Txt_Tipo_Contenedor_Id.Text = ""; MessageBox.Show("*El contenedor no existe en el sistema ó \n*El contenedor esta INACTIVO ó, \n*El contenedor se encuentra en un embarque.", "Entrada de contenedores", MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1); } if (Txt_Contenedor_Id.Text.Trim() != "") { DataTable Dt_Contenedores = (DataTable)Grid_Contenedores_Entrada.DataSource; foreach (DataRow Dr_Contenedor in Dt_Contenedores.Rows) { if (Dr_Contenedor["CONTENEDOR_ID"].ToString() == Txt_Contenedor_Id.Text) { Txt_Contenedor_Id.Text = ""; Txt_Contenedor.Text = ""; Txt_Tipo_Contenedor.Text = ""; Txt_Tipo_Contenedor_Id.Text = ""; MessageBox.Show("*El contenedor ya se encuentra cargado.", "Entrada de contenedores", MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1); } } } if (Txt_Contenedor_Id.Text.Trim() != "") { Boolean Entro = false; for (int Cont_Contenedores = 0; Cont_Contenedores < Dt_Configuracion.Rows.Count; Cont_Contenedores++) { if (Dt_Configuracion.Rows[Cont_Contenedores][Cat_Tipos_Contenedores.Campo_Tipo_Contenedor_Id].ToString() == Txt_Tipo_Contenedor_Id.Text) { Entro = true; } } if (!Entro) { Txt_Contenedor_Id.Text = ""; Txt_Contenedor.Text = ""; Txt_Tipo_Contenedor.Text = ""; Txt_Tipo_Contenedor_Id.Text = ""; MessageBox.Show("*El tipo de contenedor no se encuentra especificado en la órden de salida", "Entrada de contenedores", MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1); } } if (Txt_Contenedor_Id.Text.Trim() != "") { Boolean Entro = false; for (int Cont_Contenedores = 0; Cont_Contenedores < Dt_Configuracion.Rows.Count; Cont_Contenedores++) { if (Dt_Configuracion.Rows[Cont_Contenedores][Cat_Tipos_Contenedores.Campo_Tipo_Contenedor_Id].ToString() == Txt_Tipo_Contenedor_Id.Text && (Convert.ToDouble(Dt_Configuracion.Rows[Cont_Contenedores]["CONTENEDORES"].ToString()) < Convert.ToDouble(Dt_Configuracion.Rows[Cont_Contenedores][Ope_Detalles_Orden_Salida.Campo_Cantidad_Contenedores].ToString()))) { Entro = true; } } if (!Entro) { Txt_Contenedor_Id.Text = ""; Txt_Contenedor.Text = ""; MessageBox.Show("*El tipo de contenedor: " + Txt_Tipo_Contenedor.Text + " se encuentra completo en la orden de salida.", "Entrada de contenedores", MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1); Txt_Tipo_Contenedor.Text = ""; Txt_Tipo_Contenedor_Id.Text = ""; } } if (Txt_Contenedor_Id.Text.Trim() != "") { DataRow Dr_Renglon_Nuevo; DataTable Dt_Contenedor = (DataTable)Grid_Contenedores_Entrada.DataSource; Dr_Renglon_Nuevo = Dt_Contenedor.NewRow(); Dr_Renglon_Nuevo["CONTENEDOR_ID"] = Txt_Contenedor_Id.Text; Dr_Renglon_Nuevo["COMENTARIOS"] = ""; Dr_Renglon_Nuevo["CONTENEDOR"] = Dt_Contenedor_Cargar.Rows[0]["CODIGO_CONTENEDOR"].ToString(); Dt_Contenedor.Rows.Add(Dr_Renglon_Nuevo); Dt_Contenedor.TableName = "CONT_ENTRADA"; Grid_Contenedores_Entrada.DataSource = Dt_Contenedor; for (int Cont_Contenedores = 0; Cont_Contenedores < Dt_Configuracion.Rows.Count; Cont_Contenedores++) { if (Dt_Configuracion.Rows[Cont_Contenedores][Cat_Tipos_Contenedores.Campo_Tipo_Contenedor_Id].ToString() == Txt_Tipo_Contenedor_Id.Text) { Dt_Configuracion.Rows[Cont_Contenedores]["CONTENEDORES"] = Convert.ToDouble(Dt_Configuracion.Rows[Cont_Contenedores]["CONTENEDORES"].ToString()) + 1; } } Txt_Comentarios.Text = ""; Txt_Contenedor.Text = ""; Txt_Contenedor_Id.Text = ""; Txt_Contenedor.Focus(); Boolean Entro = false; for (int Cont_Contenedores = 0; Cont_Contenedores < Dt_Configuracion.Rows.Count; Cont_Contenedores++) { if ((Convert.ToDouble(Dt_Configuracion.Rows[Cont_Contenedores]["CONTENEDORES"].ToString()) < Convert.ToDouble(Dt_Configuracion.Rows[Cont_Contenedores][Ope_Detalles_Orden_Salida.Campo_Cantidad_Contenedores].ToString()))) { Entro = true; } } if (!Entro) { Btn_Nuevo_Click(null, null); } } } } }