...
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
@using Hushian.Application.Dtos
|
||||
|
||||
@using Common.Dtos.Group
|
||||
@using HushianWebApp.Service
|
||||
@inject GroupService groupService;
|
||||
|
||||
@@ -7,14 +8,14 @@
|
||||
<div class="row">
|
||||
<div class="col-md-12 col-sm-12" style="margin-bottom:15px">
|
||||
<AutoComplete @bind-Value="GroupName"
|
||||
TItem="GroupDto"
|
||||
TItem="Read_GroupDto"
|
||||
DataProvider="DataProvider"
|
||||
PropertyName="Name"
|
||||
Placeholder="جستجو در گروه ها..."
|
||||
OnChanged="(GroupDto group) => OnAutoCompleteChanged(group)" />
|
||||
OnChanged="(Read_GroupDto group) => OnAutoCompleteChanged(group)" />
|
||||
</div>
|
||||
</div>
|
||||
<SortableList TItem="GroupDto"
|
||||
<SortableList TItem="Read_GroupDto"
|
||||
Data="Groups"
|
||||
Context="item"
|
||||
AllowSorting="false">
|
||||
@@ -35,10 +36,10 @@
|
||||
private string? GroupName;
|
||||
private bool Spinnervisible = false;
|
||||
|
||||
[Parameter] public string ExperID { get; set; }
|
||||
public List<GroupDto> Groups { get; set; }
|
||||
[Parameter] public int ExperID { get; set; }
|
||||
public List<Read_GroupDto> Groups { get; set; }
|
||||
= new();
|
||||
public List<GroupDto> CoGroups { get; set; }
|
||||
public List<Read_GroupDto> CoGroups { get; set; }
|
||||
= new();
|
||||
protected override async Task OnParametersSetAsync()
|
||||
{
|
||||
@@ -49,13 +50,13 @@
|
||||
}
|
||||
}
|
||||
@functions {
|
||||
private async Task<AutoCompleteDataProviderResult<GroupDto>> DataProvider(AutoCompleteDataProviderRequest<GroupDto> request)
|
||||
private async Task<AutoCompleteDataProviderResult<Read_GroupDto>> DataProvider(AutoCompleteDataProviderRequest<Read_GroupDto> request)
|
||||
{
|
||||
CoGroups = await groupService.GetGroupsCompany();
|
||||
return await Task.FromResult(new AutoCompleteDataProviderResult<GroupDto> { Data = CoGroups.Where(w=>w.Name.Contains(request.Filter.Value)), TotalCount = CoGroups.Count() });
|
||||
return await Task.FromResult(new AutoCompleteDataProviderResult<Read_GroupDto> { Data = CoGroups.Where(w => w.Name.Contains(request.Filter.Value)), TotalCount = CoGroups.Count() });
|
||||
}
|
||||
|
||||
private async Task OnAutoCompleteChanged(GroupDto group)
|
||||
private async Task OnAutoCompleteChanged(Read_GroupDto group)
|
||||
{
|
||||
Spinnervisible = true;
|
||||
if (group != null
|
||||
@@ -64,7 +65,7 @@
|
||||
Groups.Add(group);
|
||||
Spinnervisible = false;
|
||||
}
|
||||
async Task UnJoin(GroupDto group)
|
||||
async Task UnJoin(Read_GroupDto group)
|
||||
{
|
||||
Spinnervisible = true;
|
||||
if (group != null && await groupService.UnJoinExperToGroup(group.ID, ExperID))
|
||||
|
Reference in New Issue
Block a user