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")); }
public IActionResult Search(int numero) { return(View("Index", Compte.GetCompteById(numero))); }