Browse Source

zwischenstand

Amedeo
Naumann 2 years ago
parent
commit
67eb721d38
  1. 15
      Models/KatalogModel.cs

15
Models/KatalogModel.cs

@ -91,7 +91,20 @@ namespace BuecherwurmAPI.Models
{
// funktioniert das so?
command.CommandText = @"INSERT INTO Books (Name, Author, Country, Link, Language, Pages, Year, ProductId, Category, ImageLink, LendTime, LendType) VALUES (book.Name, book.Author, book.Contry, book.Link, book.Language, book.Pages, book.Year, book.ProductId, book.Category, book.ImageLink, book.LendTime, book.LendType)";
var dataReader = command.ExecuteReader();
command.Parameters.Add(new SqliteParameter("@itemId", lend.ItemId));
command.Parameters.Add(new SqliteParameter("@returnDate", lend.ReturnDate));
command.Parameters.Add(new SqliteParameter("@customer", lend.Customer));
var success = command.ExecuteNonQuery();
if (success == 1)
{
command.CommandText = @"SELECT last_insert_rowid()";
return (long)command.ExecuteScalar();
}
return -1;
}
}

Loading…
Cancel
Save