private void Lane_LaneRequestingAddCard(object sender, AddCardArgs e) { //Open dialog to capture card detials var result = new AddCardDialog().ShowDialog(); //Create card var parentLaneId = e.LaneId; var parentLane = e.Target; var cardName = result.Item1; var cardDescription = result.Item2; var cardPoints = result.Item3; var dialogResult = result.Item4; var cardType = result.Item5; if (dialogResult == DialogResult.Cancel || cardName == string.Empty) { return; } CardTypes parsedCardType; CardTypes.TryParse(cardType, true, out parsedCardType); //Insert card to UserControl Lane passed in Args var cardId = _cardDatabaseService.Insert(parentLaneId, cardName, cardDescription, cardPoints, parsedCardType); var card = new Card(parentLaneId, cardName, cardDescription, cardPoints, cardId, GlobalToolTip, parsedCardType); parentLane.AddCard(card); }
private void LoadCards(Lane lane, ToolTip globalToolTip) { var cardDocuments = _cardDatabaseService.Get(lane.Id); //TODO: Build cards and add them to lane foreach (var cardDocument in cardDocuments) { CardTypes.TryParse(cardDocument.CardType, true, out CardTypes resultingCardType); //Next line needed to reflect true card type. var card = new Card(cardDocument.ParentLaneId, cardDocument.CardName, cardDocument.CardDescription, cardDocument.CardPoints, cardDocument.Id, GlobalToolTip, resultingCardType); lane.AddCard(card); } }