This commit is contained in:
mmrbnjd
2024-06-08 21:48:26 +03:30
parent 39dbbf03d8
commit eddbc54c4c
7 changed files with 150 additions and 93 deletions

View File

@@ -39,26 +39,38 @@
int id = 0;
foreach (PropertyInfo property in properties)
{
if (property.Name.ToLower()=="id")
id =Convert.ToInt32(property.GetValue(item, null));
if (property.Name.ToLower() == "id")
id = Convert.ToInt32(property.GetValue(item, null));
if (property.CustomAttributes.Any(w => w.AttributeType.Name == "DisplayAttribute"))
{
if (property.PropertyType == typeof(Nullable<System.Decimal>) || property.PropertyType == typeof(System.Decimal))
{
<td>
@decimal.Parse(property.GetValue(item, null).ToString()).ToString("N0") ريال
</td>
</td>
}
else if (property.Name.ToLower() == "id")
{
if (id > 0)
{
<td><button @onclick="()=>OnMultipleOfThree.InvokeAsync(Convert.ToInt32(id))" type="button" class="btn btn-link">@property.GetValue(item, null)</button></td>
}
else
{
<td><button type="button" class="btn btn-link disabled">@property.GetValue(item, null)</button></td>
}
}
else
{
<td>@property.GetValue(item, null)</td>
}
}
}
if (id>0)
if (id > 0)
{
<td><button @onclick="()=>OnMultipleOfThree.InvokeAsync(Convert.ToInt32(id))" type="button" class="btn btn-link">ویرایش</button></td>
}
@@ -66,7 +78,7 @@
{
<td><button type="button" class="btn btn-link disabled">ویرایش</button></td>
}
}
</tr>
}