divan/GanjooRazor/Pages/_GroupedByDateViewTablePartial.cshtml
Hamid Reza Mohammadi c803cef0bc #478 refactoring
2025-03-29 15:35:55 +03:30

40 lines
1.4 KiB
Plaintext

@model GanjooRazor.Pages._GroupedByDateViewTablePartialModel
@using DNTPersianUtils.Core
@using System.Globalization
@{
}
@if (Model.Days == null || Model.Days.Length == 0) return;
<table class="stats" id="grouped-by-date">
<thead>
<tr class="h">
<td class="c1">ردیف</td>
<td class="c2">تاریخ</td>
<td class="c3">تعداد</td>
</tr>
</thead>
<tbody>
@for (int i = 0; i < Model.Days.Length; i++)
{
@if (i % 2 == 0)
{
<tr class="e">
<td class="c1">@((i+1).ToPersianNumbers())</td>
<td class="c2">@RMuseum.Services.Implementation.LanguageUtils.FormatInShortDate(DateTime.Parse(Model.Days[i].Date))</td>
<td class="c3">@RMuseum.Services.Implementation.LanguageUtils.FormatMoney(Model.Days[i].Number)</td>
</tr>
}
else
{
<tr>
<td class="c1">@((i + 1).ToPersianNumbers())</td>
<td class="c2">@RMuseum.Services.Implementation.LanguageUtils.FormatInShortDate(DateTime.Parse(Model.Days[i].Date))</td>
<td class="c3">@RMuseum.Services.Implementation.LanguageUtils.FormatMoney(Model.Days[i].Number)</td>
</tr>
}
}
</tbody>
</table>