private void cargarDataGridViewUnidad() { try { dgvUnidad.Rows.Clear(); dgvUnidad.Refresh(); //instansear web service con seguridad ServiceProcess_Unidad.Process_UnidadSoapClient auxServiceUnidad = new ServiceProcess_Unidad.Process_UnidadSoapClient(); auxServiceUnidad.ClientCredentials.UserName.UserName = Cuenta.Usuario_iis; auxServiceUnidad.ClientCredentials.UserName.Password = Cuenta.Clave_iis; ServiceProcess_Empresa.Empresa auxEmpresa = new ServiceProcess_Empresa.Empresa(); ServiceProcess_Unidad.Unidad auxUnidad = new ServiceProcess_Unidad.Unidad(); //capturar dataset DataSet ds = auxServiceUnidad.TraerUnidadPorEmpresaSinEntidad_Escritorio(_rut_empresa); if ((ds.Tables.Count != 0) && (ds.Tables[0].Rows.Count > 0)) { //Capturar Tabla DataTable dt = ds.Tables[0]; //contar cantidad de empresas int _cantidad_unidades = dt.Rows.Count; //crear array bidimencional string[,] ListaUnidades = new string[_cantidad_unidades, 2]; //Recorrer data table int _fila = 0; for (int i = 0; i < dt.Rows.Count; i++) { //Capturar datos de la fila recorridad en objeto Unidad int id_unidad = Convert.ToInt32(dt.Rows[i]["Id_unidad"]); string nombre_unidad = (String)dt.Rows[i]["Nombre"]; //cargar array con datos de fila ListaUnidades[_fila, 0] = id_unidad.ToString(); ListaUnidades[_fila, 1] = nombre_unidad; //agregar lista a gridview dgvUnidad.Rows.Add(ListaUnidades[_fila, 0], ListaUnidades[_fila, 1]); _fila++; } } else { MessageBox.Show("La Empresa Seleccionada No tienes Unidades creadas .", "ATENCION", MessageBoxButtons.OK, MessageBoxIcon.Information); pbSeleccionUnidad.Visible = false; } } catch (Exception ex) { MessageBox.Show("Error en metodo cargarDataGridViewEquipo, Contactese con el Administrador Detalle de Error: " + ex.Message, "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void BtnDesactivar_Click(object sender, EventArgs e) { try { //Instancia de Web service con credenciales NT ServiceProcess_Empresa.Process_EmpresaSoapClient auxServiceEmpresa = new ServiceProcess_Empresa.Process_EmpresaSoapClient(); auxServiceEmpresa.ClientCredentials.UserName.UserName = Cuenta.Usuario_iis; auxServiceEmpresa.ClientCredentials.UserName.Password = Cuenta.Clave_iis; ServiceProcess_Empresa.Empresa auxEmpresa = new ServiceProcess_Empresa.Empresa(); auxEmpresa = auxServiceEmpresa.TraerEmpresaConEntidad_Escritorio(_rut_empresa); if (MessageBox.Show("¿Esta Seguro de Desactivar la Unidad " + _nombre + " de la Empresa " + auxEmpresa.Nombre + "?", "CONFIRMAR", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { //Instancia de Web service con credenciales NT ServiceProcess_Unidad.Process_UnidadSoapClient auxServiceUnidad = new ServiceProcess_Unidad.Process_UnidadSoapClient(); auxServiceUnidad.ClientCredentials.UserName.UserName = Cuenta.Usuario_iis; auxServiceUnidad.ClientCredentials.UserName.Password = Cuenta.Clave_iis; //Insertar datos via web service auxServiceUnidad.ActualizarUnidadSinEntidad_Escritorio(Convert.ToInt32(_id_unidad), _nombre, _descripcion, 0, _rut_empresa); //ocultar botones btnActivar.Visible = false; btnDesactivar.Visible = false; //Vaciar variables _id_unidad = null; _nombre = string.Empty; _descripcion = string.Empty; _estado = string.Empty; _rut_empresa = string.Empty; //limpiar GridView dgvUnidad.Rows.Clear(); dgvUnidad.Refresh(); //Metodo Carga de GridView cargarDataGridViewPpal(); MessageBox.Show("Unidad Desactivada.", "ATENCION", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); } else { //continua CON LA VISTA ACTUAL } } catch (Exception ex) { MessageBox.Show("Error en metodo de accion BtnDesactivar_Click, Contactese con el Administrador Detalle de Error: " + ex.Message, "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void DgvUnidad_CellClick(object sender, DataGridViewCellEventArgs e) { try { if (e.RowIndex < 0) { return; } _id_unidad = dgvUnidad.Rows[e.RowIndex].Cells["ID_UNIDAD"].Value.ToString(); _rut_empresa = dgvUnidad.Rows[e.RowIndex].Cells["RUT_EMPRESA"].Value.ToString(); //instansear web service con seguridad ServiceProcess_Unidad.Process_UnidadSoapClient auxServiceUnidad = new ServiceProcess_Unidad.Process_UnidadSoapClient(); auxServiceUnidad.ClientCredentials.UserName.UserName = Cuenta.Usuario_iis; auxServiceUnidad.ClientCredentials.UserName.Password = Cuenta.Clave_iis; ServiceProcess_Unidad.Unidad auxUnidad = new ServiceProcess_Unidad.Unidad(); auxUnidad = auxServiceUnidad.TraerUnidadConEntidad_Escritorio(Convert.ToInt32(_id_unidad), _rut_empresa); _nombre = auxUnidad.Nombre; _descripcion = auxUnidad.Descripcion; _estado = auxUnidad.Estado.ToString(); pbSeleccion.Visible = true; if (_estado.Equals("0")) { btnActivar.Visible = true; btnDesactivar.Visible = false; } else { btnDesactivar.Visible = true; btnActivar.Visible = false; } } catch (Exception ex) { MessageBox.Show("Error en metodo de accion DgvUnidad_CellClick, Contactese con el Administrador Detalle de Error: " + ex.Message, "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void cargarComboUnidad() { try { ServiceProcess_Unidad.Process_UnidadSoapClient auxServiceUnidad = new ServiceProcess_Unidad.Process_UnidadSoapClient(); auxServiceUnidad.ClientCredentials.UserName.UserName = Cuenta.Usuario_iis; auxServiceUnidad.ClientCredentials.UserName.Password = Cuenta.Clave_iis; pbSeleccionEmpresa.Visible = true; DataSet ds = new DataSet(); DataTable dt = new DataTable(); ds = auxServiceUnidad.TraerUnidadPorEmpresaSinEntidad_Escritorio(_rut_empresa); if ((ds.Tables.Count != 0) && (ds.Tables[0].Rows.Count > 0)) { dt = ds.Tables[0]; DataRow fila = dt.NewRow(); fila["ID_UNIDAD"] = 0; fila["NOMBRE"] = "SELECCIONE UNIDAD"; fila["DESCRIPCION"] = " "; fila["ESTADO"] = 0; fila["RUT_EMPRESA"] = 0; dt.Rows.InsertAt(fila, 0); cbUnidad.DropDownStyle = ComboBoxStyle.DropDownList; cbUnidad.DataSource = dt; cbUnidad.DisplayMember = "NOMBRE"; cbUnidad.ValueMember = "ID_UNIDAD"; } else { MessageBox.Show("Empresa Seleccionada No Tiene Unidades Registradas.", "ATENCION", MessageBoxButtons.OK, MessageBoxIcon.Information); } } catch (Exception ex) { MessageBox.Show("Error al cargar Informacion cargarComboUnidad, Contactese con el Administrador Detalle de Error: " + ex.Message, "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
//Metodo Carga de GridView private void cargarDataGridViewPpal() { try { //instansear web service con seguridad ServiceProcess_Empresa.Process_EmpresaSoapClient auxServiceEmpresa = new ServiceProcess_Empresa.Process_EmpresaSoapClient(); auxServiceEmpresa.ClientCredentials.UserName.UserName = Cuenta.Usuario_iis; auxServiceEmpresa.ClientCredentials.UserName.Password = Cuenta.Clave_iis; ServiceProcess_Unidad.Process_UnidadSoapClient auxServiceUnidad = new ServiceProcess_Unidad.Process_UnidadSoapClient(); auxServiceUnidad.ClientCredentials.UserName.UserName = Cuenta.Usuario_iis; auxServiceUnidad.ClientCredentials.UserName.Password = Cuenta.Clave_iis; ServiceProcess_Empresa.Empresa auxEmpresa = new ServiceProcess_Empresa.Empresa(); ServiceProcess_Unidad.Unidad auxUnidad = new ServiceProcess_Unidad.Unidad(); //capturar dataset DataSet ds = auxServiceUnidad.TraerTodasUnidades_Escritorio(); //Capturar Tabla DataTable dt = ds.Tables[0]; //contar cantidad de empresas int _cantidad_unidades = dt.Rows.Count; //crear array bidimencional string[,] ListaUnidad = new string[_cantidad_unidades, 6]; //Recorrer data table int _fila = 0; for (int i = 0; i < dt.Rows.Count; i++) { //Capturar datos de la fila recorridad en objeto empresa auxUnidad.Id_unidad = Convert.ToInt32(dt.Rows[i]["Id_unidad"]); auxUnidad.Nombre = (String)dt.Rows[i]["Nombre"]; auxUnidad.Descripcion = (String)dt.Rows[i]["Descripcion"]; auxUnidad.Estado = Convert.ToInt32(dt.Rows[i]["Estado"]); auxUnidad.Rut_empresa = (String)dt.Rows[i]["Rut_empresa"]; //variables temporales de apoyo string _estado = string.Empty; string _nombre_empresa = string.Empty; //cargar array con datos de fila ListaUnidad[_fila, 0] = auxUnidad.Id_unidad.ToString(); ListaUnidad[_fila, 1] = auxUnidad.Nombre; auxEmpresa = auxServiceEmpresa.TraerEmpresaConEntidad_Escritorio(auxUnidad.Rut_empresa); ListaUnidad[_fila, 2] = auxEmpresa.Nombre; ListaUnidad[_fila, 3] = auxEmpresa.Rut_empresa; if (auxUnidad.Estado == 0) { _estado = "DESACTIVADO"; } else { _estado = "ACTIVADO"; } ListaUnidad[_fila, 4] = _estado; ListaUnidad[_fila, 5] = auxUnidad.Descripcion; //agregar lista a gridview dgvUnidad.Rows.Add(ListaUnidad[_fila, 0], ListaUnidad[_fila, 1], ListaUnidad[_fila, 2], ListaUnidad[_fila, 3], ListaUnidad[_fila, 4], ListaUnidad[_fila, 5]); _fila++; } pbSeleccion.Visible = false; } catch (Exception ex) { MessageBox.Show("Error en metodo cargarDataGridViewPpal, Contactese con el Administrador Detalle de Error: " + ex.Message, "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void TxtFiltrar_KeyUp(object sender, KeyEventArgs e) { try { dgvUnidad.Rows.Clear(); dgvUnidad.Refresh(); //instansear web service con seguridad ServiceProcess_Empresa.Process_EmpresaSoapClient auxServiceEmpresa = new ServiceProcess_Empresa.Process_EmpresaSoapClient(); auxServiceEmpresa.ClientCredentials.UserName.UserName = Cuenta.Usuario_iis; auxServiceEmpresa.ClientCredentials.UserName.Password = Cuenta.Clave_iis; ServiceProcess_Unidad.Process_UnidadSoapClient auxServiceUnidad = new ServiceProcess_Unidad.Process_UnidadSoapClient(); auxServiceUnidad.ClientCredentials.UserName.UserName = Cuenta.Usuario_iis; auxServiceUnidad.ClientCredentials.UserName.Password = Cuenta.Clave_iis; ServiceProcess_Empresa.Empresa auxEmpresa = new ServiceProcess_Empresa.Empresa(); ServiceProcess_Unidad.Unidad auxUnidad = new ServiceProcess_Unidad.Unidad(); //capturar dataset DataSet ds = auxServiceUnidad.TraerUnidadConClaveSinEntidad_Escritorio(txtFiltrar.Text.ToUpper()); if ((ds.Tables.Count != 0) && (ds.Tables[0].Rows.Count > 0)) { //Capturar Tabla DataTable dt = ds.Tables[0]; //contar cantidad de empresas int _cantidad_unidades = dt.Rows.Count; //crear array bidimencional string[,] ListaUnidad = new string[_cantidad_unidades, 6]; //Recorrer data table int _fila = 0; for (int i = 0; i < dt.Rows.Count; i++) { //Capturar datos de la fila recorridad en objeto empresa auxUnidad.Id_unidad = Convert.ToInt32(dt.Rows[i]["Id_unidad"]); auxUnidad.Nombre = (String)dt.Rows[i]["Nombre"]; auxUnidad.Descripcion = (String)dt.Rows[i]["Descripcion"]; auxUnidad.Estado = Convert.ToInt32(dt.Rows[i]["Estado"]); auxUnidad.Rut_empresa = (String)dt.Rows[i]["Rut_empresa"]; //variables temporales de apoyo string _estado = string.Empty; string _nombre_empresa = string.Empty; //cargar array con datos de fila ListaUnidad[_fila, 0] = auxUnidad.Id_unidad.ToString(); ListaUnidad[_fila, 1] = auxUnidad.Nombre; auxEmpresa = auxServiceEmpresa.TraerEmpresaConEntidad_Escritorio(auxUnidad.Rut_empresa); ListaUnidad[_fila, 2] = auxEmpresa.Nombre; ListaUnidad[_fila, 3] = auxEmpresa.Rut_empresa; if (auxUnidad.Estado == 0) { _estado = "DESACTIVADO"; } else { _estado = "ACTIVADO"; } ListaUnidad[_fila, 4] = _estado; ListaUnidad[_fila, 5] = auxUnidad.Descripcion; //agregar lista a gridview dgvUnidad.Rows.Add(ListaUnidad[_fila, 0], ListaUnidad[_fila, 1], ListaUnidad[_fila, 2], ListaUnidad[_fila, 3], ListaUnidad[_fila, 4], ListaUnidad[_fila, 5]); _fila++; } //vACIAR VARIABLES _id_unidad = null; _nombre = string.Empty; _descripcion = string.Empty; _estado = string.Empty; _rut_empresa = string.Empty; pbSeleccion.Visible = false; btnActivar.Visible = false; btnDesactivar.Visible = false; } else { //Mostrar GridView Vacio //vACIAR VARIABLES _id_unidad = null; _nombre = string.Empty; _descripcion = string.Empty; _estado = string.Empty; _rut_empresa = string.Empty; pbSeleccion.Visible = false; btnActivar.Visible = false; btnDesactivar.Visible = false; } } catch (Exception ex) { MessageBox.Show("Error en metodo de accion TxtFiltrar_KeyUp, Contactese con el Administrador Detalle de Error: " + ex.Message, "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
//Metodo de guardar private void BtnGuardar_Click(object sender, EventArgs e) { try { //Instancia de Web service con credenciales NT ServiceProcess_Unidad.Process_UnidadSoapClient auxServiceUnidad = new ServiceProcess_Unidad.Process_UnidadSoapClient(); auxServiceUnidad.ClientCredentials.UserName.UserName = Cuenta.Usuario_iis; auxServiceUnidad.ClientCredentials.UserName.Password = Cuenta.Clave_iis; ServiceProcess_Unidad.Unidad auxUnidad = new ServiceProcess_Unidad.Unidad(); //Validacion espacion en blanco y combobox vacios if (txtNombre.Text.Equals("") || txtDescripcion.Text.Equals("") || txtEmpresa.Text.Equals("")) { if (txtNombre.Text.Equals("")) { MessageBox.Show("El Nombre de la Unidad no Puede estar Vacia.", "ATENCION", MessageBoxButtons.OK, MessageBoxIcon.Information); } else if (txtDescripcion.Text.Equals("")) { MessageBox.Show("La Descripcion de la Unidad no Puede estar Vacia.", "ATENCION", MessageBoxButtons.OK, MessageBoxIcon.Information); } else if (txtEmpresa.Text.Equals("")) { MessageBox.Show("Debe seleccionar una Empresa a la cual pertenece la Unidad, en la Lista de la Izquierda.", "ATENCION", MessageBoxButtons.OK, MessageBoxIcon.Information); } } else { //Validacion de longitud de caracteres if (txtNombre.Text.Trim().Length < 4 || txtNombre.Text.Trim().Length > 99 || txtDescripcion.Text.Trim().Length < 10 || txtDescripcion.Text.Trim().Length > 250) { if (txtNombre.Text.Trim().Length < 4 || txtNombre.Text.Trim().Length > 99) { MessageBox.Show("El Nombre de la Unidad debe tener Minimo 4 caracteres y Maximo 99 .", "ATENCION", MessageBoxButtons.OK, MessageBoxIcon.Information); } else if (txtDescripcion.Text.Trim().Length < 10 || txtDescripcion.Text.Trim().Length > 250) { MessageBox.Show("La Descripcion de la Unidad debe tener Minimo 10 caracteres y Maximo 250 .", "ATENCION", MessageBoxButtons.OK, MessageBoxIcon.Information); } } else { auxUnidad = auxServiceUnidad.TraerUnidadPorNombrePorEmpresaConEntidad_Escritorio(txtNombre.Text.ToUpper(), _rut_empresa); //Validar si Nombre Unidad ya existe en la empresa if (auxUnidad.Nombre == null) { if (MessageBox.Show("Confirmar La Creacion de la Unidad", "Confirmar", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { //Insertar datos via web service auxServiceUnidad.InsertarUnidadSinEntidad_Escritorio(txtNombre.Text.ToUpper(), txtDescripcion.Text.ToUpper(), 1, _rut_empresa); //Metodo Carga de cuadro de datos //Metodo Carga de GridView this.DialogResult = DialogResult.OK; this.Close(); } else { //se devuelve al Cuadro de datos } } else { MessageBox.Show("Este Nombre de Unidad ya Existe en la Empresa Seleccionada", "ATENCION", MessageBoxButtons.OK, MessageBoxIcon.Information); } } } } catch (Exception ex) { MessageBox.Show("Error en metodo de accion BtnGuardar_Click, Contactese con el Administrador Detalle de Error: " + ex.Message, "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
public FormEquipoModal(string titulo_modal, string accion, string id_equipo, string rut_empresa, string id_unidad) { InitializeComponent(); try { if (Convert.ToInt32(accion) == 1) { ServiceProcess_Empresa.Process_EmpresaSoapClient auxServiceEmpresa = new ServiceProcess_Empresa.Process_EmpresaSoapClient(); auxServiceEmpresa.ClientCredentials.UserName.UserName = Cuenta.Usuario_iis; auxServiceEmpresa.ClientCredentials.UserName.Password = Cuenta.Clave_iis; ServiceProcess_Equipo.Process_EquipoSoapClient auxServiceEquipo = new ServiceProcess_Equipo.Process_EquipoSoapClient(); auxServiceEquipo.ClientCredentials.UserName.UserName = Cuenta.Usuario_iis; auxServiceEquipo.ClientCredentials.UserName.Password = Cuenta.Clave_iis; ServiceProcess_Unidad.Process_UnidadSoapClient auxServiceUnidad = new ServiceProcess_Unidad.Process_UnidadSoapClient(); auxServiceUnidad.ClientCredentials.UserName.UserName = Cuenta.Usuario_iis; auxServiceUnidad.ClientCredentials.UserName.Password = Cuenta.Clave_iis; ServiceProcess_Unidad.Unidad auxUnidad = new ServiceProcess_Unidad.Unidad(); ServiceProcess_Equipo.Equipo auxEquipo = new ServiceProcess_Equipo.Equipo(); ServiceProcess_Empresa.Empresa auxEmpresa = new ServiceProcess_Empresa.Empresa(); auxEquipo = auxServiceEquipo.TraerEquipoConEntidad_Escritorio(Convert.ToInt32(id_equipo)); auxEmpresa = auxServiceEmpresa.TraerEmpresaConEntidad_Escritorio(rut_empresa); _id_equipo = id_equipo; _rut_empresa = rut_empresa; _id_unidad = id_unidad; _guardar = accion; lblTitulo.Text = titulo_modal; cargarComboEmpresa(); cbEmpresa.SelectedValue = auxEmpresa.Rut_empresa; cbEmpresa.Enabled = false; txtEmpresa.Text = auxEmpresa.Nombre; txtEmpresa.Enabled = false; pbSeleccionEmpresa.Visible = true; cargarDataGridViewUnidad(); auxUnidad = auxServiceUnidad.TraerUnidadConEntidad_Escritorio(Convert.ToInt32(id_unidad), rut_empresa); txtUnidad.Text = auxUnidad.Nombre; pbSeleccionUnidad.Visible = true; txtUnidad.Enabled = false; txtNombreEquipo.Text = auxEquipo.Nombre; } else { _id_equipo = id_equipo; _id_unidad = id_unidad; _guardar = accion; lblTitulo.Text = titulo_modal; cargarComboEmpresa(); pbSeleccionEmpresa.Visible = false; pbSeleccionUnidad.Visible = false; txtEmpresa.Enabled = false; txtUnidad.Enabled = false; } } catch (Exception ex) { MessageBox.Show("Error al cargar Informacion Modal Equipo, Contactese con el Administrador Detalle de Error: " + ex.Message, "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void TxtFiltrar_KeyUp(object sender, KeyEventArgs e) { try { dgvEquipo.Rows.Clear(); dgvEquipo.Refresh(); dgvMiembros.Rows.Clear(); dgvMiembros.Refresh(); //instansear web service con seguridad ServiceProcess_Equipo.Process_EquipoSoapClient auxServiceEquipo = new ServiceProcess_Equipo.Process_EquipoSoapClient(); auxServiceEquipo.ClientCredentials.UserName.UserName = Cuenta.Usuario_iis; auxServiceEquipo.ClientCredentials.UserName.Password = Cuenta.Clave_iis; ServiceProcess_Empresa.Process_EmpresaSoapClient auxServiceEmpresa = new ServiceProcess_Empresa.Process_EmpresaSoapClient(); auxServiceEmpresa.ClientCredentials.UserName.UserName = Cuenta.Usuario_iis; auxServiceEmpresa.ClientCredentials.UserName.Password = Cuenta.Clave_iis; ServiceProcess_Unidad.Process_UnidadSoapClient auxServiceUnidad = new ServiceProcess_Unidad.Process_UnidadSoapClient(); auxServiceUnidad.ClientCredentials.UserName.UserName = Cuenta.Usuario_iis; auxServiceUnidad.ClientCredentials.UserName.Password = Cuenta.Clave_iis; ServiceProcess_Empresa.Empresa auxEmpresa = new ServiceProcess_Empresa.Empresa(); ServiceProcess_Unidad.Unidad auxUnidad = new ServiceProcess_Unidad.Unidad(); //capturar dataset DataSet ds = auxServiceEquipo.TraerEquipoPorClaveSinEntidad_Escritorio(Convert.ToInt32(_id_unidad), _rut_empresa, txtFiltrar.Text.ToUpper()); if ((ds.Tables.Count != 0) && (ds.Tables[0].Rows.Count > 0)) { //Capturar Tabla DataTable dt = ds.Tables[0]; //contar cantidad de empresas int _cantidad_equipos = dt.Rows.Count; //crear array bidimencional string[,] ListaEquipos = new string[_cantidad_equipos, 6]; //Recorrer data table int _fila = 0; for (int i = 0; i < dt.Rows.Count; i++) { //Capturar datos de la fila recorridad en objeto rol int id_equipo = Convert.ToInt32(dt.Rows[i]["Id_equipo"]); string nombre_equipo = (String)dt.Rows[i]["Nombre"]; string rut_empresa = (String)dt.Rows[i]["Rut_empresa"]; auxEmpresa = auxServiceEmpresa.TraerEmpresaConEntidad_Escritorio(rut_empresa); string nombre_empresa = auxEmpresa.Nombre; int id_unidad = Convert.ToInt32(dt.Rows[i]["Id_unidad"]); auxUnidad = auxServiceUnidad.TraerUnidadConEntidad_Escritorio(id_unidad, rut_empresa); string nombre_unidad = auxUnidad.Nombre; //cargar array con datos de fila ListaEquipos[_fila, 0] = id_equipo.ToString(); ListaEquipos[_fila, 1] = nombre_equipo; ListaEquipos[_fila, 2] = rut_empresa; ListaEquipos[_fila, 3] = nombre_empresa; ListaEquipos[_fila, 4] = id_unidad.ToString(); ListaEquipos[_fila, 5] = nombre_unidad; //agregar lista a gridview dgvEquipo.Rows.Add(ListaEquipos[_fila, 0], ListaEquipos[_fila, 1], ListaEquipos[_fila, 2], ListaEquipos[_fila, 3], ListaEquipos[_fila, 4], ListaEquipos[_fila, 5]); _fila++; } _id_equipo = null; _nombre = string.Empty; } else { _id_equipo = null; _nombre = string.Empty; } } catch (Exception ex) { MessageBox.Show("Error en metodo de accion TxtFiltrar_KeyUp, Contactese con el Administrador Detalle de Error: " + ex.Message, "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error); } }