///******************************************************************************* ///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_Salida.Text = ""; Grid_Movimientos.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 = "INACTIVO"; P_Embarque.P_Recibio = MDI_Frm_Apl_Principal.Nombre_Usuario; P_Embarque.P_Grid_Detalles = Grid_Movimientos; if (P_Embarque.Alta_Recepcion_Embarque()) { //Enviar_Correo(P_Embarque.P_No_Embarque, P_Embarque.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_Embarque.P_Fecha_Recepcion + "", "Recepción 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(Pnl_Generales, true); Lbl_Cantidad.Visible = false; Txt_Cantidad.Visible = false; Grid_Contenedores_Embarque.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_Salida.Enabled = false; Txt_Contenedor.Focus(); DataTable Dt_Contenedor = new DataTable(); Dt_Contenedor.Columns.Add("NO_EMBARQUE", 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 = "EMBARQUES"; Grid_Contenedores_Embarque.DataSource = Dt_Contenedor; } 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 = "INACTIVO"; P_Embarque.P_Recibio = Txt_Nombre_Usuario.Text.ToUpper(); P_Embarque.P_Usuario = Txt_Nombre_Usuario.Text.ToUpper(); P_Embarque.P_Cantidad = Txt_Cantidad.Text.ToUpper(); P_Embarque.P_Dt_Contenedores = (DataTable)Grid_Contenedores_Embarque.DataSource; if (P_Embarque.Alta_Recepcion_Embarque()) { //Enviar_Correo(P_Embarque.P_No_Embarque, P_Embarque.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_Embarque.P_Fecha_Recepcion + "", "Recepción de contenedores", MessageBoxButtons.OK, MessageBoxIcon.Asterisk, MessageBoxDefaultButton.Button1); } } } }