public static List <Empresa> List(FiltroEmpresa f) { List <Empresa> resulList = new List <Empresa>(); try { EmpresaDS dataservice = new EmpresaDS(); DataSet listado = dataservice.List(f); if (listado.Tables.Count > 0) { foreach (DataRow d in listado.Tables[0].Rows) { Empresa e = new Empresa(); ORM(e, d); resulList.Add(e); } } } catch (Exception ex) { throw ex; } return(resulList); }
public override System.Data.DataSet List(Filter f, out int RecordCount) { DataSet ds = new DataSet(); try { FiltroEmpresa filtro = (FiltroEmpresa)f; List <IDbDataParameter> paramList = new List <IDbDataParameter>(); DBRepository repository = DBRepository.GetDbRepository(); paramList.Add(repository.DbFactory.getDataParameter("P_ID", DbType.Int32, filtro.ID)); paramList.Add(repository.DbFactory.getDataParameter("P_SEARCH", DbType.String, filtro.Search)); bool result = repository.ExecuteListProcedure(CONST_LIST_PROCEDURE_NAME, paramList, f, ds, out RecordCount); } catch (Exception ex) { throw ex; } return(ds); }
private FiltroEmpresa prepararFiltroEmpresa() { FiltroEmpresa filtro = new FiltroEmpresa(); filtro.CUIT = this.tb_CUIT.Text; filtro.mail = this.tb_Mail.Text; filtro.razon_social = this.tb_Razon_social.Text; filtro.habilitada = this.chBox_Habilitados.Checked; return(filtro); }
private IResultado <IList <Empresa> > getEmpresasFiltrados(FiltroEmpresa filtro) { Resultado <IList <Empresa> > resultado = new Resultado <IList <Empresa> >(); try { resultado.Retorno = this.empresaDB.Filtrar(filtro); } catch (Exception ex) { MessageDialog.MensajeError(ex.Message); resultado.Correcto = false; resultado.Mensajes.Add(ex.Message); } return(resultado); }
protected override void AccionFiltrar() { FiltroEmpresa filtro = this.prepararFiltroEmpresa(); IResultado <IList <Empresa> > resultado = this.getEmpresasFiltrados(filtro); if (!resultado.Correcto) { throw new ResultadoIncorrectoException <IList <Empresa> >(resultado); } this.dgvBusqueda.DataSource = resultado.Retorno; this.dgvBusqueda.Columns["id_usuario"].Visible = false; this.dgvBusqueda.Columns["telefono"].Visible = false; this.dgvBusqueda.Columns["username"].Visible = false; this.dgvBusqueda.Columns["contrasenia"].Visible = false; this.dgvBusqueda.Columns["cantidadIntentos"].Visible = false; this.dgvBusqueda.Columns["habilitada_comprar"].Visible = false; }
public static List <Empresa> ListAll() { FiltroEmpresa f = new FiltroEmpresa(); return(List(f)); }
public void Deve_Retornar_Mesma_Quantidade_De_Elementos_Definido_Para_Empresa(int valorEsperado, FiltroEmpresa filtro) { var empresas = ConstruirEmpresas(); var resultado = empresas.WhereDynamic(filtro); Assert.Equal(valorEsperado, resultado.Count()); }