public void CreateDeck(Deck newDeck) { int deckId = decksSqlDAL.CreateDeck(newDeck); if (deckId != 0) { newDeck.Cards = new List <Card>(); } }
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()); } }
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); }