private void BindGrid() { SisPackController.AdministrarGrillas.Configurar(this.dtgEmpresas, "EmpresaTercerosID", this.CantidadOpciones); try { IEmpresaTerceros empresa = EmpresaTercerosFactory.GetEmpresaTerceros(); int agenciaRef = this.txtAgenciaReferencia.Text == "" ? 0 : Convert.ToInt32(this.txtAgenciaReferencia.Text); DsEmpresaTerceros ds = empresa.GetEmpresaTerceros(agenciaRef); string razon = this.txtRazonSocial.Text; string filtro = "RazonSocial LIKE '" + razon + "%'"; DsEmpresaTerceros.DatosRow[] drLista = (DsEmpresaTerceros.DatosRow[])ds.Datos.Select(filtro); this.dtgEmpresas.DataSource = drLista; this.dtgEmpresas.DataBind(); } catch (Exception ex) { throw ex; //this.txtErrorMsg.Text = "Error al consultar datos de agencias: " + ex.Message; } }
private void BindGrid(int currentPage) { SisPackController.AdministrarGrillas.Configurar(dtgEmpresaTerceros, "EmpresaTercerosID", 10); IEmpresaTerceros empresaTerceros = EmpresaTercerosFactory.GetEmpresaTerceros(); empresaTerceros.RazonSocial = this.txtEmpresaTerceros.Text; dtgEmpresaTerceros.DataSource = empresaTerceros.GetEmpresaTerceros(); // actualizo la grilla dtgEmpresaTerceros.CurrentPageIndex = currentPage; dtgEmpresaTerceros.DataBind(); }
private void Buscar() { int total = 0; try { IEmpresaTerceros empresa = EmpresaTercerosFactory.GetEmpresaTerceros(); int agenciaRef = this.agenciaReferencia == "" ? 0 : Convert.ToInt32(this.agenciaReferencia); DsEmpresaTerceros ds = empresa.GetEmpresaTerceros(agenciaRef); string filtro = "RazonSocial LIKE '" + this.razonSocial + "%'"; DsEmpresaTerceros.DatosRow[] drLista = (DsEmpresaTerceros.DatosRow[])ds.Datos.Select(filtro); total = drLista.Length; if (total > 0) { if (total == 1) { DsEmpresaTerceros.DatosRow dr = drLista[0]; this.txtEmpresaTercerosID.Text = dr.EmpresaTercerosID.ToString(); this.txtRazonSocial.Text = dr.RazonSocial; this.txtErrorMsg.Text = ""; this.txtOpen.Text = ""; } else { this.txtRazonSocial.Text = this.razonSocial; this.txtAgenciaReferencia.Text = this.agenciaReferencia; this.txtOpen.Text = "S"; } } else { this.txtEmpresaTercerosID.Text = ""; this.txtErrorMsg.Text = "No se encontraron datos."; this.txtOpen.Text = ""; } } catch (Exception ex) { this.txtErrorMsg.Text = "Error al consultar datos de empresa de terceros: " + ex.Message; } }