示例#1
0
        public ActionResult SaveBoard(Board newBoard)
        {
            bool sucess = CreateBoard(newBoard);

            if(!sucess)
                return View(); //criar view em shared k recebe a mensagem de erro e apresenta

            List<Board> allBoards = getAllBoards();
            return View("Boards", allBoards);
        }
示例#2
0
文件: Board.cs 项目: asufia/0.3.0
        public static List<Board> GetAllBoards()
        {
            List<DAL.DataObjects.Board> dataList =BoardsManager.GetAllBoards();

            if(dataList == null)
                return null;

            List<Board> boardList = new List<Board>();

            foreach (DAL.DataObjects.Board dataBoard in dataList)
            {
                Board newBoard = new Board();

                newBoard.boardId = dataBoard.BoardId;
                newBoard.name = dataBoard.Name;
                newBoard.description = dataBoard.Description;
                newBoard.stateID = dataBoard.StateID;

                if (dataBoard.CardHolderList != null && dataBoard.CardHolderList.Count > 0)
                {
                    newBoard.cardHolderList = CardHolder.GetAllCardHoldersByBoardID(dataBoard.BoardId); 
                }

                boardList.Add(newBoard);
            }

            return boardList;
        }
示例#3
0
文件: Board.cs 项目: asufia/0.3.0
        private static Board copyFromDataObject(DAL.DataObjects.Board dataObjBoard)
        {
            Board newBoard = new Board();

            newBoard.boardId = dataObjBoard.BoardId;
            newBoard.name = dataObjBoard.Name;
            newBoard.stateID = dataObjBoard.StateID;
            newBoard.description = dataObjBoard.Description;

            if (dataObjBoard.CardHolderList != null && dataObjBoard.CardHolderList.Count > 0)
                newBoard.CardHolderList = CardHolder.GetAllCardHoldersByBoardID(dataObjBoard.BoardId);

            return newBoard;

        }
示例#4
0
文件: Board.cs 项目: asufia/0.3.0
        private static DAL.DataObjects.Board copyToDataObject(Board domainLayerBoard)
        {
            DAL.DataObjects.Board newBoard = new DAL.DataObjects.Board();

            newBoard.BoardId = domainLayerBoard.BoardId;
            newBoard.Name = domainLayerBoard.Name;
            newBoard.StateID = domainLayerBoard.StateID;
            newBoard.Description = domainLayerBoard.Description;

            return newBoard;
        }
示例#5
0
        //public static Board Create()
        //{
        //    return new Board();
        //}

        //public static Board getABoad(int id)
        //{
        //    return Board.GetBoard(id);
        //}

        public static bool CreateBoard(Board item)
        {
            return Board.CreateBoard(item.Name, item.Description);
        }
示例#6
0
 public ActionResult NewBoard()
 {
     Board newBoad = new Board();
     return View("CreateBoard", newBoad);
 }