public ActionResult RegisterNewCard(RegisterNewCardModel WebData)
 {
     try
     {
         if (ModelState.IsValid)
         {
             String             CardHolderName = this.HttpContext.User.Identity.Name;
             ICardHolderService CardHService   = new CardHolderService();
             if (CardHService.GetCardHolder(CardHolderName) == null)
             {
                 ModelState.AddModelError("", "Card holder not found");
             }
             else
             {
                 if (CardHService.GetCardCount(CardHolderName) == 5)
                 {
                     ModelState.AddModelError("", "Already have 5 cards registered");
                 }
                 else
                 {
                     CardHService.RegisterNewCard(CardHolderName, WebData.CardNumber);
                     ViewData["Message"] = "Registered!";
                 }
             }
         }
     }
     catch (Exception Ex)
     {
         ModelState.AddModelError("", "Error on Card Registration: " + Common.StandardExceptionErrorMessage(Ex));
     }
     // If we got this far, something failed, redisplay form
     return(View(WebData));
 }
        public ActionResult EditCardHolder()
        {
            EditCardHolderModel WebData = new EditCardHolderModel();

            try
            {
                String             CardHolderName = this.HttpContext.User.Identity.Name;
                ICardHolderService CardHService   = new CardHolderService();
                WebData = CardHService.GetCardHolder(CardHolderName);
            }
            catch (Exception Ex)
            {
                ViewData["Message"] = "Failure while trying to get cardholder data " + Common.StandardExceptionErrorMessage(Ex);
            }
            return(View(WebData));
        }