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); }
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; }
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; }
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; }
//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); }
public ActionResult NewBoard() { Board newBoad = new Board(); return View("CreateBoard", newBoad); }