示例#1
0
 ///*******************************************************************************
 ///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();
         }
     }
 }
示例#2
0
 ///*******************************************************************************
 ///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);
         }
     }
 }
示例#3
0
 ///*******************************************************************************
 ///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);
         }
     }
 }