//Method to pass in all information gathered from a user and update a player's information in the database public ActionResult UpdatePlayer(PlayerPO form) { //Declaring an action result variable, but assigning it to null to reassign later ActionResult result = null; //Checks to see if the UI form is filled out correctly if (ModelState.IsValid) { //Beginning of processes try { //passing the UI form information to run through our mapper, and assigning it to a DO object PlayerDO dataObject = MapPlayerTF.PlayerPOtoDO(form); //calling on a DAL access field to allow us to use a specific method within, while passing in the DO object _dataAccess.PlayerUpdate(dataObject); } //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 { } //assigns a page redirection to our variable result = RedirectToAction("Index", "Player"); } //section of code that runs if the form is not valid else { //assigns a page redirection to our variable result = View(form); } //runs the portion of code that is necessary for the situation return(result); }