This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Controller | |
public class HumanController : Controller { | |
private readonly HumanContext _context; | |
public HumanController(HumanContext context){ | |
_context = context; | |
} | |
public async Task Index() { | |
return View(await _context.Humans.ToListAsync()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- 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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Example in C# | |
var dictionary = new Dictionary<string, string> | |
{ | |
{"٠", "0"},{"١", "1"},{"٢", "2"},{"٣", "3"}, | |
{"٤", "4"},{"٥", "5"},{"٦", "6"},{"٧", "7"}, | |
{"٨", "8"},{"٩", "9"}, | |
}; | |
string digit = input.Substring(this. txtNumber.Text.Length - 1); | |
char[] NumberChars = "٠١٢٣٤٥٦٧٨٩0123456789".ToCharArray(); |