Update category dialog binding and order details display

This commit is contained in:
masoodafar-web
2025-11-28 05:10:27 +03:30
parent 1bce6f3198
commit 8b4cefc672
4 changed files with 9 additions and 3 deletions

View File

@@ -1,3 +1,4 @@
using System.Text.Json;
using BackOffice.BFF.Category.Protobuf.Protos.Category;
using BackOffice.Common.BaseComponents;
using BackOffice.Common.Utilities;
@@ -155,7 +156,7 @@ public partial class CategoryMainPage
var getResponse = await CategoryContract.GetCategoryAsync(new GetCategoryRequest { Id = model.Id });
var editModel = getResponse.Adapt<UpdateCategoryRequest>();
// Console.WriteLine(JsonSerializer.Serialize(editModel));
var dialog = await DialogService.ShowAsync<CreateOrUpdateCategoryDialog>(
"ویرایش دسته‌بندی",
new DialogParameters<CreateOrUpdateCategoryDialog>
@@ -236,4 +237,4 @@ public partial class CategoryMainPage
{
Navigation.NavigateTo($"{RouteConstance.CategoryProducts}{model.Id}");
}
}
}

View File

@@ -36,7 +36,7 @@
Variant="Variant.Outlined"
Margin="Margin.Dense" />
<MudCheckBox T="bool" @bind-Checked="IsActive" Label="فعال" />
<MudCheckBox T="bool" @bind-Value="IsActive" Label="فعال" />
</MudStack>
</DialogContent>
<DialogActions>

View File

@@ -30,6 +30,7 @@ public partial class CreateOrUpdateCategoryDialog
Description = EditModel.Description;
ParentId = EditModel.ParentId;
IsActive = EditModel.IsActive;
Console.WriteLine(EditModel.IsActive);
SortOrder = EditModel.SortOrder;
}
else if (Model != null)

View File

@@ -101,12 +101,16 @@
{
<MudTable Items="_model.FactorDetails" Dense="true">
<HeaderContent>
<MudTh>تصویر</MudTh>
<MudTh>محصول</MudTh>
<MudTh>قیمت واحد</MudTh>
<MudTh>تعداد</MudTh>
<MudTh>تخفیف واحد</MudTh>
</HeaderContent>
<RowTemplate>
<MudTd>
<Image Src="@context.ProductThumbnailPath" Height="50" Width="50" />
</MudTd>
<MudTd>@context.ProductTitle</MudTd>
<MudTd>@context.UnitPrice?.ToString("N0")</MudTd>
<MudTd>@context.Count</MudTd>