Front-End: The visual elements of a website, or the component that users can see and interact with, are the emphasis of front-end development.
Back-End: Website structure, system, data, and logic are all parts of the back-end development process.
Together, front-end and back-end development build engaging websites with stunning visuals.
π¨ Back-end development are all about the architecture that goes on behind the scenes.. Often dealing with servers and databases
Front-End Code Sample
Please find below the front-end code sample from one of my project:
<!--Β TableΒ -->
<section>
<h2>OrderΒ List</h2>
<divΒ class="table-wrapper">
<tableΒ id="mainGrid"Β class="alt">Β
<thead>Β Β
<tr>Β
<th>OrderΒ No.</th>Β
<th>OrderΒ Date</th>Β
<th>Customer</th>Β
<th>Status</th>Β Β
<th>Quantity</th>Β Β
<th>DeliveryΒ Fee</th>
<th>SaleΒ Price</th>Β
<th>TotalΒ Price</th>Β
</tr>Β
</thead>Β Β
<tbody>
@foreachΒ (varΒ itemΒ inΒ Model)Β Β {
qtyΒ =Β qtyΒ +Β item.TotalQuantity;Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β
<tr>Β
Β <td>@item.ID</td>
<td>@item.OrderDateTime</td>
<td>@item.Customer</td>Β
Β <td>
<aΒ href="~/Order/EditStatus/@item.ID">Β @item.StatusNameΒ </a>
</td>
<td>@item.TotalQuantity</td>
<td>@item.DeliveryFee</td>Β
<td>@item.SaleAmount</td>
<td>@item.TotalAmount</td>Β
</tr>Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β
}Β
</tbody>
</table>
</section>
Front-End Source Code at GitHub
Back-End Code Sample
Please find below the back-end code sample from one of my project:
[HttpPost("addcart")]
publicΒ IActionResultΒ AddCart(intΒ userId,Β intΒ productId)
{
Β Β Β try
{Β
Β Β Β Β Β Β Β Β varΒ isProductAlreadyAddedΒ =Β userCartEntity
.FindBy(aΒ =>Β a.UserIdΒ ==Β userIdΒ
&&Β a.ProductIdΒ ==Β productIdΒ
&&Β !a.IsDeleted).Any();
Β Β Β Β Β Β Β Β ifΒ (!isProductAlreadyAdded)
{
Β Β Β Β Β Β Β Β Β Β Β Β Β Β varΒ userCartΒ =Β newΒ UserCartEntity
Β Β Β Β Β Β Β Β Β Β Β Β Β Β {
Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β UserIdΒ =Β userId,
Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β TotalQuantityΒ =Β 1,
Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β AddedDateTimeΒ =Β DateTime.Now,
Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β IsDeletedΒ =Β false,
Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β ProductIdΒ =Β productId
Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β };
Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β userCartEntity.Add(userCart);
Β Β Β Β Β Β Β Β Β returnΒ Ok(newΒ StatusΒ {IsSuccessΒ =Β true,
MessageΒ =Β "ItemΒ addedΒ toΒ cartΒ successfully."});
Β Β Β Β Β Β Β Β Β Β Β Β Β }
Β Β Β Β Β Β Β Β Β }
Β Β Β Β Β Β Β Β Β catchΒ (ExceptionΒ ex)
Β Β Β Β Β Β Β Β Β {
Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Debug.WriteLine(ex);
Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β returnΒ Ok(newΒ StatusΒ {Β IsSuccessΒ =Β false,Β
MessageΒ =Β ex.MessageΒ });
Β Β Β Β Β Β Β Β Β Β }
Β Β Β Β Β Β Β Β returnΒ Ok();Β Β Β Β Β Β Β Β
}
Back-End Source Code at GitHub
Hi, Iβm Wajid Khan. I am trying to explain computer stuff in a simple and engaging manner, so that even non-techies can easily understand, and delivered to your inbox weekly.