public List <ElementoMapa> ListarElementos() { List <ElementoMapa> elementos = new List <ElementoMapa>(); try { string sql = "SELECT * FROM ElementoMapa (NOLOCK) where Listar = 1"; bd.Consulta(sql); while (bd.Consulta().Read()) { ElementoMapa sem = new ElementoMapa(); sem.Ler(bd.LerInt("ID")); elementos.Add(sem); } bd.Fechar(); } catch (Exception ex) { throw ex; } return(elementos); }
public List <SetorElementoMapa> ListarElementos(int SetorID) { List <SetorElementoMapa> elementos = new List <SetorElementoMapa>(); try { string sql = "SELECT sem.* FROM SetorElementoMapa (NOLOCK) sem WHERE sem.SetorID = " + SetorID + " ORDER BY Z"; bd.Consulta(sql); while (bd.Consulta().Read()) { SetorElementoMapa sem = new SetorElementoMapa(); sem.Ler(bd.LerInt("ID")); elementos.Add(sem); } foreach (var setorElemento in elementos) { var elemento = new ElementoMapa(); elemento.Ler(setorElemento.ElementoMapaID.Valor); setorElemento.ElementoMapa = elemento; } bd.Fechar(); } catch (Exception ex) { throw ex; } return(elementos); }
// passar o Usuario logado no sistema public ElementoMapaLista_B() { elementoMapa = new ElementoMapa(); }