public ActionResult UnregisterCard(int ID, UnregisterCardModel WebData) { try { if (ModelState.IsValid) { String CardHolderName = this.HttpContext.User.Identity.Name; ICardHolderService CardHService = new CardHolderService(); CardHService.UnregisterCard(CardHolderName, WebData.ID); ViewData["Message"] = "Unregistered!"; } } catch (Exception Ex) { ModelState.AddModelError("", "Error on Card Unregistration: " + Common.StandardExceptionErrorMessage(Ex)); } // If we got this far, something failed, redisplay form return(View(WebData)); }