Merge branch 'kub-stage' into production
Build and Deploy to Production / build-and-deploy (push) Successful in 14m33s
Build and Deploy to Production / build-and-deploy (push) Successful in 14m33s
This commit is contained in:
@@ -73,9 +73,9 @@ jobs:
|
|||||||
|
|
||||||
# Apply manifests and restart
|
# Apply manifests and restart
|
||||||
sshpass -e ssh -o StrictHostKeyChecking=no root@${{ env.K8S_SERVER }} "
|
sshpass -e ssh -o StrictHostKeyChecking=no root@${{ env.K8S_SERVER }} "
|
||||||
kubectl apply -f /tmp/backoffice-deployment.yaml &&
|
kubectl apply -n kbs-stage -f /tmp/backoffice-deployment.yaml &&
|
||||||
kubectl rollout restart deployment/backoffice &&
|
kubectl -n kbs-stage rollout restart deployment/backoffice &&
|
||||||
kubectl rollout status deployment/backoffice --timeout=180s &&
|
kubectl -n kbs-stage rollout status deployment/backoffice --timeout=180s &&
|
||||||
rm -f /tmp/backoffice-deployment.yaml
|
rm -f /tmp/backoffice-deployment.yaml
|
||||||
"
|
"
|
||||||
echo "✅ Deployed!"
|
echo "✅ Deployed!"
|
||||||
|
|||||||
+2
-2
@@ -1,10 +1,10 @@
|
|||||||
# ---> VisualStudio
|
# ---> VisualStudio
|
||||||
## Ignore Visual Studio temporary files, build results, and
|
## Ignore Visual Studio temporary files, build results, and
|
||||||
## files generated by popular Visual Studio add-ons.
|
## files generated by popular Visual Studio add-ons.
|
||||||
##
|
##
|
||||||
## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore
|
## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore
|
||||||
|
|
||||||
# User-specific files
|
# User-specific files
|
||||||
*.rsuser
|
*.rsuser
|
||||||
*.suo
|
*.suo
|
||||||
*.user
|
*.user
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ apiVersion: apps/v1
|
|||||||
kind: Deployment
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
name: backoffice
|
name: backoffice
|
||||||
namespace: default
|
namespace: kbs-stage
|
||||||
labels:
|
labels:
|
||||||
app: backoffice
|
app: backoffice
|
||||||
spec:
|
spec:
|
||||||
@@ -20,7 +20,7 @@ spec:
|
|||||||
containers:
|
containers:
|
||||||
- name: backoffice
|
- name: backoffice
|
||||||
image: 185.252.31.44:30080/admin/backoffice:latest
|
image: 185.252.31.44:30080/admin/backoffice:latest
|
||||||
imagePullPolicy: Always
|
imagePullPolicy: IfNotPresent
|
||||||
ports:
|
ports:
|
||||||
- containerPort: 80
|
- containerPort: 80
|
||||||
name: http
|
name: http
|
||||||
@@ -43,7 +43,7 @@ apiVersion: v1
|
|||||||
kind: Service
|
kind: Service
|
||||||
metadata:
|
metadata:
|
||||||
name: backoffice-svc
|
name: backoffice-svc
|
||||||
namespace: default
|
namespace: kbs-stage
|
||||||
spec:
|
spec:
|
||||||
selector:
|
selector:
|
||||||
app: backoffice
|
app: backoffice
|
||||||
@@ -58,7 +58,7 @@ apiVersion: networking.k8s.io/v1
|
|||||||
kind: Ingress
|
kind: Ingress
|
||||||
metadata:
|
metadata:
|
||||||
name: backoffice-ingress
|
name: backoffice-ingress
|
||||||
namespace: default
|
namespace: kbs-stage
|
||||||
annotations:
|
annotations:
|
||||||
cert-manager.io/cluster-issuer: "letsencrypt-prod"
|
cert-manager.io/cluster-issuer: "letsencrypt-prod"
|
||||||
nginx.ingress.kubernetes.io/ssl-redirect: "true"
|
nginx.ingress.kubernetes.io/ssl-redirect: "true"
|
||||||
|
|||||||
@@ -143,7 +143,7 @@
|
|||||||
<ProjectReference Include="../../../CMS/src/CMSMicroservice.Protobuf/CMSMicroservice.Protobuf.csproj" />
|
<ProjectReference Include="../../../CMS/src/CMSMicroservice.Protobuf/CMSMicroservice.Protobuf.csproj" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup Condition="!Exists('../../../CMS/src/CMSMicroservice.Protobuf/CMSMicroservice.Protobuf.csproj')">
|
<ItemGroup Condition="!Exists('../../../CMS/src/CMSMicroservice.Protobuf/CMSMicroservice.Protobuf.csproj')">
|
||||||
<PackageReference Include="Foursat.CMSMicroservice.Protobuf" Version="0.0.209" />
|
<PackageReference Include="Foursat.CMSMicroservice.Protobuf" Version="0.0.214" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<!-- ============================================================ -->
|
<!-- ============================================================ -->
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ public static class RouteConstance
|
|||||||
public const string Package = "/PackagePage/";
|
public const string Package = "/PackagePage/";
|
||||||
public const string Role = "/RolePage/";
|
public const string Role = "/RolePage/";
|
||||||
public const string UserPage = "/UserPage/";
|
public const string UserPage = "/UserPage/";
|
||||||
|
public const string InvitationsReport = "/InvitationsReportPage/";
|
||||||
public const string UserOrder = "/UserOrderPage/";
|
public const string UserOrder = "/UserOrderPage/";
|
||||||
public const string Orders = "/OrdersPage/";
|
public const string Orders = "/OrdersPage/";
|
||||||
public const string OrdersSalesReports = "/OrdersSalesReportsPage/";
|
public const string OrdersSalesReports = "/OrdersSalesReportsPage/";
|
||||||
|
|||||||
@@ -65,6 +65,11 @@
|
|||||||
SortMode="SortMode.Multiple">
|
SortMode="SortMode.Multiple">
|
||||||
<Columns>
|
<Columns>
|
||||||
<PropertyColumn Property="x => x.WeekDisplayName" Title="هفته" />
|
<PropertyColumn Property="x => x.WeekDisplayName" Title="هفته" />
|
||||||
|
<PropertyColumn Property="x => x.PackageTitle" Title="پکیج">
|
||||||
|
<CellTemplate>
|
||||||
|
@(string.IsNullOrEmpty(context.Item.PackageTitle) ? "—" : context.Item.PackageTitle)
|
||||||
|
</CellTemplate>
|
||||||
|
</PropertyColumn>
|
||||||
<PropertyColumn Property="x => x.TotalPoolAmount" Title="مبلغ کل استخر" Format="N0">
|
<PropertyColumn Property="x => x.TotalPoolAmount" Title="مبلغ کل استخر" Format="N0">
|
||||||
<CellTemplate>
|
<CellTemplate>
|
||||||
<MudText>@context.Item.TotalPoolAmount.ToString("N0") تومان</MudText>
|
<MudText>@context.Item.TotalPoolAmount.ToString("N0") تومان</MudText>
|
||||||
@@ -203,6 +208,8 @@
|
|||||||
{
|
{
|
||||||
WeekDefinitionId = x.WeekDefinitionId,
|
WeekDefinitionId = x.WeekDefinitionId,
|
||||||
WeekDisplayName = x.WeekDisplayName,
|
WeekDisplayName = x.WeekDisplayName,
|
||||||
|
PackageId = x.PackageId,
|
||||||
|
PackageTitle = x.PackageTitle,
|
||||||
TotalPoolAmount = x.TotalPoolAmount,
|
TotalPoolAmount = x.TotalPoolAmount,
|
||||||
TotalBalances = x.TotalBalances,
|
TotalBalances = x.TotalBalances,
|
||||||
ValuePerBalance = x.ValuePerBalance,
|
ValuePerBalance = x.ValuePerBalance,
|
||||||
@@ -249,6 +256,8 @@
|
|||||||
{
|
{
|
||||||
public long WeekDefinitionId { get; set; }
|
public long WeekDefinitionId { get; set; }
|
||||||
public string WeekDisplayName { get; set; } = "";
|
public string WeekDisplayName { get; set; } = "";
|
||||||
|
public long PackageId { get; set; }
|
||||||
|
public string PackageTitle { get; set; } = "";
|
||||||
public long TotalPoolAmount { get; set; }
|
public long TotalPoolAmount { get; set; }
|
||||||
public int TotalBalances { get; set; }
|
public int TotalBalances { get; set; }
|
||||||
public long ValuePerBalance { get; set; }
|
public long ValuePerBalance { get; set; }
|
||||||
|
|||||||
@@ -18,12 +18,13 @@ public partial class WeeklyReports
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
var sb = new StringBuilder();
|
var sb = new StringBuilder();
|
||||||
sb.AppendLine("هفته,مبلغ کل استخر,مجموع موجودیها,ارزش هر موجودی,وضعیت,تاریخ محاسبه");
|
sb.AppendLine("هفته,پکیج,مبلغ کل استخر,مجموع موجودیها,ارزش هر موجودی,وضعیت,تاریخ محاسبه");
|
||||||
|
|
||||||
foreach (var r in _reports)
|
foreach (var r in _reports)
|
||||||
{
|
{
|
||||||
sb.AppendLine(string.Join(",",
|
sb.AppendLine(string.Join(",",
|
||||||
EscapeCsv(r.WeekDisplayName),
|
EscapeCsv(r.WeekDisplayName),
|
||||||
|
EscapeCsv(r.PackageTitle),
|
||||||
r.TotalPoolAmount,
|
r.TotalPoolAmount,
|
||||||
r.TotalBalances,
|
r.TotalBalances,
|
||||||
r.ValuePerBalance,
|
r.ValuePerBalance,
|
||||||
|
|||||||
@@ -96,6 +96,16 @@
|
|||||||
</ToolBarContent>
|
</ToolBarContent>
|
||||||
<Columns>
|
<Columns>
|
||||||
<PropertyColumn Property="x => x.Id" Title="شناسه" />
|
<PropertyColumn Property="x => x.Id" Title="شناسه" />
|
||||||
|
<TemplateColumn Title="کاربر">
|
||||||
|
<CellTemplate>
|
||||||
|
@(context.Item.UserId != null ? context.Item.UserId.ToString() : "—")
|
||||||
|
</CellTemplate>
|
||||||
|
</TemplateColumn>
|
||||||
|
<TemplateColumn Title="نام کاربر">
|
||||||
|
<CellTemplate>
|
||||||
|
@(string.IsNullOrWhiteSpace(context.Item.UserFullName) ? "—" : context.Item.UserFullName)
|
||||||
|
</CellTemplate>
|
||||||
|
</TemplateColumn>
|
||||||
<TemplateColumn Title="نوع">
|
<TemplateColumn Title="نوع">
|
||||||
<CellTemplate>
|
<CellTemplate>
|
||||||
<MudChip T="string" Size="Size.Small" Variant="Variant.Text">
|
<MudChip T="string" Size="Size.Small" Variant="Variant.Text">
|
||||||
@@ -232,13 +242,13 @@
|
|||||||
Filter = BuildFilter()
|
Filter = BuildFilter()
|
||||||
});
|
});
|
||||||
var sb = new System.Text.StringBuilder();
|
var sb = new System.Text.StringBuilder();
|
||||||
sb.AppendLine("Id,Type,Amount,Description,Status,RefId,PaymentDate,Created");
|
sb.AppendLine("Id,UserId,UserFullName,Type,Amount,Description,Status,RefId,PaymentDate,Created");
|
||||||
foreach (var r in result.Models)
|
foreach (var r in result.Models)
|
||||||
{
|
{
|
||||||
var type = r.HasType ? ReportLabels.GetTransactionTypeLabel(r.Type) : "";
|
var type = r.HasType ? ReportLabels.GetTransactionTypeLabel(r.Type) : "";
|
||||||
var status = r.HasPaymentStatus ? ReportLabels.GetTransactionPaymentStatusLabel(r.PaymentStatus) : "";
|
var status = r.HasPaymentStatus ? ReportLabels.GetTransactionPaymentStatusLabel(r.PaymentStatus) : "";
|
||||||
var paymentDate = r.PaymentDate != null ? r.PaymentDate.ToDateTime().ToString("yyyy-MM-dd HH:mm") : "";
|
var paymentDate = r.PaymentDate != null ? r.PaymentDate.ToDateTime().ToString("yyyy-MM-dd HH:mm") : "";
|
||||||
sb.AppendLine($"{r.Id},{type},{r.Amount},\"{r.Description}\",{status},{r.RefId},{paymentDate},{r.Created.ToDateTime():yyyy-MM-dd HH:mm}");
|
sb.AppendLine($"{r.Id},{r.UserId},\"{r.UserFullName}\",{type},{r.Amount},\"{r.Description}\",{status},{r.RefId},{paymentDate},{r.Created.ToDateTime():yyyy-MM-dd HH:mm}");
|
||||||
}
|
}
|
||||||
await jsRuntime.InvokeVoidAsync("jsSaveAsFile", "ledger-transactions.csv", sb.ToString());
|
await jsRuntime.InvokeVoidAsync("jsSaveAsFile", "ledger-transactions.csv", sb.ToString());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -82,6 +82,11 @@
|
|||||||
<Columns>
|
<Columns>
|
||||||
<PropertyColumn Property="x => x.Id" Title="شناسه" />
|
<PropertyColumn Property="x => x.Id" Title="شناسه" />
|
||||||
<PropertyColumn Property="x => x.UserId" Title="کاربر" />
|
<PropertyColumn Property="x => x.UserId" Title="کاربر" />
|
||||||
|
<TemplateColumn Title="نام کاربر">
|
||||||
|
<CellTemplate>
|
||||||
|
@(string.IsNullOrWhiteSpace(context.Item.UserFullName) ? "—" : context.Item.UserFullName)
|
||||||
|
</CellTemplate>
|
||||||
|
</TemplateColumn>
|
||||||
<PropertyColumn Property="x => x.Mobile" Title="موبایل" />
|
<PropertyColumn Property="x => x.Mobile" Title="موبایل" />
|
||||||
<PropertyColumn Property="x => x.GatewayProvider" Title="درگاه" />
|
<PropertyColumn Property="x => x.GatewayProvider" Title="درگاه" />
|
||||||
<TemplateColumn Title="مبلغ (تومان)">
|
<TemplateColumn Title="مبلغ (تومان)">
|
||||||
@@ -193,9 +198,9 @@
|
|||||||
Filter = BuildFilter()
|
Filter = BuildFilter()
|
||||||
});
|
});
|
||||||
var sb = new System.Text.StringBuilder();
|
var sb = new System.Text.StringBuilder();
|
||||||
sb.AppendLine("Id,UserId,Mobile,Gateway,Amount,Authority,RefId,Status,OrderId,Created");
|
sb.AppendLine("Id,UserId,UserFullName,Mobile,Gateway,Amount,Authority,RefId,Status,OrderId,Created");
|
||||||
foreach (var r in result.Models)
|
foreach (var r in result.Models)
|
||||||
sb.AppendLine($"{r.Id},{r.UserId},{r.Mobile},{r.GatewayProvider},{r.Amount},{r.Authority},{r.RefId},{r.PaymentStatus},{r.OrderId},{r.CreatedAt.ToDateTime():yyyy-MM-dd HH:mm}");
|
sb.AppendLine($"{r.Id},{r.UserId},\"{r.UserFullName}\",{r.Mobile},{r.GatewayProvider},{r.Amount},{r.Authority},{r.RefId},{r.PaymentStatus},{r.OrderId},{r.CreatedAt.ToDateTime():yyyy-MM-dd HH:mm}");
|
||||||
await jsRuntime.InvokeVoidAsync("jsSaveAsFile", "payment-transactions.csv", sb.ToString());
|
await jsRuntime.InvokeVoidAsync("jsSaveAsFile", "payment-transactions.csv", sb.ToString());
|
||||||
}
|
}
|
||||||
catch (Exception ex) { Snackbar.Add($"خطا در export: {ex.Message}", Severity.Error); }
|
catch (Exception ex) { Snackbar.Add($"خطا در export: {ex.Message}", Severity.Error); }
|
||||||
|
|||||||
@@ -0,0 +1,85 @@
|
|||||||
|
@attribute [Route(RouteConstance.InvitationsReport)]
|
||||||
|
@using CMSMicroservice.Protobuf.Protos.User
|
||||||
|
@using BackOffice.Common.BaseComponents
|
||||||
|
@using DataModel = CMSMicroservice.Protobuf.Protos.User.InvitationReportModel
|
||||||
|
|
||||||
|
<BackOffice.Common.BaseComponents.BasePageComponent @ref="_basePage" OnClearFilterClick="OnFilterCleared" OnSubmitClick="OnFilterSubmit">
|
||||||
|
<Filters>
|
||||||
|
<MudItem xs="12" sm="6" md="3">
|
||||||
|
<MudTextField T="string" Clearable="true" Label="موبایل دعوتکننده" @bind-Value="@_request.Filter.InviterMobile" Variant="Variant.Outlined" Margin="Margin.Dense" />
|
||||||
|
</MudItem>
|
||||||
|
<MudItem xs="12" sm="6" md="3">
|
||||||
|
<MudTextField T="string" Clearable="true" Label="نام دعوتکننده" @bind-Value="@_request.Filter.InviterFirstName" Variant="Variant.Outlined" Margin="Margin.Dense" />
|
||||||
|
</MudItem>
|
||||||
|
<MudItem xs="12" sm="6" md="3">
|
||||||
|
<MudTextField T="string" Clearable="true" Label="نامخانوادگی دعوتکننده" @bind-Value="@_request.Filter.InviterLastName" Variant="Variant.Outlined" Margin="Margin.Dense" />
|
||||||
|
</MudItem>
|
||||||
|
<MudItem xs="12" sm="6" md="3">
|
||||||
|
<MudTextField T="string" Clearable="true" Label="موبایل دعوتشونده" @bind-Value="@_request.Filter.InviteeMobile" Variant="Variant.Outlined" Margin="Margin.Dense" />
|
||||||
|
</MudItem>
|
||||||
|
<MudItem xs="12" sm="6" md="3">
|
||||||
|
<MudTextField T="string" Clearable="true" Label="نام دعوتشونده" @bind-Value="@_request.Filter.InviteeFirstName" Variant="Variant.Outlined" Margin="Margin.Dense" />
|
||||||
|
</MudItem>
|
||||||
|
<MudItem xs="12" sm="6" md="3">
|
||||||
|
<MudTextField T="string" Clearable="true" Label="نامخانوادگی دعوتشونده" @bind-Value="@_request.Filter.InviteeLastName" Variant="Variant.Outlined" Margin="Margin.Dense" />
|
||||||
|
</MudItem>
|
||||||
|
<MudItem xs="12" sm="6" md="3">
|
||||||
|
<MudSelect T="string" Label="وضعیت باشگاه دعوتشونده" @bind-Value="_clubActiveFilter" Clearable="true" Variant="Variant.Outlined" Margin="Margin.Dense">
|
||||||
|
<MudSelectItem Value="@("")">همه</MudSelectItem>
|
||||||
|
<MudSelectItem Value="@("true")">فعال</MudSelectItem>
|
||||||
|
<MudSelectItem Value="@("false")">غیرفعال</MudSelectItem>
|
||||||
|
</MudSelect>
|
||||||
|
</MudItem>
|
||||||
|
</Filters>
|
||||||
|
<Content>
|
||||||
|
<MudDataGrid T="DataModel" ServerData="@(new Func<GridState<DataModel>, Task<GridData<DataModel>>>(ServerReload))"
|
||||||
|
Hover="true" @ref="_gridData" Height="calc(100vh - 240px)">
|
||||||
|
<ToolBarContent>
|
||||||
|
<MudText>گزارش دعوتها (جدیدترین اول)</MudText>
|
||||||
|
</ToolBarContent>
|
||||||
|
<Columns>
|
||||||
|
<PropertyColumn Property="x => x.Id" Title="شناسه" />
|
||||||
|
<TemplateColumn Title="دعوتکننده">
|
||||||
|
<CellTemplate>
|
||||||
|
<MudText Typo="Typo.body2">@($"{context.Item.InviterFirstName} {context.Item.InviterLastName}".Trim())</MudText>
|
||||||
|
<MudText Typo="Typo.caption" Class="mud-text-secondary">@context.Item.InviterMobile</MudText>
|
||||||
|
</CellTemplate>
|
||||||
|
</TemplateColumn>
|
||||||
|
<TemplateColumn Title="دعوتشونده">
|
||||||
|
<CellTemplate>
|
||||||
|
<MudText Typo="Typo.body2">@($"{context.Item.InviteeFirstName} {context.Item.InviteeLastName}".Trim())</MudText>
|
||||||
|
<MudText Typo="Typo.caption" Class="mud-text-secondary">@context.Item.InviteeMobile</MudText>
|
||||||
|
</CellTemplate>
|
||||||
|
</TemplateColumn>
|
||||||
|
<TemplateColumn Title="ثبتنام دعوتشونده">
|
||||||
|
<CellTemplate>
|
||||||
|
@(context.Item.InviteeRegisteredAt?.ToDateTime().ToLocalTime().ToString("yyyy/MM/dd HH:mm") ?? "—")
|
||||||
|
</CellTemplate>
|
||||||
|
</TemplateColumn>
|
||||||
|
<TemplateColumn Title="باشگاه">
|
||||||
|
<CellTemplate>
|
||||||
|
@if (context.Item.InviteeClubActive)
|
||||||
|
{
|
||||||
|
<MudChip T="string" Size="Size.Small" Color="Color.Success">فعال</MudChip>
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
<MudChip T="string" Size="Size.Small" Color="Color.Default">غیرفعال</MudChip>
|
||||||
|
}
|
||||||
|
</CellTemplate>
|
||||||
|
</TemplateColumn>
|
||||||
|
<TemplateColumn Title="تاریخ دعوت">
|
||||||
|
<CellTemplate>
|
||||||
|
@(context.Item.InvitedAt?.ToDateTime().ToLocalTime().ToString("yyyy/MM/dd HH:mm") ?? "—")
|
||||||
|
</CellTemplate>
|
||||||
|
</TemplateColumn>
|
||||||
|
</Columns>
|
||||||
|
<PagerContent>
|
||||||
|
<MudDataGridPager T="DataModel" />
|
||||||
|
</PagerContent>
|
||||||
|
<NoRecordsContent>
|
||||||
|
<MudText>موردی یافت نشد</MudText>
|
||||||
|
</NoRecordsContent>
|
||||||
|
</MudDataGrid>
|
||||||
|
</Content>
|
||||||
|
</BackOffice.Common.BaseComponents.BasePageComponent>
|
||||||
@@ -0,0 +1,74 @@
|
|||||||
|
using CMSMicroservice.Protobuf.Protos.User;
|
||||||
|
using BackOffice.Common.BaseComponents;
|
||||||
|
using Microsoft.AspNetCore.Components;
|
||||||
|
using MudBlazor;
|
||||||
|
using DataModel = CMSMicroservice.Protobuf.Protos.User.InvitationReportModel;
|
||||||
|
|
||||||
|
namespace BackOffice.Pages.User;
|
||||||
|
|
||||||
|
public partial class InvitationsReportPage
|
||||||
|
{
|
||||||
|
[Inject] public UserContract.UserContractClient UserContract { get; set; } = default!;
|
||||||
|
|
||||||
|
private MudDataGrid<DataModel> _gridData = default!;
|
||||||
|
private BasePageComponent _basePage = default!;
|
||||||
|
private GetInvitationsByFilterRequest _request = new() { Filter = new() };
|
||||||
|
private string _clubActiveFilter = string.Empty;
|
||||||
|
|
||||||
|
private async Task<GridData<DataModel>> ServerReload(GridState<DataModel> state)
|
||||||
|
{
|
||||||
|
_request.Filter ??= new();
|
||||||
|
ApplyClubFilter();
|
||||||
|
_request.PaginationState ??= new();
|
||||||
|
_request.PaginationState.PageNumber = state.Page + 1;
|
||||||
|
_request.PaginationState.PageSize = state.PageSize;
|
||||||
|
_request.SortBy = "newest";
|
||||||
|
|
||||||
|
var result = await UserContract.GetInvitationsByFilterAsync(_request);
|
||||||
|
if (result?.Models != null && result.Models.Any())
|
||||||
|
{
|
||||||
|
return new GridData<DataModel>
|
||||||
|
{
|
||||||
|
Items = result.Models.ToList(),
|
||||||
|
TotalItems = (int)result.MetaData.TotalCount
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
return new GridData<DataModel>();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ApplyClubFilter()
|
||||||
|
{
|
||||||
|
_request.Filter ??= new();
|
||||||
|
if (_clubActiveFilter == "true")
|
||||||
|
_request.Filter.InviteeClubActive = true;
|
||||||
|
else if (_clubActiveFilter == "false")
|
||||||
|
_request.Filter.InviteeClubActive = false;
|
||||||
|
else
|
||||||
|
_request.Filter.InviteeClubActive = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ReLoadData()
|
||||||
|
{
|
||||||
|
_ = _gridData.ReloadServerData();
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task OnFilterSubmit()
|
||||||
|
{
|
||||||
|
ApplyClubFilter();
|
||||||
|
_basePage.IsFiltered = true;
|
||||||
|
StateHasChanged();
|
||||||
|
ReLoadData();
|
||||||
|
await Task.CompletedTask;
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task OnFilterCleared()
|
||||||
|
{
|
||||||
|
_basePage.IsFiltered = false;
|
||||||
|
_clubActiveFilter = string.Empty;
|
||||||
|
_request = new() { Filter = new() };
|
||||||
|
StateHasChanged();
|
||||||
|
ReLoadData();
|
||||||
|
await Task.CompletedTask;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -185,6 +185,11 @@
|
|||||||
Icon="@Icons.Material.Filled.People">
|
Icon="@Icons.Material.Filled.People">
|
||||||
کاربران
|
کاربران
|
||||||
</MudNavLink>
|
</MudNavLink>
|
||||||
|
<MudNavLink Match="NavLinkMatch.Prefix"
|
||||||
|
Href="@(RouteConstance.InvitationsReport)"
|
||||||
|
Icon="@Icons.Material.Filled.GroupAdd">
|
||||||
|
گزارش دعوتها
|
||||||
|
</MudNavLink>
|
||||||
}
|
}
|
||||||
|
|
||||||
@if (CanManageRoles)
|
@if (CanManageRoles)
|
||||||
|
|||||||
Reference in New Issue
Block a user