示例#1
0
 /// <summary>Regista uma nova notcia</summary>
 public void AddNews( Entry entry )
 {
     #if !DEBUG
     Mailer.SendToNewsML( entry.Title, entry.Content );
     #endif
     Register(entry);
 }
示例#2
0
        /// <summary>Regista uma nova notícia</summary>
        protected override void Register( Entry entry )
        {
            Hashtable parameters = new Hashtable();
            parameters.Add( "@title", entry.Title );
            parameters.Add( "@content", entry.Content );

            SqlServerUtility.executeNonQuery("OrionsBelt_InsertNews",parameters);
        }
示例#3
0
        /// <summary>Regista uma nova notícia</summary>
        protected override void Register( Entry entry )
        {
            PostGre.PostGreParam [] param = new PostGreParam[3];
            param[0] = new PostGreParam( entry.Title,NpgsqlDbType.Varchar );
            param[1] = new PostGreParam( entry.Content,NpgsqlDbType.Varchar );
            param[2] = new PostGreParam( entry.Language,NpgsqlDbType.Varchar );

            PostGreServerUtility.executeNonQuery2("OrionsBelt_InsertNews",param);
        }
示例#4
0
 /// <summary>Regista uma nova notícia</summary>
 protected override void Register( Entry entry )
 {
     /*CREATE TABLE News (
         Id int NOT NULL auto_increment,
     Title varchar(100) NOT NULL,
     Content mediumtext NOT NULL,
     Date datetime NOT NULL default '0000-00-00 00:00:00',
     PRIMARY KEY  (Id)
     ) TYPE=MyISAM;
     */
     string query = string.Format("INSERT INTO News(Title, Content, Date) VALUES('{0}', '{1}', NOW())",
                                  entry.Title,
                                 entry.Content
                         );
     MySqlUtility.executeNonQuery(query);
 }
示例#5
0
        /// <summary>Cria uma NewsList com base num DataSet</summary>
        /// <remarks>
        /// 	Este mtodo espera um dataset com as seguintes colunas, na
        /// 	ordem seguinte:
        /// 	id | Title | Content | Date
        ///
        /// 	O mtodo no liga aos nomes, vai aos ndices buscar o contedo
        /// </remarks>
        public NewsList NewsFromDataSet( DataSet ds )
        {
            NewsList list = new NewsList();

            foreach( DataRow row in ds.Tables[0].Rows ) {
                DateTime date = (DateTime) row[3];
                string title = row[1].ToString();
                string message = row[2].ToString();
                string lang = row[3].ToString();
                Entry entry = new Entry(date, message, title,lang);
                entry.Id = (int) row[0];
                list.List.Add(entry);
            }

            return list;
        }
示例#6
0
 /// <summary>Regista uma nova notcia</summary>
 protected abstract void Register( Entry entry );