/// <summary> /// Default constructor /// </summary> public ClassBiz() { classDbfDB = new ClassDbfDB(); bog = new ClassBog(); user = new ClassUser(); MakeCollectionsForComboBoxes(); //boeger = classDbfDB.GetAllBooks(); }
public ObservableCollection <ClassBog> GetAllBooks() { ObservableCollection <ClassBog> CB = new ObservableCollection <ClassBog>(); DataTable dt = DbReturnDataTable("SELECT * FROM Books"); foreach (DataRow row in dt.Rows) { ClassBog bog = new ClassBog(); bog.id = Convert.ToInt32(row["id"].ToString()); bog.isbnNr = GetISBNFromDB(row["isbnID"].ToString()); bog.titel = GetTitleFromDB(row["titelID"].ToString()); bog.forfatter = GetAuthorFromDB(row["forfatterID"].ToString()); bog.forlag = GetPublisherFromDB(row["forlagID"].ToString()); bog.genre = GetGenreFromDB(row["genreID"].ToString()); bog.type = GetTypeFromDB(row["typeID"].ToString()); bog.pris = Convert.ToDecimal(row["pris"].ToString()); CB.Add(bog); } return(CB); }
public ObservableCollection <ClassBog> GetAllBooksLentToUser(string id) { ObservableCollection <ClassBog> res = new ObservableCollection <ClassBog>(); string sqlQuery = "SELECT Books.id, ISBNnr.isbnNr, Titel.titel, Forfatter.forfatter, Forlag.forlagsNavn, Genre.genreType, Type.TypeNavn, Books.pris " + "FROM Access INNER JOIN " + "Person ON Access.userID = Person.id INNER JOIN " + "Udlaan ON Person.id = Udlaan.personID INNER JOIN " + "Books ON Udlaan.bookID = Books.id INNER JOIN " + "ISBNnr ON Books.isbnID = ISBNnr.id INNER JOIN " + "Titel ON Books.titelID = Titel.id INNER JOIN " + "Forfatter ON Books.forfatterID = Forfatter.id INNER JOIN " + "Forlag ON Books.forlagID = Forlag.id INNER JOIN " + "Genre ON Books.genreID = Genre.id INNER JOIN " + "Type ON Books.typeID = Type.id " + $"WHERE(Access.cprNr = N'{id}') AND(Udlaan.udlansStatus = 1)"; DataTable dt = DbReturnDataTable(sqlQuery); foreach (DataRow row in dt.Rows) { ClassBog cb = new ClassBog(); cb.id = Convert.ToInt32(row["id"]); cb.isbnNr = row["isbnNr"].ToString(); cb.title = row["titel"].ToString(); cb.title = row["forfatter"].ToString(); cb.title = row["forlagsNavn"].ToString(); cb.title = row["genreType"].ToString(); cb.title = row["TypeNavn"].ToString(); cb.iD = Convert.ToDecimal(row["pris"]); res.Add(cb); } return(res); }
public void UpdateRentStatus(ClassBog inBook, ClassUser inPerson) { ExecuteNonQuery($"UPDATE Udlaan SET udlaansStatus = {inBook.rentdate.udlaanstatus}, udlaansDato = {inBook.rentdate.strUdlaansDate}, personID = {inPerson.id}, bookID = {inBook.id}"); }
public void UpdateBook(ClassBog CB) { ExecuteNonQuery($""); }
public bool CheckForDoubleLending(ClassBog bog) { }
public void SubmiThisBookToTheLibrary(ClassBog bog, ClassPerson person) { }
public void LendThisBookToTheUser(ClassBog bog, ClassBog person) { }
public void addbook(ClassBog bog) { }
public void LendThisBookToTheUser(ClassBog lentBook, ClassUser user) { }
public bool CheckForDoubleLending(ClassBog bog) { throw new NotImplementedException(); }
public void LendThisBookToTheUser(ClassBog id, ClassPerson personID) { }