zwischenstand
This commit is contained in:
parent
a1ffee2e09
commit
67eb721d38
1 changed files with 14 additions and 1 deletions
|
@ -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…
Reference in a new issue