コード例 #1
0
 private void NaarDBButton_Click(object sender, RoutedEventArgs e)
 {
     this.Dispatcher.Invoke(() =>
     {
         Bewerk(ConvertToBusinesslaag.convertToStrips(stripsFromDB)); //voer uit, schijf strips weg naar db
     });
 }
コード例 #2
0
        public List <Auteur> GetStripAuteurs(int id)
        {
            var command = new SqlCommand("select * from Auteur join Strip_has_Auteur on auteur.id = Strip_has_Auteur.Auteur_id Where Strip_id = @id");

            command.Parameters.Add(new SqlParameter("id", id));
            return(ConvertToBusinesslaag.ConvertToAuteurs((List <AuteurDB>)GetRecords(command)));
        }
コード例 #3
0
 public IEnumerable <Reeks> GetAll()
 {
     // DBAs across the country are having strokes
     //  over this next command!
     using var command = new SqlCommand("SELECT * FROM Reeks");
     return(ConvertToBusinesslaag.ConvertToReeksen((List <ReeksDB>)GetRecords(command)));
 }
コード例 #4
0
 public Strip GetById(int id)
 {
     // PARAMETERIZED QUERIES!
     using (var command = new SqlCommand("SELECT * FROM Strip WHERE id = @id"))
     {
         command.Parameters.Add(new SqlParameter("id", id));
         return(ConvertToBusinesslaag.convertToStrip(GetRecord(command)));
     }
 }
コード例 #5
0
 public Strip GetLastStrip()
 {
     // DBAs across the country are having strokes
     //  over this next command!
     using (var command = new SqlCommand("SELECT TOP 1 * FROM Strip ORDER BY ID DESC"))
     {
         return(ConvertToBusinesslaag.convertToStrip(GetRecord(command)));
     }
 }
コード例 #6
0
 public IEnumerable <Strip> GetAll()
 {
     // DBAs across the country are having strokes
     //  over this next command!
     using (var command = new SqlCommand("SELECT * FROM Strip"))
     {
         return(ConvertToBusinesslaag.convertToStrips((List <StripDB>)GetRecords(command)));
     }
 }
コード例 #7
0
 public IEnumerable <Uitgeverij> GetAll()
 {
     // DBAs across the country are having strokes
     //  over this next command!
     using (var command = new SqlCommand("SELECT * FROM Uitgeverij"))
     {
         return(ConvertToBusinesslaag.ConvertToUitgevers((List <UitgeverijDB>)GetRecords(command)));
     }
 }