コード例 #1
0
        //Method to gather information from a user to update a player
        public ActionResult UpdatePlayer(int playerId)
        {
            //declaring object using model PlayerPO
            PlayerPO playerToUpdate = new PlayerPO();

            //Beginning of processes
            try
            {
                //declare List using Model PlayerDO, and use it to store all information on the game recovered by using a DAL access call
                PlayerDO item = _dataAccess.PlayerReadByID(playerId);
                //assign all data to object using a mapper
                playerToUpdate = MapPlayerTF.PlayerDOtoPO(item);
            }
            //catch to record any exceptions that crop up
            catch (Exception ex)
            {
                //call to method to record necessary information
                ErrorFile.ErrorHandlerPL(ex);
            }
            //finally to tie up any loose ends
            finally
            { }
            //Sends the data in the list to the view to be seen by the user.
            return(View(playerToUpdate));
        }