Exemplo n.º 1
0
 public ActionResult Recharge(RechargeViewModel rechargeViewModel)
 {
     if (ModelState.IsValid)
     {
         if (OperationsService.RechargeBalance(User.CardId, Convert.ToDecimal(rechargeViewModel.Amount)))
         {
             return(RedirectToAction("Index"));
         }
         else
         {
             ModelState.AddModelError("", "Could not recharge current card. Try again!");
         }
     }
     return(View());
 }