Example #1
0
        /// <summary>
        /// Método que seta a flag de automático
        /// </summary>
        public void SetApresentaInformacao(Global.Informacao tipo)
        {
            if (!ExistsTable("APRESENTACAO"))
            {
                CreateTable("CREATE TABLE APRESENTACAO( APRESENTACAO CHAR(1) DEFAULT '0' NOT NULL, PRIMARY KEY(APRESENTACAO))");
            }
            if (!Select("SELECT 1 FROM APRESENTACAO").Read())
            {
                Insert("INSERT INTO APRESENTACAO (APRESENTACAO) VALUES ('1')");
            }

            Update("UPDATE APRESENTACAO SET APRESENTACAO = '" + (tipo == Global.Informacao.NAOAPRESENTAR ? '0' : '1') + "'");
        }
Example #2
0
        /// <summary>
        /// Método que pega a flag de automático
        /// </summary>
        public Global.Informacao GetApresentaInformacao()
        {
            Global.Informacao tipo = Global.Informacao.APRESETAR;

            if (!ExistsTable("APRESENTACAO"))
            {
                SetApresentaInformacao(Global.Informacao.APRESETAR);
            }

            DbDataReader reader = Select("SELECT APRESENTACAO FROM APRESENTACAO");

            reader.Read();
            tipo = (reader["APRESENTACAO"].ToString().Equals("0") ? Global.Informacao.NAOAPRESENTAR : Global.Informacao.APRESETAR);
            reader.Close();

            return(tipo);
        }