Exemplo n.º 1
0
        public IActionResult SubmitOperation(int numero, decimal montant, string type)
        {
            Compte compte = Compte.GetCompteById(numero);

            if (compte != null)
            {
                if (type == "depot")
                {
                    compte.Depot(montant);
                }
                else if (type == "retrait")
                {
                    compte.Retrait(montant);
                }
                return(RedirectToAction("Search", new { numero = compte.Numero }));
            }

            return(RedirectToAction("Index"));
        }
Exemplo n.º 2
0
 public IActionResult Search(int numero)
 {
     return(View("Index", Compte.GetCompteById(numero)));
 }