public Card getCardById(string cardId)
 {
     Card returnCard = new Card(cardId);
     NpgsqlConnection conn = databaseConnection.ConnectToDatabase();
     conn.CreateCommand();
     NpgsqlCommand command = new NpgsqlCommand("select * from dbcard where cardid = :value1", conn);
     command.Parameters.Add(new NpgsqlParameter("value1", DbType.String));
     command.Parameters[0].Value = cardId;
     command.Connection = conn;
     DataTable result = databaseConnection.ExecuteSelectQuery(command, conn);
     if (result != null)
     {
         returnCard = dataTableToCardList(result).ToArray()[0];
     }
     return returnCard;
 }
        public bool AddCardToDeck(Card card, Deck deck)
        {
            NpgsqlConnection conn = databaseConnection.ConnectToDatabase();
            conn.CreateCommand();
            NpgsqlCommand command = new NpgsqlCommand("insert into dbcardtodeck(deckid, cardid) values(:value1, :value2)", conn);
            command.Parameters.Add(new NpgsqlParameter("value1", DbType.String));
            command.Parameters.Add(new NpgsqlParameter("value2", DbType.String));
            command.Parameters[0].Value = card.CardId;
            command.Parameters[1].Value = deck.DeckId;
            command.Connection = conn;
            if (databaseConnection.ExecuteChangeQuery(command, conn))
            {
                return true;
            }

            return false;
        }
 public void addCardToDeck(Card card, Deck deck)
 {
     deckDatabaseController.AddCardToDeck(card, deck);
 }
 public void removeCardFromDeck(Card card, Deck deck)
 {
 }