...
This commit is contained in:
@@ -9,25 +9,25 @@
|
||||
@inject NavigationManager navigationManager;
|
||||
@inject GroupService groupService;
|
||||
<Button Color="ButtonColor.Success" Style="margin-bottom:10px"
|
||||
@onclick="async()=>{
|
||||
@onclick="async()=>{
|
||||
await modal.ShowAsync<ADDGroupComponent>(title,parameters:parameters);
|
||||
}">
|
||||
گروه جدید
|
||||
</Button>
|
||||
|
||||
<Grid @ref="grid" TItem="Read_GroupDto"
|
||||
AllowSorting="true"
|
||||
Class="table table-hover"
|
||||
DataProvider="DataProvider"
|
||||
HeaderRowCssClass="bg-primary text-white bg-opacity-75 border-bottom-0"
|
||||
Responsive="true"
|
||||
AllowPaging="true"
|
||||
OnRowDoubleClick="OnRowClick"
|
||||
AllowRowClick=true>
|
||||
AllowSorting="true"
|
||||
Class="table table-hover"
|
||||
DataProvider="DataProvider"
|
||||
HeaderRowCssClass="bg-primary text-white bg-opacity-75 border-bottom-0"
|
||||
Responsive="true"
|
||||
AllowPaging="true"
|
||||
OnRowDoubleClick="OnRowClick"
|
||||
AllowRowClick=true>
|
||||
|
||||
<GridColumns>
|
||||
<GridColumn HeaderTextAlignment="Alignment.Center" TextAlignment="Alignment.Center" TItem="Read_GroupDto" HeaderText="تصویر گروه">
|
||||
@if (context.img?.Length!=0)
|
||||
@if (context.img?.Length != 0)
|
||||
{
|
||||
<Image Class="rounded-circle mx-auto d-block" src="@GetImageSource(context.img)" height="25" width="25" alt="Uploaded Image" />
|
||||
}
|
||||
@@ -71,7 +71,7 @@ AllowRowClick=true>
|
||||
public List<Read_GroupDto> list = new();
|
||||
private async Task<GridDataProviderResult<Read_GroupDto>> DataProvider(GridDataProviderRequest<Read_GroupDto> request)
|
||||
{
|
||||
if(list.Count <= 0)
|
||||
if (list.Count <= 0)
|
||||
list = await groupService.GetGroupsCompany();
|
||||
|
||||
int skip = (request.PageNumber - 1) * request.PageSize;
|
||||
@@ -87,14 +87,20 @@ AllowRowClick=true>
|
||||
await base.OnInitializedAsync();
|
||||
}
|
||||
private async Task OnRowClick(GridRowEventArgs<Read_GroupDto> args)
|
||||
{
|
||||
{
|
||||
Dictionary<string, object> eparameters = new Dictionary<string, object>();
|
||||
eparameters.Add("model", args.Item);
|
||||
eparameters.Add("model", new Update_GroupDto()
|
||||
{
|
||||
ID = args.Item.ID,
|
||||
img = args.Item.img,
|
||||
Info = args.Item.Info,
|
||||
Name = args.Item.Name
|
||||
});
|
||||
eparameters.Add("OnMultipleOfThree", EventCallback.Factory.Create(this, CallBack));
|
||||
|
||||
|
||||
await modal.ShowAsync<UpdateGroupComponent>($"ویرایش گروه {args.Item.Name}", parameters: eparameters);
|
||||
|
||||
|
||||
await modal.ShowAsync<UpdateGroupComponent>($"ویرایش گروه {args.Item.Name}", parameters: eparameters);
|
||||
|
||||
|
||||
}
|
||||
private async Task SwitchChanged(Read_GroupDto model, bool value)
|
||||
@@ -123,10 +129,10 @@ AllowRowClick=true>
|
||||
|
||||
|
||||
if (await groupService.DeleteGroupFromManager(GroupID))
|
||||
{
|
||||
list = await groupService.GetGroupsCompany();
|
||||
{
|
||||
list = await groupService.GetGroupsCompany();
|
||||
await grid.RefreshDataAsync();
|
||||
}
|
||||
}
|
||||
}
|
||||
async Task CallBack()
|
||||
{
|
||||
|
@@ -83,6 +83,7 @@ AllowRowClick=true>
|
||||
};
|
||||
Dictionary<string, object> eparameters = new Dictionary<string, object>();
|
||||
eparameters.Add("model", editmodel);
|
||||
eparameters.Add("ExperID", args.Item.ID);
|
||||
eparameters.Add("OnMultipleOfThree", EventCallback.Factory.Create(this, CallBack));
|
||||
|
||||
await modal.ShowAsync<UpdateExperComponent>($"ویرایش کارشناس {args.Item.FullName}", parameters: eparameters);
|
||||
|
Reference in New Issue
Block a user