Skip to content

Commit

Permalink
Merge pull request #9 from abdulrahmannadap/New-Update
Browse files Browse the repository at this point in the history
New update
  • Loading branch information
abdulrahmannadap committed Mar 9, 2024
2 parents bcc4ae0 + 6eef86a commit 9bf79ee
Show file tree
Hide file tree
Showing 6 changed files with 1,236 additions and 1,626 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public IActionResult Upsert(Product product, IFormFile? file)
product.ImageUrl = Path.Combine(@"\images\products\", newFileName);
}

if (product.Id == null || product.Id == 0)
if (product.Id == 0 || product.Id == 0)
{
_unitOfWork.ProductRepo.Add(product);
_unitOfWork.Save();
Expand Down
6 changes: 3 additions & 3 deletions FCommerce.Website/Areas/Admin/Views/Categorys/List.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@


<div class="mb-3">
<a asp-area="Admin" asp-controller="Categorys" asp-action="Upsert" class="btn btn-primary text-uppercase"><i class="bi bi-plus-lg"></i> Add More</a>
<a asp-area="Admin" asp-controller="Categorys" asp-action="Upsert" class="btn btn-outline-primary text-uppercase"><i class="bi bi-plus-lg"></i> Add More</a>
</div>

<Table class="table table-hover table-bordered bg-warning ">
Expand All @@ -39,8 +39,8 @@
@categoryInModel.Name
</td>
<td>
<a class="btn btn-info text-uppercase" asp-controller="Categorys" asp-action="Upsert" asp-route-id="@categoryInModel.Id"><i class="bi bi-pencil-square"></i> Edit</a>
<a class="btn btn-danger text-uppercase" asp-controller="Categorys" asp-action="Delete" asp-route-id="@categoryInModel.Id" onclick="return confirmDelete()" ><i class="bi bi-x-octagon"></i> Delete</a>
<a class="btn btn-outline-warning text-uppercase" asp-controller="Categorys" asp-action="Upsert" asp-route-id="@categoryInModel.Id"><i class="bi bi-pencil-square"></i> Edit</a>
<a class="btn btn-outline-danger text-uppercase" asp-controller="Categorys" asp-action="Delete" asp-route-id="@categoryInModel.Id" onclick="return confirmDelete()"><i class="bi bi-x-octagon"></i> Delete</a>
</td>
</tr>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@


<div class="m-2">
<a asp-area="Admin" asp-action="List" asp-controller="categorys" class="btn btn-primary text-uppercase "><i class="bi bi-list-ol"></i> Go To list</a>
<a asp-area="Admin" asp-action="List" asp-controller="categorys" class="btn btn-outline-primary text-uppercase "><i class="bi bi-list-ol"></i> Go To list</a>
</div>
<form asp-controller="Categorys" asp-action="Upsert" method="post" class="text-center mt-5">

Expand All @@ -17,8 +17,8 @@
</div>
<small class="form-text text-muted">Please choose a unique item name.</small>
<div class="text-center">
<input type="submit" class="btn btn-success mt-3 text-uppercase mx-4 " value=@(Model.Id==0 ? "ADD" : "EDIT") />
<a asp-controller="Categorys" asp-action="List" class="btn btn-warning mt-3 text-uppercase">Cancelled</a>
<input type="submit" class="btn btn-outline-success mt-3 text-uppercase mx-4 " value=@(Model.Id==0 ? "ADD" : "EDIT") />
<a asp-controller="Categorys" asp-action="List" class="btn btn-outline-warning mt-3 text-uppercase">Cancelled</a>

</div>
</form>
Expand Down
6 changes: 3 additions & 3 deletions FCommerce.Website/Areas/Admin/Views/Products/List.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
} *@

<div class ="mb-3">
<a asp-controller="Products" asp-action="Upsert" class="btn btn-primary text-uppercase"><i class="bi bi-plus-lg"></i> Add More</a>
<a asp-controller="Products" asp-action="Upsert" class="btn btn-outline-primary text-uppercase"><i class="bi bi-plus-lg"></i> Add More</a>
</div>

<table class="table table-hover table-bordered bg-warning ">
Expand All @@ -39,8 +39,8 @@
<img src="@product.ImageUrl" alt="No Image Found" height="100" width="100" />
</td>
<td>
<a asp-controller="Products" asp-action="Upsert" class="btn btn-warning text-uppercase" asp-route-id="@product.Id"><i class="bi bi-pencil-square"></i> Edit</a>
<a class="btn btn-danger text-uppercase" asp-controller="Categorys" asp-action="Delete" asp-route-id="@product.Id" onclick="return confirmDelete()"><i class="bi bi-x-octagon"></i> Delete</a>
<a asp-controller="Products" asp-action="Upsert" class="btn btn-outline-warning text-uppercase" asp-route-id="@product.Id"><i class="bi bi-pencil-square"></i> Edit</a>
<a class="btn btn-outline-danger text-uppercase" asp-controller="Categorys" asp-action="Delete" asp-route-id="@product.Id" onclick="return confirmDelete()"><i class="bi bi-x-octagon"></i> Delete</a>
</td>
</tr>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<div class="row">
<div class="col-8">
<div class="m-2">
<a asp-action="List" asp-controller="Products" class="btn btn-primary text-uppercase "><i class="bi bi-list-ol"></i> Go To list</a>
<a asp-action="List" asp-controller="Products" class="btn btn-outline-primary text-uppercase "><i class="bi bi-list-ol"></i> Go To list</a>
</div>
<form asp-area="Admin" asp-controller="Products" asp-action="Upsert" method="post" class="form-group text-center " enctype="multipart/form-data">
<div asp-validation-summary="ModelOnly" class="text-danger"></div>
Expand Down Expand Up @@ -35,7 +35,7 @@
</div>
</div>

<div class="mt-2">
<div class="mt-4">
<select asp-for="CategoryId" asp-items="@ViewBag.CategoryItem" class="form-select">
<option selected disabled> Select Category</option>
</select>
Expand All @@ -45,8 +45,8 @@


<div class="mt-2">
<input type="submit" class="btn btn-success mt-3 text-uppercase mx-4 " value=@(Model.Id==0 ? "ADD" : "EDIT") />
<a asp-controller="Products" asp-action="List" class="btn btn-warning mt-3 text-uppercase">Cancelled</a>
<input type="submit" class="btn btn-outline-success mt-3 text-uppercase mx-4 " value=@(Model.Id==0 ? "ADD" : "EDIT") />
<a asp-controller="Products" asp-action="List" class="btn btn-outline-warning mt-3 text-uppercase">Cancelled</a>
</div>
</form>
</div>
Expand Down
Loading

0 comments on commit 9bf79ee

Please sign in to comment.