Untitled

mail@pastecode.io avatar
unknown
plain_text
2 years ago
3.0 kB
1
Indexable
Never
@model ProductAddDto
<h1>Yeni Ürün Ekleme</h1>
<hr />
<form class=""
      asp-area="Admin"
      asp-controller="Product"
      asp-action="Create"
      method="post"
      enctype="multipart/form-data"
        >@*enctype="multipart/form-data" resim dosylarının eklendiğinde null gelmemesi için*@
    <div class="row">
        <div class="col-8">


            <div class="mb-3">
                <label asp-for="Name" class="form-label"></label>
                <input class="form-control" asp-for="Name">
                <span asp-validation-for="Name" class="text-danger"></span>
            </div>
            <div class="mb-3">
                <label asp-for="Price" class="form-label"></label>
                <input class="form-control" asp-for="Price">
                <span asp-validation-for="Price" class="text-danger"></span>
            </div>
            
            <div class="mb-3">
                <label asp-for="ImageFile" class="form-label"></label>
                <input type="file" asp-for="ImageFile" accept="image/"/>
                <span asp-validation-for="ImageFile" class="text-danger"></span>
            </div>
            <div class="mb-3">
                <label asp-for="Description" class="form-label"></label>
                <input class="form-control" asp-for="Description">
                <span asp-validation-for="Description" class="text-danger"></span>
            </div>

            <button type="submit" class="btn btn-primary">Kaydet</button>
        </div>
        <div class="col-4">
            <div>
                <div>
                    <label asp-for="Categories"></label>
                </div>
                @foreach (var category in Model.Categories)
                {
                    <div>
                        <input 
                           type="checkbox"
                           class="form-check-input"
                           name="selectedCategoryIds"
                           value="@category.Id"
                           />
                        <label>@category.Name</label>
                    </div>
                }
            </div>
            <div class="mb-1">Seçenekler</div>
            <div >
                <input 
                    type="checkbox"
                    class="form-check-input" 
                    asp-for="IsHome">
                <label asp-for="IsHome" class="form-label"></label>
                <span asp-validation-for="IsHome" class="text-danger"></span>
            </div>
            <div class="mb-3">
                <input type="checkbox"
                       class="form-check-input"
                       asp-for="IsApproved">
                <label asp-for="IsApproved" class="form-label"></label>
                <span asp-validation-for="IsApproved" class="text-danger"></span>
            </div>
        </div>
    </div>
</form>