Exemple #1
0
        public ActionResult SaveCard(Card newCard)
        {
            newCard.CardHolderID = cardHolderID;

            Card.CreateCard(newCard, boardID);

            return RedirectToAction("PresentBoard", "Board", new { id = boardID });
        }
Exemple #2
0
        public ActionResult UpdateCard(Card card, int id)
        {
            card.CardID = id;
            card.CardHolderID = cardHolderID;

            if (!Card.UpdateCard(card))
                return View("Error");

            return RedirectToAction("PresentBoard", "Board", new { id = boardID });
        }
Exemple #3
0
        public ActionResult NewCard(int id)
        {
            CardHolder cardHolder = CardHolder.getCardHolderByID(id);

            if (cardHolder == null)
                return View("Error"); 

            boardID = cardHolder.BoardID;
            cardHolderID = id;
            Card card = new Card();
            return View("CreateCard", card);
        }
Exemple #4
0
        public static bool CreateCard(Card item, int boardID)
        {
            DAL.DataObjects.Card newCard = copyToDataObject(item);

            return BoardsManager.CreateCard(boardID, item.CardHolderID, newCard);
        }
Exemple #5
0
        public static Card copyFromDataObject(DAL.DataObjects.Card dataObjCard)
        {
            Card newCard = new Card();

            newCard.cardID = dataObjCard.CardId;
            newCard.cardHolderID = dataObjCard.CardHolderId;
            newCard.name = dataObjCard.Name;
            newCard.description = dataObjCard.Description;
            newCard.creationDate = dataObjCard.CreationDate;
            newCard.finalDate = dataObjCard.FinalDate;

            return newCard;

        }
Exemple #6
0
        public static DAL.DataObjects.Card copyToDataObject(Card domainLayerCard)
        {
            DAL.DataObjects.Card newCard = new DAL.DataObjects.Card();

            newCard.CardId = domainLayerCard.CardID;
            newCard.CardHolderId = domainLayerCard.CardHolderID;
            newCard.Name = domainLayerCard.Name;
            newCard.Description = domainLayerCard.Description;
            newCard.CreationDate = domainLayerCard.CreationDate;
            newCard.FinalDate = domainLayerCard.FinalDate;

            return newCard;
        }
Exemple #7
0
        public static bool UpdateCard(Card card)
        {
            DAL.DataObjects.Card item = copyToDataObject(card);

            return BoardsManager.UpdateCard(item);
        }