Пример #1
0
        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();
            }
        }
Пример #2
0
 private void LoadCard()
 {
     CurrentCard = FQ.DrawCard();
 }
Пример #3
0
        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();
            }
        }
Пример #4
0
 public static void AddCard(Card card)
 {
     AddCard(card.DeckID, card.CardID, card.FrontText, card.FrontLanguage, card.BackText, card.BackLanguage, card.Picture);
 }