Example #1
0
        public static List<Book> GetBooks(Boolean useDB)
        {
            try
            {
                List<Book> temp = new List<Book>();

                DataTable dt = DBPlayer.GetBooks(cs);

                foreach (DataRow dr in dt.Rows)
                {
                    Book book = new Book( dr[0].ToString(), dr[1].ToString(), dr[2].ToString(), dr[3].ToString(), dr[4].ToString());

                    temp.Add(book);
                }

                return temp;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Example #2
0
 public static void UpdateBook(Book book)
 {
     try
     {
         int lkm = DBPlayer.UpdateBook(cs, book.FName, book.LName, book.Price, book.Group, book.Id);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }