@model IEnumerable<SMS_MVCDTO.Models.DTOs.ProductDTOs.ProductResponseModel>

@{
    ViewData["Title"] = "Search result";
}

<partial name="_Notification" />

<h1>Manage Product</h1>


<div class="container1">
    <div class="box box0">
        <form>
        </form>
    </div>
    <div class="box box2">
        <form asp-controller="Product" asp-action="GetByName">
            <input type="text" placeholder="Search by Name.." name="name">
            <button type="submit">Search</button>
        </form>
    </div>

    <div class="box box3">
        <form asp-controller="Product" asp-action="GetById">
            <input type="search" placeholder="Search by barcode.." aria-label="Search" name="barcode">
            <button type="submit">Search</button>
        </form>
    </div>


</div>



<div class="container">

    <div class="box box1"> side bar </div>
</div>


<p>
    <button class="btn btn-outline-info"> <a asp-action="Create">Add Product</a></button> || <button class="btn btn-outline-warning"> <a asp-controller="ProductCategory" asp-action="Create">Add New Category</a></button>
</p>

<table class="table table-info col-md-4">
    <thead>
        <tr>
            <th>
                @Html.DisplayNameFor(model => model.Data.Barcode)
            </th>

            <th>
                @Html.DisplayNameFor(model => model.Data.Name)
            </th>

            <th>
                @Html.DisplayNameFor(model => model.Data.Quantity)
            </th>

            <th>
                @Html.DisplayNameFor(model => model.Data.SellingPrice)
            </th>

            <th></th>
        </tr>
    </thead>
    <tbody>

        @foreach (var item in Model)
        {
            <tr>
                <td>
                    @Html.DisplayFor(modelItem => item.Data.Barcode)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.Data.Name)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.Data.Quantity)
                </td>

                <td>
                    @Html.DisplayFor(modelItem => item.Data.SellingPrice)
                </td>

                <td>
                    <a asp-action="Details" asp-route-Barcode="@item.Data.Barcode">Details</a> ||
                    <a asp-controller="Transaction" asp-action="Create" asp-route-Barcode="@item.Data.Barcode">Buy</a>
                </td>
            </tr>
        }
    </tbody>
</table>


