Exemplo n.º 1
0
        public ActionResult Cash()
        {
            if (IsPinChecked)
            {
                ExecutionResult<CardDto> result = CommandBus.ExecuteCommand(new CardRequest() { Value = CardDto.Number }) as ExecutionResult<CardDto>;
                if (result != null && result.Success && result.TypedResult != null)
                {
                    CardDto = result.TypedResult;
                    var model = new CashModel()
                    {
                        CurrencyType = (CurrencyTypeEnum)CardDto.AccountIdObject.CurrencyType
                    };
                    return View(model);

                }
                return RedirectToAction("Index");
            }
            LastActionUrl = Url.Action("Cash");
            PinFailCount = 0;
            return RedirectToAction("CheckPin");
        }
Exemplo n.º 2
0
 public ActionResult Cash(CashModel model)
 {
     if (ModelState.IsValid)
     {
         var result = CommandBus.ExecuteCommand(new CashRequest {AccountId = CardDto.AccountId, Summ = model.Value});
         if (result.Success)
         {
             return View("Success");
         }
         return View("Fail");
     }
     IsPinChecked = false;
     return RedirectToAction("Cash");
 }