예제 #1
0
 public ActionResult NewCardHolder(int id)
 {
     BoardID = id;
     CardHolder cardHolder = new CardHolder();
     cardHolder.BoardID = id;
     return View("CreateCardHolder", cardHolder);
 }
예제 #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 });
        }
예제 #3
0
파일: CardHolder.cs 프로젝트: asufia/0.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;

        }
예제 #4
0
파일: CardHolder.cs 프로젝트: asufia/0.3.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;
        }
예제 #5
0
파일: CardHolder.cs 프로젝트: asufia/0.3.0
        public static bool InsertCardHolderInBoard(int boardID, CardHolder cardHolder)
        {
            DAL.DataObjects.CardHolder newCardHolder = copyToDataObject(cardHolder);

            return BoardsManager.IncludeCardHolderInBoard(boardID, newCardHolder);
        }
예제 #6
0
 private void AddCardHolderToBoard(CardHolder newCardHolder)
 {
     CardHolder.InsertCardHolderInBoard(newCardHolder.BoardID, newCardHolder);
 }