Esempio n. 1
0
 /// <summary>
 /// Default constructor
 /// </summary>
 public ClassBiz()
 {
     classDbfDB = new ClassDbfDB();
     bog        = new ClassBog();
     user       = new ClassUser();
     MakeCollectionsForComboBoxes();
     //boeger = classDbfDB.GetAllBooks();
 }
Esempio n. 2
0
        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);
        }
Esempio n. 3
0
        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);
        }
Esempio n. 4
0
 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}");
 }
Esempio n. 5
0
 public void UpdateBook(ClassBog CB)
 {
     ExecuteNonQuery($"");
 }
Esempio n. 6
0
 public bool CheckForDoubleLending(ClassBog bog)
 {
 }
Esempio n. 7
0
 public void SubmiThisBookToTheLibrary(ClassBog bog, ClassPerson person)
 {
 }
Esempio n. 8
0
 public void LendThisBookToTheUser(ClassBog bog, ClassBog person)
 {
 }
Esempio n. 9
0
 public void addbook(ClassBog bog)
 {
 }
Esempio n. 10
0
 public void LendThisBookToTheUser(ClassBog lentBook, ClassUser user)
 {
 }
 public bool CheckForDoubleLending(ClassBog bog)
 {
     throw new NotImplementedException();
 }
 public void LendThisBookToTheUser(ClassBog id, ClassPerson personID)
 {
 }