///******************************************************************************* ///NOMBRE DE LA FUNCIÓN: Btn_Salir_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_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_Busqueda); Cls_Metodos_Generales.Limpia_Controles(Pnl_Generales); Cls_Metodos_Generales.Habilita_Deshabilita_Controles(Pnl_Generales, false); Cls_Metodos_Generales.Habilita_Deshabilita_Controles(Pnl_Busqueda, true); Grid_Contenedores_Entrada.Enabled = true; Btn_Nuevo.Enabled = true; Btn_Salir.Enabled = true; Pnl_Generales.Visible = false; Pnl_Busqueda.Visible = true; Habilitar_Controles("Inicial"); Grid_Contenedores_Entrada.Enabled = true; Cls_Cat_Destinos_Negocio P_Contenedores = new Cls_Cat_Destinos_Negocio(); DataTable Dt_Contenedores; 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); Cmb_Busqueda_Destino.Focus(); } }
///******************************************************************************* ///NOMBRE DE LA FUNCIÓN: Frm_Ope_Ordenes_Salida_Especiales_Load ///DESCRIPCIÓN : ///PARAMENTROS : ///CREO : Hugo Enrique Ramírez Aguilera ///FECHA_CREO : 30/Julio/2015 ///MODIFICO : ///FECHA_MODIFICO: ///CAUSA_MODIFICACIÓN: ///******************************************************************************* private void Frm_Ope_Ordenes_Salida_Especiales_Load(object sender, EventArgs e) { Habilitar_Controles("Inicial"); Cls_Metodos_Generales.Habilita_Deshabilita_Controles(Grp_Datos_Contenedores_Salida, false); Cls_Metodos_Generales.Habilita_Deshabilita_Controles(Grp_Ordenes_Salida, true); Cls_Metodos_Generales.Habilita_Deshabilita_Controles(Fra_Busqueda, false); // se cargan los combos de contenedores Cls_Cat_Tipos_Contenedores_Negocio P_Tipos_Contenedores = new Cls_Cat_Tipos_Contenedores_Negocio(); P_Tipos_Contenedores.P_Estatus = " = 'ACTIVO'"; Cls_Metodos_Generales.Rellena_Combo_Box(Cmb_Contenedores, P_Tipos_Contenedores.Consultar_Pseudocodigos(), "PSEUDO_CODIGO", Cat_Tipos_Contenedores.Campo_Tipo_Contenedor_Id); // se cargan los combos de ubicacion Cls_Cat_Destinos_Negocio P_Ubicaciones = new Cls_Cat_Destinos_Negocio(); P_Ubicaciones.P_Estatus = " = 'ACTIVO'"; Cls_Metodos_Generales.Rellena_Combo_Box(Cmb_Ubicaciones, P_Ubicaciones.Consultar_Destinos(), Cat_Destinos.Campo_Destino, Cat_Destinos.Campo_Destino_Id); // se limpian los objetos del formulario Cls_Metodos_Generales.Limpia_Controles(Grp_Datos_Contenedores_Salida); Cls_Metodos_Generales.Limpia_Controles(Grp_Ordenes_Salida); // se consultan las salidas Consultar_Salidas(); Validador = new Validador_Generico(Error_Provider); Error_Provider.Clear(); // se bloquean los botones de los contenedores Btn_Agregar.Enabled = false; Btn_Actualizar.Enabled = false; Btn_Quitar.Enabled = false; }
///******************************************************************************* ///NOMBRE DE LA FUNCIÓN: Btn_Salir_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_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); Lbl_Cantidad.Visible = false; Txt_Cantidad.Visible = false; Btn_Nuevo.Enabled = true; Btn_Salir.Enabled = true; Pnl_Generales.Visible = true; Limpiar_Grid(); Habilitar_Controles("Inicial"); Cls_Cat_Ubicaciones_Negocio P_Ubicaciones = new Cls_Cat_Ubicaciones_Negocio(); P_Ubicaciones.P_Estatus = " = 'ACTIVO'"; P_Ubicaciones.P_Clasificacion = " LIKE '%FG%'"; DataTable Dt_Contenedores; 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); } }
///******************************************************************************* ///NOMBRE DE LA FUNCIÓN: Frm_Ope_Ordenes_Entrada_Especiales_Load ///DESCRIPCIÓN : Método Load del formulario para pre-configurar y cagar datos en los controles ///PARAMENTROS : ///CREO : Antonio Salvador Benavides Guardado ///FECHA_CREO : 31/Jul/2015 ///MODIFICO : ///FECHA_MODIFICO: ///CAUSA_MODIFICACIÓN: ///******************************************************************************* private void Frm_Ope_Ordenes_Entrada_Especiales_Load(object sender, EventArgs e) { DataTable Dt_Contenedores = new DataTable(); Cls_Metodos_Generales.Habilita_Deshabilita_Controles(Pnl_Generales, false); Cls_Metodos_Generales.Limpia_Controles(Pnl_Generales); Pnl_Generales.Visible = true; Cls_Cat_Ubicaciones_Negocio P_Ubicaciones = new Cls_Cat_Ubicaciones_Negocio(); P_Ubicaciones.P_Estatus = " = 'ACTIVO'"; Dt_Contenedores = P_Ubicaciones.Consultar_Ubicaciones(); Cls_Metodos_Generales.Rellena_Combo_Box(Cmb_Ubicacion, Dt_Contenedores, Cat_Ubicaciones.Campo_Ubicacion, Cat_Ubicaciones.Campo_Ubicacion_Id); Btn_Nuevo_Click(null, null); Cls_Apl_Roles_Negocio P_Rol = new Cls_Apl_Roles_Negocio(); DataTable Dt_Accesos; P_Rol.P_Rol_Id = Txt_Rol_Id.Text; P_Rol.P_Nombre_Menu = "Órdenes de Entrada Especiales"; Dt_Accesos = P_Rol.Consultar_Acceso_Roles(); Btn_Nuevo.Visible = false; Pnl_Generales.Enabled = false; foreach (DataRow Dr_Renglon_Actual in Dt_Accesos.Rows) { if (Dr_Renglon_Actual[Apl_Acceso.Campo_Alta].ToString() == "S") { Btn_Nuevo.Visible = true; Pnl_Generales.Enabled = true; Cmb_Contenedores.Focus(); } } }
///******************************************************************************* ///NOMBRE DE LA FUNCIÓN: Btn_Salir_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_Salir_Click(object sender, EventArgs e) { if (Btn_Salir.Text == "Salir") { this.Close(); } else { Cls_Metodos_Generales.Limpia_Controles(Fra_Contenedores); Cls_Metodos_Generales.Limpia_Controles(Fra_Datos_Generales); Cls_Metodos_Generales.Limpia_Controles(Fra_Busqueda); 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); Btn_Nuevo.Enabled = true; Btn_Salir.Enabled = true; Fra_Contenedores.Visible = false; Fra_Datos_Generales.Visible = false; Fra_Busqueda.Visible = true; Habilitar_Controles("Inicial"); Cls_Cat_Destinos_Negocio P_Contenedores = new Cls_Cat_Destinos_Negocio(); DataTable Dt_Contenedores; 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); Cmb_Busqueda_Por.Focus(); } }
///******************************************************************************* ///NOMBRE DE LA FUNCIÓN: Btn_Salir_Click ///DESCRIPCIÓN : Cierra la ventana. ///PARAMENTROS : ///CREO : Luis Alberto Salas Garcia ///FECHA_CREO : 12/Mar/2013 ///MODIFICO : ///FECHA_MODIFICO: ///CAUSA_MODIFICACIÓN: ///******************************************************************************* private void Btn_Salir_Click(object sender, EventArgs e) { if (Btn_Salir.Text == "Cancelar") { Cls_Cat_Ubicaciones_Negocio P_Ubicaciones = new Cls_Cat_Ubicaciones_Negocio(); P_Ubicaciones.P_Estatus = "='ACTIVO'"; P_Ubicaciones.P_Clasificacion = " = 'WIP/FG'"; Cls_Metodos_Generales.Rellena_Combo_Box(Cmb_Ubicacion, P_Ubicaciones.Consultar_Ubicaciones(), Cat_Ubicaciones.Campo_Ubicacion, Cat_Ubicaciones.Campo_Ubicacion_Id); Cls_Metodos_Generales.Limpia_Controles(this); Btn_Modificar.Image = Resources.icono_modificar; Btn_Modificar.Text = "Modificar"; Btn_Nuevo.Image = Resources.icono_nuevo; Btn_Nuevo.Text = "Nuevo"; Btn_Salir.Image = Resources.icono_salir_2; Btn_Salir.Text = "Salir"; Cls_Metodos_Generales.Habilita_Deshabilita_Controles(Fra_Correo, false); Error_Provider.Clear(); Consultar(); Cls_Metodos_Generales.Habilita_Deshabilita_Controles(Fra_Correo, false); Cls_Metodos_Generales.Habilita_Deshabilita_Controles(Fra_Alertas, false); Cls_Metodos_Generales.Habilita_Deshabilita_Controles(Fra_Imagen, false); Cls_Metodos_Generales.Habilita_Deshabilita_Controles(Fra_Ubicacion, false); Btn_Enviar_Alertas.Enabled = true; } else { this.Close(); } }
///******************************************************************************* ///NOMBRE DE LA FUNCIÓN: Btn_Salir_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_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_Nuevo.Enabled = true; Btn_Salir.Enabled = true; Fra_Datos_Generales.Visible = true; Limpiar_Grid(); Habilitar_Controles("Inicial"); 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); } }
///******************************************************************************* ///NOMBRE DE LA FUNCIÓN: Frm_Ope_Ordenes_Salida_Load ///DESCRIPCIÓN :Evento Load ///PARAMENTROS : ///CREO : Hugo Enrique Ramírez Aguilera ///FECHA_CREO : 21/Feb/2013 01:01 p.m. ///MODIFICO : ///FECHA_MODIFICO: ///CAUSA_MODIFICACIÓN: ///******************************************************************************* private void Frm_Ope_Ordenes_Salida_Load(object sender, EventArgs e) { DataTable Dt_Destinos; Cls_Metodos_Generales.Validar_Acceso_Sistema("Órdenes de salida", this); Cls_Metodos_Generales.Habilita_Deshabilita_Controles(Fra_Busqueda, true); Cls_Metodos_Generales.Habilita_Deshabilita_Controles(Fra_Datos_Generales, false); Cls_Metodos_Generales.Habilita_Deshabilita_Controles(Fra_Configuracion_Embarque, false); Cls_Metodos_Generales.Limpia_Controles(Fra_Busqueda); Cls_Metodos_Generales.Limpia_Controles(Fra_Datos_Generales); Cls_Metodos_Generales.Limpia_Controles(Fra_Configuracion_Embarque); Grid_Configuracion.Enabled = false; Fra_Datos_Generales.Enabled = true; Fra_Configuracion_Embarque.Enabled = true; Error_Provider.Clear(); Cls_Cat_Destinos_Negocio P_Destinos = new Cls_Cat_Destinos_Negocio(); P_Destinos.P_Estatus = " = 'ACTIVO'"; Dt_Destinos = P_Destinos.Consultar_Destinos(); Cls_Metodos_Generales.Rellena_Combo_Box(Cmb_Destino, Dt_Destinos, Cat_Destinos.Campo_Destino, Cat_Destinos.Campo_Destino_Id); Cls_Cat_Tipos_Contenedores_Negocio P_Tipos = new Cls_Cat_Tipos_Contenedores_Negocio(); P_Tipos.P_Estatus = " = 'ACTIVO'"; Dt_Destinos = P_Tipos.Consultar_Pseudocodigos(); Cls_Metodos_Generales.Rellena_Combo_Box(Cmb_Tipo_Contenedor, Dt_Destinos, "PSEUDO_CODIGO", Cat_Tipos_Contenedores.Campo_Tipo_Contenedor_Id); Consultar_Embarques(); Btn_Agregar.Enabled = false; Btn_Actualizar.Enabled = false; Btn_Quitar.Enabled = false; }
///******************************************************************************* ///NOMBRE DE LA FUNCIÓN: Llenar_Combo ///DESCRIPCIÓN : Carga las diferentes ubicaciones en el combo ///PARAMENTROS : ///CREO : Miguel Angel Bedolla Moreno ///FECHA_CREO : 21/Feb/2013 01:01 p.m. ///MODIFICO : ///FECHA_MODIFICO: ///CAUSA_MODIFICACIÓN: ///******************************************************************************* private void Llenar_Combo_Wip_Fg() { Cls_Cat_Ubicaciones_Negocio P_Ubicaciones = new Cls_Cat_Ubicaciones_Negocio(); P_Ubicaciones.P_Estatus = " = 'ACTIVO'"; P_Ubicaciones.P_Clasificacion = " LIKE '%FG%' OR " + Cat_Ubicaciones.Campo_Clasificacion + " LIKE '%WIP%'"; Cls_Metodos_Generales.Rellena_Combo_Box(Cmb_Ubicacion_Wipfg, P_Ubicaciones.Consultar_Ubicaciones(), Cat_Ubicaciones.Campo_Ubicacion, Cat_Ubicaciones.Campo_Ubicacion_Id); }
private void Cmb_Contenedores_KeyPress(object sender, KeyPressEventArgs e) { if (e.KeyChar == (char)Keys.Enter) { DataTable Dt_Contenedores = new DataTable(); Cls_Ope_Ordenes_Entrada_Especiales_Negocio Tipos_Contenedores = new Cls_Ope_Ordenes_Entrada_Especiales_Negocio(); Tipos_Contenedores.P_Estatus = "ACTIVO"; Tipos_Contenedores.P_Pseudo_Codigo = Cmb_Contenedores.Text.Trim(); Dt_Contenedores = Tipos_Contenedores.Consultar_Contenedores(); Cls_Metodos_Generales.Rellena_Combo_Box(Cmb_Contenedores, Dt_Contenedores, Dt_Contenedores.Columns[0].ColumnName, Dt_Contenedores.Columns[1].ColumnName); } }
///******************************************************************************* ///NOMBRE DE LA FUNCIÓN: Btn_Nuevo_Click ///DESCRIPCIÓN : Agrega los parametros del sistema. ///PARAMENTROS : ///CREO : Luis Alberto Salas Garcia ///FECHA_CREO : 12/Mar/2013 ///MODIFICO : ///FECHA_MODIFICO: ///CAUSA_MODIFICACIÓN: ///******************************************************************************* private void Btn_Nuevo_Click(object sender, EventArgs e) { if (Btn_Nuevo.Text == "Nuevo") { Cls_Metodos_Generales.Limpia_Controles(this); Lbl_Id.Text = Cls_Metodos_Generales.Obtener_ID_Consecutivo(Cat_Parametros.Tabla_Cat_Parametros, Cat_Parametros.Campo_Parametro_Id, "", 5); Cls_Metodos_Generales.Habilita_Deshabilita_Controles(Fra_Correo, true); Cls_Metodos_Generales.Habilita_Deshabilita_Controles(Fra_Alertas, true); Cls_Metodos_Generales.Habilita_Deshabilita_Controles(Fra_Imagen, true); Cls_Metodos_Generales.Habilita_Deshabilita_Controles(Fra_Ubicacion, true); Btn_Enviar_Alertas.Enabled = true; Btn_Nuevo.Image = Resources.icono_actualizar; Btn_Nuevo.Text = "Guardar"; Btn_Salir.Image = Resources.icono_cancelar; Btn_Salir.Text = "Cancelar"; Btn_BackgroundImage_Mdi.Enabled = true; Error_Provider.Clear(); } else { if (this.ValidateChildren(ValidationConstraints.Enabled)) { if (Alta()) { Btn_Nuevo.Image = Resources.icono_nuevo; Btn_Nuevo.Text = "Nuevo"; Btn_Salir.Image = Resources.icono_salir_2; Btn_Salir.Text = "Salir"; Cls_Metodos_Generales.Habilita_Deshabilita_Controles(Fra_Correo, false); Cls_Metodos_Generales.Habilita_Deshabilita_Controles(Fra_Ubicacion, false); Btn_BackgroundImage_Mdi.Enabled = false; Txt_Frecuencia.Enabled = false; Cls_Cat_Ubicaciones_Negocio P_Ubicaciones = new Cls_Cat_Ubicaciones_Negocio(); P_Ubicaciones.P_Estatus = "='ACTIVO'"; P_Ubicaciones.P_Clasificacion = " = 'WIP/FG'"; Cls_Metodos_Generales.Rellena_Combo_Box(Cmb_Ubicacion, P_Ubicaciones.Consultar_Ubicaciones(), Cat_Ubicaciones.Campo_Ubicacion, Cat_Ubicaciones.Campo_Ubicacion_Id); Consultar(); Cls_Metodos_Generales.Habilita_Deshabilita_Controles(Fra_Correo, false); Cls_Metodos_Generales.Habilita_Deshabilita_Controles(Fra_Alertas, false); Cls_Metodos_Generales.Habilita_Deshabilita_Controles(Fra_Imagen, false); Cls_Metodos_Generales.Habilita_Deshabilita_Controles(Fra_Ubicacion, false); Btn_Enviar_Alertas.Enabled = true; MessageBox.Show(this, "Se dio de alta correctamente los parámetros del sistema.", "Alta Parámetros Sistema", MessageBoxButtons.OK, MessageBoxIcon.Information); } } else { MessageBox.Show(this, "Faltan datos por capturar o están erróneos. Favor de verificar", "Alta Parámetros Sistema", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } } }
///******************************************************************************* ///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: Frm_Ope_Embarques_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_Salida_Contendores_Load(object sender, EventArgs e) { DataTable Dt_Contenedores = new DataTable(); Cls_Metodos_Generales.Habilita_Deshabilita_Controles(Fra_Busqueda, true); Cls_Metodos_Generales.Habilita_Deshabilita_Controles(Fra_Contenedores, false); Cls_Metodos_Generales.Habilita_Deshabilita_Controles(Fra_Datos_Generales, false); Cls_Metodos_Generales.Limpia_Controles(Fra_Busqueda); Cls_Metodos_Generales.Limpia_Controles(Fra_Contenedores); Cls_Metodos_Generales.Limpia_Controles(Fra_Datos_Generales); Grid_Contenedores.Enabled = true; Fra_Busqueda.Visible = true; Fra_Contenedores.Visible = false; Fra_Datos_Generales.Visible = false; 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_Destino, Dt_Contenedores, Cat_Destinos.Campo_Destino, Cat_Destinos.Campo_Destino_Id); Cmb_Busqueda_Por.Focus(); Grid_Ordenes_Salida.Enabled = true; 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 = "Salida de contenedores"; Dt_Accesos = P_Rol.Consultar_Acceso_Roles(); Btn_Busqueda.Visible = false; Grid_Ordenes_Salida.Visible = false; foreach (DataRow Dr_Renglon_Actual in Dt_Accesos.Rows) { if (Dr_Renglon_Actual[Apl_Acceso.Campo_Alta].ToString() == "S") { Grid_Ordenes_Salida.Visible = true; } if (Dr_Renglon_Actual[Apl_Acceso.Campo_Consultar].ToString() == "S") { Btn_Busqueda.Visible = true; } } Cls_Cat_Tipos_Contenedores_Negocio P_Tipos = new Cls_Cat_Tipos_Contenedores_Negocio(); P_Tipos.P_Estatus = " = 'ACTIVO'"; Dt_Destinos = P_Tipos.Consultar_Pseudocodigos(); Cls_Metodos_Generales.Rellena_Combo_Box(Cmb_Tipo_Contenedor, Dt_Destinos, "PSEUDO_CODIGO", Cat_Tipos_Contenedores.Campo_Tipo_Contenedor_Id); Consultar_Embarques(false); }
private void Frm_Cat_Contactos_Load(object sender, EventArgs e) { Cls_Metodos_Generales.Validar_Acceso_Sistema("Contactos", this); Cls_Cat_Clientes_Negocio Cls_Clientes = new Cls_Cat_Clientes_Negocio(); Cls_Cat_Proveedores_Negocio Cls_Proveedores = new Cls_Cat_Proveedores_Negocio(); Cls_Metodos_Generales.Rellena_Combo_Box(Cmb_Clientes, Cls_Clientes.Consultar_Clientes(), Cat_Adm_Clientes.Campo_Nombre_Corto, Cat_Adm_Clientes.Campo_Cliente_Id); Cls_Metodos_Generales.Rellena_Combo_Box(Cmb_Proveedor, Cls_Proveedores.Consultar_Proveedores(), Cat_Adm_Proveedores.Campo_Nombre_Corto, Cat_Adm_Proveedores.Campo_Proveedor_Id); Cls_Metodos_Generales.Limpia_Controles(this); Fra_Campos.Visible = true; Fra_Buscar.Visible = false; Consultar_Contactos(); Rellena_Combo_Busqueda(); Validador = new Validador_Generico(Erp_Error_Provider); }
/// <summary> /// Nombre: Cargar_Combo_Productos /// /// Descripción: Método que carga los productos existentes /// /// Usuario Creo: Hugo Enrique Ramírez Aguilera. /// Fecha Creo: 23 Diciembre 2015 10:13 Hrs. /// Usuario Modifico: /// Fecha Modifico: /// </summary> private void Cargar_Combo_Productos() { Cls_Cat_Productos_Negocio Rs_Productos = new Cls_Cat_Productos_Negocio(); DataTable Dt_Productos = new DataTable(); try { Dt_Productos = Rs_Productos.Consultar_Producto_X_Anio(); Cls_Metodos_Generales.Rellena_Combo_Box(Cmb_Producto_Anterior, Dt_Productos, Cat_Productos.Campo_Nombre, Cat_Productos.Campo_Producto_Id); } catch (Exception Ex) { MessageBox.Show(this, Ex.Message, "Error - Método: [Cargar_Combo_Productos]", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
public Frm_Cat_Clientes() { InitializeComponent(); Cls_Metodos_Generales.Limpia_Controles(this); Cls_Metodos_Generales.Grid_Propiedad_Fuente_Celdas(Grid_Clientes); Cls_Metodos_Generales.Habilita_Deshabilita_Controles(Fra_Clientes, false); Cls_Cat_Giros_Empresariales_Negocio Giros_Negocios = new Cls_Cat_Giros_Empresariales_Negocio(); Cls_Metodos_Generales.Rellena_Combo_Box(Cmb_Giros, Giros_Negocios.Consultar_Giro_Empresariales(), Cat_Adm_Giros_Empresariales.Campo_Nombre, Cat_Adm_Giros_Empresariales.Campo_Giro_Id); Cls_Metodos_Generales.Rellena_Combo_Box(Cmb_Giro_Busqueda, Giros_Negocios.Consultar_Giro_Empresariales(), Cat_Adm_Giros_Empresariales.Campo_Nombre, Cat_Adm_Giros_Empresariales.Campo_Giro_Id); Rellena_Combo_Busqueda(); Validador = new Validador_Generico(Error_Provider); Error_Provider.Clear(); Consultar(); }
///******************************************************************************* ///NOMBRE DE LA FUNCIÓN: Frm_Apl_Parametros_Load ///DESCRIPCIÓN : Evento Load del formulario Frm_Apl_Parametros ///PARAMENTROS : ///CREO : Miguel Angel Bedolla Moreno ///FECHA_CREO : 28/Feb/2013 ///MODIFICO : ///FECHA_MODIFICO: ///CAUSA_MODIFICACIÓN: ///******************************************************************************* private void Frm_Apl_Parametros_Load(object sender, EventArgs e) { Cls_Metodos_Generales.Validar_Acceso_Sistema("Parámetros", this); Cls_Cat_Ubicaciones_Negocio P_Ubicaciones = new Cls_Cat_Ubicaciones_Negocio(); P_Ubicaciones.P_Estatus = "='ACTIVO'"; P_Ubicaciones.P_Clasificacion = " = 'WIP/FG'"; Cls_Metodos_Generales.Rellena_Combo_Box(Cmb_Ubicacion, P_Ubicaciones.Consultar_Ubicaciones(), Cat_Ubicaciones.Campo_Ubicacion, Cat_Ubicaciones.Campo_Ubicacion_Id); Consultar(); Cls_Metodos_Generales.Habilita_Deshabilita_Controles(Fra_Correo, false); Cls_Metodos_Generales.Habilita_Deshabilita_Controles(Fra_Alertas, false); Cls_Metodos_Generales.Habilita_Deshabilita_Controles(Fra_Imagen, false); Cls_Metodos_Generales.Habilita_Deshabilita_Controles(Fra_Ubicacion, false); Btn_Enviar_Alertas.Enabled = true; }
///************************************************************************************* ///NOMBRE DE LA FUNCIÓN : Cargar_Formas_Pago ///DESCRIPCIÓN : Consulta todos los formas de pago de la base de datos y los coloca en el combo forma de pago ///PARÁMETROS : ///CREÓ : Hugo Enrique Ramírez Aguilera ///FECHA_CREO : 11 Junio 2015 ///MODIFICÓ : ///FECHA_MODIFICO : ///CAUSA_MODIFICACIÓN : ///************************************************************************************* private void Cargar_Formas_Pago() { Cls_Cat_Formas_Pago_Negocio Rs_Consulta = new Cls_Cat_Formas_Pago_Negocio(); DataTable Dt_Consulta = new DataTable(); try { Dt_Consulta = Rs_Consulta.Consultar_Formas_Pago(); Cls_Metodos_Generales.Rellena_Combo_Box(Cmb_Forma_Pago, Dt_Consulta, Cat_Formas_Pago.Campo_Nombre, Cat_Formas_Pago.Campo_Forma_ID); } catch (Exception e) { MessageBox.Show(e.Message, "Cargar_Formas_Pago", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
///******************************************************************************* ///NOMBRE DE LA FUNCIÓN: Frm_Ope_Embarques_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_Embarques_Load(object sender, EventArgs e) { DataTable Dt_Contenedores = new DataTable(); Cls_Metodos_Generales.Habilita_Deshabilita_Controles(Pnl_Busqueda, true); Cls_Metodos_Generales.Habilita_Deshabilita_Controles(Pnl_Generales, false); Cls_Metodos_Generales.Limpia_Controles(Pnl_Busqueda); Cls_Metodos_Generales.Limpia_Controles(Pnl_Generales); Grid_Contenedores.Enabled = true; Pnl_Busqueda.Visible = true; Pnl_Generales.Visible = false; 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); Cmb_Busqueda_Destino.Focus(); Grid_Contenedores_Entrada.Enabled = true; Cls_Apl_Roles_Negocio P_Rol = new Cls_Apl_Roles_Negocio(); DataTable Dt_Accesos; P_Rol.P_Rol_Id = Txt_Rol_Id.Text; P_Rol.P_Nombre_Menu = "Entrada de contenedores"; Dt_Accesos = P_Rol.Consultar_Acceso_Roles(); Btn_Busqueda.Visible = false; Btn_Nuevo.Visible = false; Grid_Contenedores.Enabled = false; foreach (DataRow Dr_Renglon_Actual in Dt_Accesos.Rows) { if (Dr_Renglon_Actual[Apl_Acceso.Campo_Alta].ToString() == "S") { Grid_Contenedores.Enabled = true; } if (Dr_Renglon_Actual[Apl_Acceso.Campo_Consultar].ToString() == "S") { Btn_Busqueda.Visible = true; } } Consultar_Entradas(false); }
///******************************************************************************* ///NOMBRE DE LA FUNCIÓN: Frm_Cat_Contenedores_Load ///DESCRIPCIÓN : Evento Load del formulario Frm_Cat_Contenedores ///PARAMENTROS : ///CREO : Miguel Angel Bedolla Moreno ///FECHA_CREO : 12/Abr/2013 04:20 p.m. ///MODIFICO : ///FECHA_MODIFICO: ///CAUSA_MODIFICACIÓN: ///******************************************************************************* private void Frm_Cat_Contenedores_Load(object sender, EventArgs e) { Cls_Metodos_Generales.Validar_Acceso_Sistema("Contenedores", this); Btn_Eliminar.Visible = false; Cls_Metodos_Generales.Habilita_Deshabilita_Controles(Fra_Busqueda, true); Cls_Metodos_Generales.Habilita_Deshabilita_Controles(Fra_Datos_Generales, false); Cls_Cat_Tipos_Contenedores_Negocio P_Tipo = new Cls_Cat_Tipos_Contenedores_Negocio(); P_Tipo.P_Estatus = " = 'ACTIVO'"; Cls_Metodos_Generales.Rellena_Combo_Box(Cmb_Tipo_Contenedor, P_Tipo.Consultar_Pseudocodigos(), "PSEUDO_CODIGO", Cat_Tipos_Contenedores.Campo_Tipo_Contenedor_Id); Cls_Cat_Ubicaciones_Negocio P_Ubicaciones = new Cls_Cat_Ubicaciones_Negocio(); P_Ubicaciones.P_Estatus = "ACTIVO"; Cls_Metodos_Generales.Rellena_Combo_Box(Cmb_Ubicacion, P_Ubicaciones.Consultar_Ubicaciones(), Cat_Ubicaciones.Campo_Ubicacion, Cat_Ubicaciones.Campo_Ubicacion_Id); Cls_Metodos_Generales.Limpia_Controles(Fra_Busqueda); Cls_Metodos_Generales.Limpia_Controles(Fra_Datos_Generales); Grid_Contenedores.Enabled = true; Fra_Busqueda.Visible = false; Error_Provider.Clear(); }
//************************************************************************************* //NOMBRE DE LA FUNCIÓN: Frm_Cat_Usuarios_Load //DESCRIPCIÓN: Evento Load del formulario //PARÁMETROS : //CREO : Miguel Angel Bedolla Moreno //FECHA_CREO : 22-Febrero-2013 //MODIFICO: //FECHA_MODIFICO //CAUSA_MODIFICACIÓN //************************************************************************************* private void Frm_Cat_Usuarios_Load(object sender, EventArgs e) { Cls_Metodos_Generales.Validar_Acceso_Sistema("Usuarios", this); Cls_Apl_Roles_Negocio Rs_Roles = new Cls_Apl_Roles_Negocio(); DataTable Dt_Resultado = new DataTable(); Grb_Buscar.Visible = false; Grb_Datos_Generales.Visible = true; Fra_Login.Visible = true; Grb_Datos_Generales.Enabled = false; Fra_Login.Enabled = false; Cargar_Usuarios_Activos(); Dt_Resultado = new DataTable(); Rs_Roles.P_Estatus = "ACTIVO"; Dt_Resultado = Rs_Roles.Consultar_Roles(); Cls_Metodos_Generales.Rellena_Combo_Box(Cmb_Rol, Dt_Resultado, Apl_Roles.Campo_Nombre, Apl_Roles.Campo_Rol_Id); Cls_Metodos_Generales.Grid_Propiedad_Fuente_Celdas(Grid_Usuarios); Cmb_Estatus.Enabled = false; Validador = new Validador_Generico(Erp_Validaciones); Erp_Validaciones.Clear(); }
///******************************************************************************* ///NOMBRE DE LA FUNCIÓN: Frm_Ope_Recepcion_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_Recepcion_Load(object sender, EventArgs e) { DataTable Dt_Contenedores = new DataTable(); Cls_Metodos_Generales.Habilita_Deshabilita_Controles(Pnl_Generales, false); Cls_Metodos_Generales.Limpia_Controles(Pnl_Generales); Lbl_Cantidad.Visible = false; Txt_Cantidad.Visible = true; Pnl_Generales.Visible = true; Cls_Cat_Destinos_Negocio P_Contenedores = new Cls_Cat_Destinos_Negocio(); P_Contenedores.P_Estatus = " = 'ACTIVO'"; Dt_Contenedores = P_Contenedores.Consultar_Destinos(); 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); Btn_Nuevo_Click(null, null); Cls_Apl_Roles_Negocio P_Rol = new Cls_Apl_Roles_Negocio(); DataTable Dt_Accesos; P_Rol.P_Rol_Id = Txt_Rol_Id.Text; P_Rol.P_Nombre_Menu = "Recepción de entrada"; Dt_Accesos = P_Rol.Consultar_Acceso_Roles(); Btn_Nuevo.Visible = false; foreach (DataRow Dr_Renglon_Actual in Dt_Accesos.Rows) { if (Dr_Renglon_Actual[Apl_Acceso.Campo_Alta].ToString() == "S") { Btn_Nuevo.Visible = true; } } }
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); Grid_Contenedores_Entrada.Enabled = true; Pnl_Generales.Visible = true; Cmb_Contenedores.Text = ""; Cmb_Contenedores.Focus(); Limpiar_Grid(); } else { if (Validar_Componentes()) { Cls_Ope_Ordenes_Entrada_Especiales_Negocio P_Entrada = new Cls_Ope_Ordenes_Entrada_Especiales_Negocio(); P_Entrada.P_Usuario = Txt_Nombre_Usuario.Text.ToUpper(); P_Entrada.P_Ubicacion_ID = Cmb_Ubicacion.SelectedValue.ToString(); P_Entrada.P_Dt_Contenedores = (DataTable)Grid_Contenedores_Entrada.DataSource; if (P_Entrada.Alta()) { //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); 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'"; Dt_Contenedores = P_Ubicaciones.Consultar_Ubicaciones(); Cls_Metodos_Generales.Rellena_Combo_Box(Cmb_Ubicacion, Dt_Contenedores, Cat_Ubicaciones.Campo_Ubicacion, Cat_Ubicaciones.Campo_Ubicacion_Id); Limpiar_Grid(); MessageBox.Show("Alta Exitosa", "Entradas Especiales", MessageBoxButtons.OK, MessageBoxIcon.Asterisk, MessageBoxDefaultButton.Button1); } } } }
///******************************************************************************* ///NOMBRE DE LA FUNCIÓN: Consultar ///DESCRIPCIÓN : Carga los parametros del sistema en los textbox ///PARAMENTROS : ///CREO : Luis Alberto Salas Garcia ///FECHA_CREO : 12/Mar/2013 ///MODIFICO : ///FECHA_MODIFICO: ///CAUSA_MODIFICACIÓN: ///******************************************************************************* private void Consultar() { DataTable Dt_Resultado = new DataTable(); DataTable Dt_Productos = new DataTable(); Cls_Apl_Roles_Negocio Rs_Roles = new Cls_Apl_Roles_Negocio(); try { /* se consultan los productos y se cargan al combo */ Cls_Cat_Productos_Negocio Rs_Consulta_Productos = new Cls_Cat_Productos_Negocio(); Rs_Consulta_Productos.P_Estatus = "ACTIVO"; Dt_Productos = Rs_Consulta_Productos.Consultar_Producto(); Cls_Metodos_Generales.Rellena_Combo_Box(Cmb_Producto_Id_Web, Dt_Productos, Cat_Productos.Campo_Nombre, Cat_Productos.Campo_Producto_Id); // consulta de los parametros Cls_Apl_Parametros_Negocio Consulta_Parametros = new Cls_Apl_Parametros_Negocio(); String Parametro_Id = Cls_Metodos_Generales.Obtener_ID_Consecutivo(Cat_Parametros.Tabla_Cat_Parametros, Cat_Parametros.Campo_Parametro_ID, "", 5); // se carga la informacion de los roles -------------------------------------------------------------------------------------- Rs_Roles.P_Estatus = "ACTIVO"; Dt_Resultado = Rs_Roles.Consultar_Roles(); Cls_Metodos_Generales.Rellena_Combo_Box(Cmb_Rol, Dt_Resultado, Apl_Roles.Campo_Nombre, Apl_Roles.Campo_Rol_Id); // --------------------------------------------------------------------------------------------------------------------------- if (Int16.Parse(Parametro_Id) > 1) { Btn_Nuevo.Enabled = false; Btn_Modificar.Enabled = true; Parametro_Id = "00001"; Consulta_Parametros.P_Parametro_Id = Parametro_Id; DataTable Dt_Consulta = Consulta_Parametros.Consultar_Parametros(); Cmb_Rol.SelectedValue = Dt_Consulta.Rows[0][Cat_Parametros.Campo_Rol_Id].ToString(); Lbl_Id.Text = Dt_Consulta.Rows[0][Cat_Parametros.Campo_Parametro_ID].ToString(); Txt_Dias_Vigencia.Text = Dt_Consulta.Rows[0][Cat_Parametros.Campo_Dias_Vigencia].ToString(); Txt_Directorio_Compartido.Text = Dt_Consulta.Rows[0][Cat_Parametros.Campo_Directorio_Compartido].ToString(); Txt_Encabezado.Text = Dt_Consulta.Rows[0][Cat_Parametros.Campo_Encabezado_Recibo].ToString(); Txt_Mensaje_Dia.Text = Dt_Consulta.Rows[0][Cat_Parametros.Campo_Mensaje_Dia_Recibo].ToString(); Txt_Correo.Text = Dt_Consulta.Rows[0][Cat_Parametros.Campo_Email].ToString(); Txt_Contrasenia.Text = Cls_Seguridad.Desencriptar(Dt_Consulta.Rows[0][Cat_Parametros.Campo_Contrasenia].ToString()); Txt_Host.Text = Dt_Consulta.Rows[0][Cat_Parametros.Campo_Host_Email].ToString(); Txt_Puerto.Text = Dt_Consulta.Rows[0][Cat_Parametros.Campo_Puerto].ToString(); Txt_Mensaje_Sistema.Text = Dt_Consulta.Rows[0][Cat_Parametros.Campo_Mensaje_Sistema].ToString(); Txt_Tope_Recoleccion.Text = Dt_Consulta.Rows[0][Cat_Parametros.Campo_Tope_Recoleccion].ToString(); Txt_Mensaje_Ticket.Text = Dt_Consulta.Rows[0][Cat_Parametros.Campo_Mensaje_Ticket].ToString(); Txt_Porcentaje_Faltante_Excedente.Text = Dt_Consulta.Rows[0][Cat_Parametros.Campo_Porcentaje_Faltante_Excedente].ToString(); // servidor que almacenara las ventas del dia Txt_Ip_A_Enviar_Ventas.Text = Dt_Consulta.Rows[0][Cat_Parametros.Campo_Ip_A_Enviar_Ventas].ToString(); Txt_Base_Datos_A_Enviar_Ventas.Text = Dt_Consulta.Rows[0][Cat_Parametros.Campo_Base_Datos_A_Enviar_Ventas].ToString(); Txt_Usuario_A_Enviar_Ventas.Text = Dt_Consulta.Rows[0][Cat_Parametros.Campo_Usuario_A_Enviar_Ventas].ToString(); Txt_Password_A_Enviar_Ventas.Text = Cls_Seguridad.Desencriptar(Dt_Consulta.Rows[0][Cat_Parametros.Campo_Contrasenia_A_Enviar_Ventas].ToString()); // duedorcad Txt_Cuenta_Museo.Text = Dt_Consulta.Rows[0][Cat_Parametros.Campo_Cuenta_Museo].ToString(); Txt_Tipo_Deudorcad.Text = Dt_Consulta.Rows[0][Cat_Parametros.Campo_Tipo_Deudorcad].ToString(); Txt_Lista_Deudorcad.Text = Dt_Consulta.Rows[0][Cat_Parametros.Campo_Lista_Deudorcad].ToString(); Txt_Clave_Venta_Deudorcad.Text = Dt_Consulta.Rows[0][Cat_Parametros.Campo_Clave_Venta_Deudorcad].ToString(); Txt_Clave_Sobrante_Deudorcad.Text = Dt_Consulta.Rows[0][Cat_Parametros.Campo_Clave_Sobrante_Deudorcad].ToString(); Txt_Clave_Venta_Individual_DeudorCad.Text = Dt_Consulta.Rows[0][Cat_Parametros.Campo_Clave_Venta_Individual_Deudorcad].ToString(); Txt_Clave_Internet.Text = Dt_Consulta.Rows[0][Cat_Parametros.Campo_Clave_Venta_Internet].ToString(); if (Dt_Consulta.Rows[0][Cat_Parametros.Campo_Version_Bd].ToString() == "4") { Rbt_Version_4.Checked = true; } else { Rbt_Version_5.Checked = true; } // seccion web Cmb_Producto_Id_Web.SelectedValue = Dt_Consulta.Rows[0][Cat_Parametros.Campo_Producto_Id_Web].ToString(); Txt_Leyenda_WEB.Text = Dt_Consulta.Rows[0][Cat_Parametros.Campo_Leyenda].ToString(); Dta_Vigencia_WEB.Text = Dt_Consulta.Rows[0][Cat_Parametros.Campo_Vigencia_Web].ToString(); //seccion pinpad Txt_ID_Afiliacion.Text = Dt_Consulta.Rows[0][Cat_Parametros.Campo_Afiliacion_PinPad].ToString(); Txt_Usuario_Banco.Text = Dt_Consulta.Rows[0][Cat_Parametros.Campo_Usuario_PinPad].ToString(); Txt_Contraseña_Banco.Text = Cls_Seguridad.Desencriptar(Dt_Consulta.Rows[0][Cat_Parametros.Campo_Contrasenia_PinPad].ToString()); Txt_Banorte_Url.Text = Dt_Consulta.Rows[0][Cat_Parametros.Campo_Banorte_Url].ToString(); Operacion_PinPad = Dt_Consulta.Rows[0][Cat_Parametros.Campo_Operacion_PinPad].ToString(); switch (Operacion_PinPad) { case "PRD": Cmb_Operacion_Banco.SelectedIndex = 0; break; case "AUT": Cmb_Operacion_Banco.SelectedIndex = 1; break; case "DEC": Cmb_Operacion_Banco.SelectedIndex = 2; break; case "RND": Cmb_Operacion_Banco.SelectedIndex = 3; break; default: Cmb_Operacion_Banco.SelectedIndex = 0; break; } } else { Btn_Nuevo.Enabled = true; Btn_Modificar.Enabled = false; //Dtp_Fecha_Dias_Inicio.Enabled = false; //Dtp_Fecha_Dias_Fin.Enabled = false; Txt_Dias_Vigencia.Text = ""; Txt_Directorio_Compartido.Text = ""; Txt_Encabezado.Text = ""; Txt_Mensaje_Dia.Text = ""; Txt_Correo.Text = ""; Txt_Contrasenia.Text = ""; Txt_Host.Text = ""; Txt_Puerto.Text = ""; Txt_Mensaje_Sistema.Text = ""; Txt_Tope_Recoleccion.Text = ""; Lbl_Id.Text = ""; } } catch (Exception E) { MessageBox.Show(null, E.ToString(), "Error - Consultar Parametros Sistema", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
///******************************************************************************* ///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_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; } } } }