예제 #1
0
 public void RunCommand(object args, ActionCalled ac)
 {
     if (ac == ActionCalled.ShowStart)
     {
         this.pi = (PodcastInfo)args;
         Thread t = new Thread(new ThreadStart(UpdateTwitter));
         t.Start();
     }
 }
예제 #2
0
        /// <summary>
        /// Insert a podcast into the database
        /// </summary>
        /// <param name="pi">Podcast information to add</param>
        /// <param name="strFileName">File name of the podcast</param>
        public void InsertPodcast(PodcastInfo pi, string strFileName)
        {
            Connect();

            SQLiteCommand sql = new SQLiteCommand("INSERT INTO Episodes (ShowID, Title, Description, FileName, Release) VALUES (@ShowID, @Title, @Description, @FileName, @Release)", conn);
            sql.Prepare();
            sql.Parameters.AddWithValue("@ShowID", pi.kShow.nID);
            sql.Parameters.AddWithValue("@Title", pi.strTitle);
            sql.Parameters.AddWithValue("@Description", pi.strDescription);
            sql.Parameters.AddWithValue("@FileName", strFileName);
            sql.Parameters.AddWithValue("@Release", pi.dEnded);

            sql.ExecuteNonQuery();

            conn.Close();
        }
예제 #3
0
        /// <summary>
        /// Insert a podcast into the database.
        /// </summary>
        /// <param name="pi">Podcast to add</param>
        /// <param name="strFile">Finalized file name</param>
        public void InsertPodcast(PodcastInfo pi, string strFile)
        {
            Connect();

            MySqlCommand cmd = new MySqlCommand("INSERT INTO `Podcasts` (`ShowID`, `DateTime`, `Title`, `Description`, `File`) " +
                "VALUES (@ShowID, @DateTime, @Title, @Description, @File)", conn);

            cmd.Prepare();
            cmd.Parameters.AddWithValue("@ShowID", pi.kShow.nID);
            cmd.Parameters.AddWithValue("@DateTime", pi.dEnded);
            cmd.Parameters.AddWithValue("@Title", pi.strTitle);
            cmd.Parameters.AddWithValue("@Description", pi.strDescription);
            cmd.Parameters.AddWithValue("@File", strFile);

            cmd.ExecuteNonQuery();

            conn.Close();
        }