示例#1
0
        public List <IRLib.ClientObjects.EstruturaEventoTipos> CarregarSelecionados(int EventoID)
        {
            List <IRLib.ClientObjects.EstruturaEventoTipos> Lista = new List <IRLib.ClientObjects.EstruturaEventoTipos>();
            StringBuilder stbSQL = new StringBuilder();

            try
            {
                stbSQL.Append("SELECT ID, TipoID, SubtipoID ");
                stbSQL.Append("FROM tEventoTipos ");
                stbSQL.Append("WHERE EventoID = " + this.EventoID + " ");
                stbSQL.Append("ORDER BY ID");

                bd.Consulta(stbSQL.ToString());

                while (bd.Consulta().Read())
                {
                    IRLib.ClientObjects.EstruturaEventoTipos Item = new IRLib.ClientObjects.EstruturaEventoTipos();
                    Item.TipoID    = bd.LerInt("TipoID");
                    Item.SubtipoID = bd.LerInt("SubtipoID");
                    Item.Adicionar = true;
                    Lista.Add(Item);
                }
                return(Lista);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                bd.Fechar();
            }
        }
示例#2
0
        public List <IRLib.ClientObjects.EstruturaEventoTipos> Carregar()
        {
            List <IRLib.ClientObjects.EstruturaEventoTipos> Lista = new List <IRLib.ClientObjects.EstruturaEventoTipos>();
            StringBuilder stbSQL = new StringBuilder();

            try
            {
                stbSQL.Append("SELECT tEventoTipo.ID AS TipoID, tEventoTipo.Nome AS Tipo, ");
                stbSQL.Append("tEventoSubtipo.ID as SubtipoID, tEventoSubtipo.Descricao AS Subtipo ");
                stbSQL.Append("FROM tEventoTipo ");
                stbSQL.Append("INNER JOIN tEventoSubtipo ON tEventoTipo.ID = tEventoSubtipo.EventoTipoID ");
                stbSQL.Append("ORDER BY tEventoTipo.ID");

                bd.Consulta(stbSQL.ToString());

                while (bd.Consulta().Read())
                {
                    IRLib.ClientObjects.EstruturaEventoTipos Item = new IRLib.ClientObjects.EstruturaEventoTipos();
                    Item.TipoID    = bd.LerInt("TipoID");
                    Item.Tipo      = bd.LerString("Tipo");
                    Item.SubtipoID = bd.LerInt("SubtipoID");
                    Item.Subtipo   = bd.LerString("Subtipo");
                    Item.Adicionar = false;
                    Lista.Add(Item);
                }
                return(Lista);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                bd.Fechar();
            }
        }