private void AddCardButton_Click(object sender, RoutedEventArgs e) { if (SelectedDeck != null) { var NewCard = new Model.Card(); NewCard.FrontText = "New Card"; NewCard.DeckID = selectedDeck.DeckID; CardList.Add(NewCard); CardSelector.Items.Refresh(); } }
private void LoadCard() { CurrentCard = FQ.DrawCard(); }
public static void DeleteCard(Card card) { using (var connection = new SqlConnection("Data Source=(local);Initial Catalog=FlashcardDeckDB;Integrated Security=SSPI;")) { connection.Open(); var command = new SqlCommand("deleteCard", connection); command.CommandType = CommandType.StoredProcedure; command.Parameters.AddWithValue("@CardID", card.CardID); command.ExecuteNonQuery(); } }
public static void AddCard(Card card) { AddCard(card.DeckID, card.CardID, card.FrontText, card.FrontLanguage, card.BackText, card.BackLanguage, card.Picture); }