Exemplo n.º 1
0
 public InsertGenre(SqlConnection connection, RSSListener.Data.Model.Genre genre)
 {
     if (connection == null)
     {
         throw new ArgumentNullException("connection");
     }
     else if (connection.State != System.Data.ConnectionState.Open)
     {
         throw new Exception("connection's state is not open");
     }
     else
     {
         conn       = connection;
         this.genre = genre;
     }
 }
Exemplo n.º 2
0
 public RSSListener.Data.Model.Genre getGenreByName(string name, bool insertifnotfound = false)
 {
     RSSListener.Data.Model.Genre g = genres.getByName(name);
     if (g == null)
     {
         if (insertifnotfound)
         {
             RSSListener.SQL.Inserts.InsertGenre ig = new Inserts.InsertGenre(connection, new Data.Model.Genre(name));
             ig.writeInformation();
             g = ig.genre;
         }
         else
         {
             throw new Exception("Genre was not found and insertion flag is false");
         }
     }
     return(g);
 }
Exemplo n.º 3
0
 public RSSListener.Data.Model.Genre getGenreByID(Guid id)
 {
     RSSListener.Data.Model.Genre g = genres.getByID(id);
     return(g);
 }