@*<!DOCTYPE html>
<html lang="fr">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Formulaire de Compte</title>
    <link rel="stylesheet" href="~/css/bank.css">
</head>
<body>
    <div class="form-container">
        <div class="header">
            <a asp-controller="Acceuil" asp-action="Acceuil"><span class="back-btn">←</span></a>
            <h2>Compte</h2>
        </div>
        <form id="compteForm">
            <label for="typeCompte">Type de compte</label>
            <select id="typeCompte" name="typeCompte">
                <option value="compteCourant">Compte Courant</option>
                <option value="compteEpargne">Compte Épargne</option>
                <option value="compteEntreprise">Compte Entreprise</option>
            </select>

            <label for="solde">Solde</label>
            <input type="text" id="solde" name="solde" placeholder="Entrez le solde" required>

            <button type="submit">Soumettre</button>
        </form>
    </div>
</body>
</html>*@

@model IEnumerable<FamilyBudget.Models.Compte>
<link rel="stylesheet" href="~/css/bankcss.css"/>
<h2>Liste des Comptes</h2>
<p><a class="btn btn-primary" asp-action="Create">✚ Créer un nouveau compte</a></p>
<table class="table table-striped table-bordered">
    <thead class="thead-dark">
        <tr>
            <th>Type</th>
            <th>Solde</th>
            <th>Utilisateur</th>
            <th>Actions</th>
        </tr>
    </thead>
    <tbody>
        @foreach (var item in Model)
        {
<tr>
    <td>@item.Type</td>
    <td>@item.Solde</td>
    <td>@item.IdUtilisateurNavigation.Nom</td>
    <td>
        <a class="btn btn-info btn-sm" asp-action="Edit" asp-route-id="@item.IdCompte">Modifier</a> |
        <a class="btn btn-warning btn-sm" asp-action="Details" asp-route-id="@item.IdCompte">Détails</a> |
        <a class="btn btn-danger btn-sm" asp-action="Delete" asp-route-id="@item.IdCompte">Supprimer</a>
    </td>
</tr>}
    </tbody>
</table>

