| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181 |
- @model IEnumerable<GreenTree.Strohrmann.ERP.Web.Models.Business.CustomerModel>
- @{
- ViewData["Title"] = "Kundenliste";
- }
- <!-- Custom JavaScript -->
- <script>
- $(document).ready(function () {
- $("#customersTable").DataTable({
- autoWidth: false,
- paging: true,
- pageLength: 50,
- "bInfo": false,
- columns: [
- {
- data: "@Html.DisplayNameFor(model => model.Id)",
- orderable: true
- },
- {
- data: "@Html.DisplayNameFor(model => model.Firstname)",
- orderable: true
- },
- {
- data: "@Html.DisplayNameFor(model => model.Lastname)",
- orderable: true
- },
- {
- data: "@Html.DisplayNameFor(model => model.CompanyName)",
- orderable: true
- },
- {
- data: "@Html.DisplayNameFor(model => model.IsBusiness)",
- orderable: true
- },
- {
- data: "@Html.DisplayNameFor(model => model.Address)",
- orderable: true
- },
- {
- data: "@Html.DisplayNameFor(model => model.Town)",
- orderable: true
- },
- {
- data: "@Html.DisplayNameFor(model => model.ZipCode)",
- orderable: true
- },
- {
- data: "@Html.DisplayNameFor(model => model.Country)",
- orderable: true
- },
- {
- data: "Aktionen",
- orderable: false
- }
- ],
- language: {
- zeroRecords: "Keine Einträge gefunden",
- search: "Suchen:",
- info: "Zeige _START_ bis _END_ von _TOTAL_ Einträgen",
- lengthMenu: "Zeige _MENU_ Einträge",
- paginate: {
- first: "Erste",
- last: "Letzte",
- next: "Nächste",
- previous: "Vorige"
- }
- }
- });
- });
- function showDeleteModal(id) {
- if (!id) return;
- $('#deleteModal').modal("show");
- $("[name='id'").val(id);
- }
- </script>
- <h1>Kundenliste</h1>
- <p>
- <a asp-action="Create">Neuen Kunden erstellen</a>
- </p>
- <table id="customersTable" class="table responsive">
- <thead>
- <tr>
- <th data-priority="1">
- @Html.DisplayNameFor(model => model.Id)
- </th>
- <th data-priority="2">
- @Html.DisplayNameFor(model => model.Firstname)
- </th>
- <th data-priority="3">
- @Html.DisplayNameFor(model => model.Lastname)
- </th>
- <th data-priority="4">
- @Html.DisplayNameFor(model => model.CompanyName)
- </th>
- <th>
- @Html.DisplayNameFor(model => model.IsBusiness)
- </th>
- <th>
- @Html.DisplayNameFor(model => model.Address)
- </th>
- <th>
- @Html.DisplayNameFor(model => model.Town)
- </th>
- <th>
- @Html.DisplayNameFor(model => model.ZipCode)
- </th>
- <th>
- @Html.DisplayNameFor(model => model.Country)
- </th>
- <th></th>
- </tr>
- </thead>
- <tbody>
- @foreach (var item in Model) {
- <tr>
- <td>
- @Html.DisplayFor(modelItem => item.Id)
- </td>
- <td>
- @Html.DisplayFor(modelItem => item.Firstname)
- </td>
- <td>
- @Html.DisplayFor(modelItem => item.Lastname)
- </td>
- <td>
- @Html.DisplayFor(modelItem => item.CompanyName)
- </td>
- <td>
- @Html.YesNoBadgeFor(modelItem => item.IsBusiness)
- </td>
- <td>
- @Html.DisplayFor(modelItem => item.Address)
- </td>
- <td>
- @Html.DisplayFor(modelItem => item.Town)
- </td>
- <td>
- @Html.DisplayFor(modelItem => item.ZipCode)
- </td>
- <td>
- @Html.DisplayFor(modelItem => item.Country)
- </td>
- <td>
- @Html.ActionLink("Bearbeiten", "Edit", new { id = item.Id }) |
- @Html.ActionLink("Anzeigen", "Details", new { id = item.Id }) |
- <a href="#" onclick="showDeleteModal(@item.Id)">Löschen</a>
- </td>
- </tr>
- }
- </tbody>
- </table>
- <div id="deleteModal" class="modal fade" tabindex="-1" role="dialog">
- <div class="modal-dialog" role="document">
- <div class="modal-content">
- <div class="modal-header">
- <h5 class="modal-title">Kunde löschen</h5>
- <button type="button" class="close" data-dismiss="modal" aria-label="Close">
- <span aria-hidden="true">×</span>
- </button>
- </div>
- <form asp-action="Delete">
- <div class="modal-body">
- <p>Sind Sie sicher, dass Sie diesen Kunden löschen möchten?</p>
- <input name="id" type="hidden" />
- </div>
- <div class="modal-footer">
- <button type="submit" class="btn btn-primary">Ja</button>
- <button type="button" class="btn btn-secondary" data-dismiss="modal">Nein</button>
- </div>
- </form>
- </div>
- </div>
- </div>
|