Ejemplo n.º 1
0
 public ActionResult NewCardHolder(int id)
 {
     BoardID = id;
     CardHolder cardHolder = new CardHolder();
     cardHolder.BoardID = id;
     return View("CreateCardHolder", cardHolder);
 }
Ejemplo n.º 2
0
        //public ActionResult PresentCardHolder(int boardId, int cardHolderId)
        //{
        //    CardHolder editCardHolder = CardHolder.getCardHolderByID(cardHolderId, boardId);
        //    return View("CardHolder");
        //}

        public ActionResult SaveCardHolder(CardHolder newCardHolder)
        {
            newCardHolder.BoardID = BoardID;

            AddCardHolderToBoard(newCardHolder);

            return RedirectToAction("PresentBoard", "Board", new { id = BoardID });
        }
Ejemplo n.º 3
0
        private static CardHolder copyFromDataObject(DAL.DataObjects.CardHolder dataObjCardHolder)
        {
            CardHolder newCardHolder = new CardHolder();

            newCardHolder.CardHolderID = dataObjCardHolder.CardHolderID;
            newCardHolder.boardID = dataObjCardHolder.BoardID;
            newCardHolder.name = dataObjCardHolder.Name;
            newCardHolder.stateID = dataObjCardHolder.StateID;
            newCardHolder.description = dataObjCardHolder.Description;

            if (dataObjCardHolder.CardList != null && dataObjCardHolder.CardList.Count > 0)
            {
                newCardHolder.CardList = new List<Card>();

                foreach (DAL.DataObjects.Card card in dataObjCardHolder.CardList)
                {
                    newCardHolder.CardList.Add(Card.copyFromDataObject(card));
                }
            }

            return newCardHolder;

        }
Ejemplo n.º 4
0
        private static DAL.DataObjects.CardHolder copyToDataObject(CardHolder domainLayerCardHolder)
        {
            DAL.DataObjects.CardHolder newCardHolder = new DAL.DataObjects.CardHolder();

            newCardHolder.CardHolderID = domainLayerCardHolder.CardHolderID;
            newCardHolder.BoardID = domainLayerCardHolder.BoardID;
            newCardHolder.Name = domainLayerCardHolder.Name;
            newCardHolder.StateID = domainLayerCardHolder.StateID;
            newCardHolder.Description = domainLayerCardHolder.Description;

            if (domainLayerCardHolder.CardList != null && domainLayerCardHolder.CardList.Count > 0)
            {
                newCardHolder.CardList = new List<DAL.DataObjects.Card>();

                foreach (Card card in domainLayerCardHolder.CardList)
                {
                    newCardHolder.CardList.Add(Card.copyToDataObject(card));
                }
            }

            return newCardHolder;
        }
Ejemplo n.º 5
0
        public static bool InsertCardHolderInBoard(int boardID, CardHolder cardHolder)
        {
            DAL.DataObjects.CardHolder newCardHolder = copyToDataObject(cardHolder);

            return BoardsManager.IncludeCardHolderInBoard(boardID, newCardHolder);
        }
Ejemplo n.º 6
0
 private void AddCardHolderToBoard(CardHolder newCardHolder)
 {
     CardHolder.InsertCardHolderInBoard(newCardHolder.BoardID, newCardHolder);
 }