Пример #1
0
        public void CreateDeck(Deck newDeck)
        {
            int deckId = decksSqlDAL.CreateDeck(newDeck);

            if (deckId != 0)
            {
                newDeck.Cards = new List <Card>();
            }
        }
Пример #2
0
        public IActionResult CreateDeck(Deck newDeck)
        {
            int deckId = decksSqlDAL.CreateDeck(newDeck);

            if (deckId != 0)
            {
                newDeck.Cards = new List <Card>();
                return(RedirectToAction("ViewDeck", new { deckId = newDeck.Id }));
            }
            else
            {
                return(NotFound());
            }
        }
Пример #3
0
 public void Initialize()
 {
     tran           = new TransactionScope();
     dal            = new DeckSqlDAL(connectionString);
     cardDal        = new CardSqlDAL(connectionString);
     usersDeckCount = dal.GetDecksbyUserId(1).Count;
     testDeck       = new Deck()
     {
         Name        = "Test Deck",
         Description = "Test Decription",
         DateCreated = DateTime.Now,
         PublicDeck  = false,
         ForReview   = false,
         UserId      = 1
     };
     testDeckId = dal.CreateDeck(testDeck);
 }