/// <summary> /// 添加实体属性 /// </summary> private async void ShowAdd() { IsAdd = true; await SetBusyAsync(async() => { await WebRequest.Execute(() => propertyAppService.GetAll(), async result => { Items.Clear(); foreach (var item in result.Items) { Items.Add(item); } //移除下拉的可选项 foreach (var item in dataPager.GridModelList) { var dynamicEntity = item as DynamicEntityPropertyDto; if (dynamicEntity != null) { var t = Items.FirstOrDefault(t => t.Id.Equals(dynamicEntity.DynamicPropertyId)); if (t != null) { Items.Remove(t); } } } await Task.CompletedTask; }); }); }
/// <summary> /// 添加成员 /// </summary> /// <param name="organizationUnit"></param> /// <returns></returns> private async Task AddMember(OrganizationListModel organizationUnit) { if (organizationUnit == null) { return; } long Id = organizationUnit.Id; await WebRequest.Execute(() => appService.FindUsers(new FindOrganizationUnitUsersInput() { OrganizationUnitId = Id }), async result => { DialogParameters param = new DialogParameters(); param.Add("Id", Id); param.Add("Value", result); var dialogResult = await dialog.ShowDialogAsync(AppViewManager.AddUsers, param); if (dialogResult.Result == ButtonResult.OK) { await GetOrganizationUnitUsers(usersInput); } }); }
protected override async void Save() { await SetBusyAsync(async() => { if (IsNewOrganization) { await WebRequest.Execute(() => appService.CreateOrganizationUnit( new CreateOrganizationUnitInput() { DisplayName = input.DisplayName, ParentId = ParentId })); } else { await WebRequest.Execute(() => appService.UpdateOrganizationUnit( new UpdateOrganizationUnitInput() { Id = input.Id, DisplayName = input.DisplayName })); } }); base.Save(); }
/// <summary> /// 修改租户功能 /// </summary> /// <param name="Id"></param> private async void TenantChangeFeatures() { GetTenantFeaturesEditOutput output = null; await SetBusyAsync(async() => { await WebRequest.Execute(() => appService.GetTenantFeaturesForEdit(new EntityDto(SelectedItem.Id)), async result => { output = result; await Task.CompletedTask; }); }); if (output == null) { return; } DialogParameters param = new DialogParameters(); param.Add("Id", SelectedItem.Id); param.Add("Value", output); await dialog.ShowDialogAsync(AppViewManager.TenantChangeFeatures, param); }
/// <summary> /// 解锁租户 /// </summary> private async void Unlock() { await SetBusyAsync(async() => { await WebRequest.Execute(() => appService.UnlockTenantAdmin( new EntityDto(SelectedItem.Id)), RefreshAsync); }); }
/// <summary> /// 获取最近一个月的统计数据 (新租户、新订阅金额、样例1、样例2) /// </summary> /// <returns></returns> private async Task GetTopStatsData() { await WebRequest.Execute(() => appService.GetTopStatsData(new GetTopStatsInput() { StartDate = startDate, EndDate = endDate }), result => GetTopStatsDataSuccessed(result)); }
private async void UsersUnlock() { await SetBusyAsync(async () => { await WebRequest.Execute(() => appService.UnlockUser( new EntityDto<long>(SelectedItem.Id))); }); }
/// <summary> /// 获取审计日期数据 /// </summary> /// <returns></returns> private async Task GetAuditLogs(GetAuditLogsFilter input) { await WebRequest.Execute(() => appService.GetAuditLogs(Map <GetAuditLogsInput>(input)), async result => { dataPager.SetList(result); await Task.CompletedTask; }); }
/// <summary> /// 获取更改日志 /// </summary> /// <returns></returns> private async Task GetEntityChanges(GetEntityChangeFilter input) { await WebRequest.Execute(() => appService.GetEntityChanges(Map <GetEntityChangeInput>(input)), async result => { logsdataPager.SetList(result); await Task.CompletedTask; }); }
private async Task GetLanguageTexts(GetLanguageTextsInput filter) { await WebRequest.Execute(() => appService.GetLanguageTexts(filter), async result => { dataPager.SetList(result); await Task.CompletedTask; }); }
/// <summary> /// 获取版本信息 /// </summary> /// <returns></returns> private async Task GetEditionTenantStatistics() { await WebRequest.Execute(() => appService.GetEditionTenantStatistics(new GetEditionTenantStatisticsInput() { StartDate = startDate, EndDate = endDate }), result => GetEditionTenantStatisticsSuccessed(result)); }
/// <summary> /// 获取收入统计信息 /// </summary> /// <param name="startDate"></param> /// <param name="endDate"></param> /// <param name="interval"></param> private async Task GetIncomeStatistics(ChartDateInterval interval) { await WebRequest.Execute(() => appService.GetIncomeStatistics(new GetIncomeStatisticsDataInput() { IncomeStatisticsDateInterval = interval, StartDate = startDate, EndDate = endDate }), result => GetIncomeStatisticsSuccessed(result)); }
/// <summary> /// 获取租户列表 /// </summary> /// <returns></returns> private async Task GetTenants() { var input = Map <GetTenantsInput>(filter); await WebRequest.Execute(() => appService.GetTenants(input), async result => { dataPager.SetList(result); await Task.CompletedTask; }); }
/// <summary> /// 删除组织机构 /// </summary> /// <param name="organization"></param> public async void DeleteOrganizationUnit(OrganizationListModel organization) { if (await dialog.Question(Local.Localize("OrganizationUnitDeleteWarningMessage", organization.DisplayName))) { await WebRequest.Execute(() => appService.DeleteOrganizationUnit(new EntityDto <long>() { Id = organization.Id }), RefreshAsync); } }
/// <summary> /// 获取筛选权限列表 /// </summary> /// <returns></returns> private async Task GetAllPermission() { if (flatPermission != null) return; await WebRequest.Execute(() => permissionAppService.GetAllPermissions(), result => { flatPermission = result; return Task.CompletedTask; }); }
/// <summary> /// 设置默认语言 /// </summary> private async void SetAsDefaultLanguage() { await SetBusyAsync(async() => { await WebRequest.Execute(() => appService.SetDefaultLanguage(new Localization.Dto.SetDefaultLanguageInput() { Name = SelectedItem.Name })); }); }
private async Task FindRoles(FindOrganizationUnitRolesInput input) { await WebRequest.Execute(() => appService.FindRoles(input), async result => { dataPager.SetList(new PagedResultDto <ChooseItem>() { Items = result.Items.Select(t => new ChooseItem(t)).ToList() }); await Task.CompletedTask; }); }
/// <summary> /// 获取动态实体属性 /// </summary> /// <returns></returns> private async Task GetAllEntitiesHasDynamicProperty() { await WebRequest.Execute(() => entityPropertyAppService.GetAllEntitiesHasDynamicProperty(), async result => { entitydataPager.SetList(new PagedResultDto <GetAllEntitiesHasDynamicPropertyOutput>() { Items = result.Items }); await Task.CompletedTask; }); }
/// <summary> /// 获取动态属性 /// </summary> /// <returns></returns> private async Task GetDynamicPropertyAll() { await WebRequest.Execute(() => appService.GetAll(), async result => { dataPager.SetList(new PagedResultDto <DynamicPropertyDto>() { Items = result.Items }); await Task.CompletedTask; }); }
/// <summary> /// 获取角色列表 /// </summary> /// <param name="filter"></param> /// <returns></returns> private async Task GetRoles(GetRolesInput filter) { await WebRequest.Execute(() => appService.GetRoles(filter), async result => { dataPager.SetList(new PagedResultDto <RoleListDto> { Items = result.Items }); await Task.CompletedTask; }); }
/// <summary> /// 删除语言 /// </summary> private async void Delete() { if (await dialog.Question(Local.Localize("LanguageDeleteWarningMessage", SelectedItem.DisplayName))) { await SetBusyAsync(async() => { await WebRequest.Execute(() => appService.DeleteLanguage( new EntityDto(SelectedItem.Id)), RefreshAsync); }); } }
/// <summary> /// 获取语言列表 /// </summary> /// <returns></returns> private async Task GetLanguages() { await WebRequest.Execute(() => appService.GetLanguages(), async result => { dataPager.SetList(new PagedResultDto <ApplicationLanguageListDto>() { Items = result.Items }); await Task.CompletedTask; }); }
public async void Delete() { if (await dialog.Question(Local.Localize("UserDeleteWarningMessage", SelectedItem.UserName))) { await SetBusyAsync(async () => { await WebRequest.Execute(() => appService.DeleteUser( new EntityDto<long>(SelectedItem.Id)), RefreshAsync); }); } }
/// <summary> /// 删除值 /// </summary> /// <param name="obj"></param> private async void Delete(DynamicPropertyValueDto obj) { if (await dialog.Question(Local.Localize("DeleteDynamicPropertyValueMessage"), AppCommonConsts.DialogIdentifier)) { await SetBusyAsync(async() => { await WebRequest.Execute(() => appService.Delete(obj.Id), GetAllValuesOfDynamicProperty); }); } }
/// <summary> /// 删除租户 /// </summary> private async void Delete() { var result = await dialog.Question(Local.Localize("TenantDeleteWarningMessage", SelectedItem.TenancyName)); if (result) { await SetBusyAsync(async() => { await WebRequest.Execute(() => appService.DeleteTenant( new EntityDto(SelectedItem.Id)), RefreshAsync); }); } }
/// <summary> /// 获取可选角色列表 /// </summary> /// <returns></returns> private async Task GetAllRoles() { if (RoleList.Count > 0) return; await WebRequest.Execute(() => roleAppService.GetRoles(new GetRolesInput()), result => { foreach (var item in Map<List<RoleListModel>>(result.Items)) RoleList.Add(item); return Task.CompletedTask; }); }
private async Task GetAllEntities() { await WebRequest.Execute(() => appService.GetAllEntities(), async result => { foreach (var item in result) { Models.Add(item); } await Task.CompletedTask; }); }
public override async void OnDialogOpened(IDialogParameters parameters) { await SetBusyAsync(async() => { int?id = null; if (parameters.ContainsKey("Value")) { id = parameters.GetValue <ApplicationLanguageListDto>("Value").Id; } await WebRequest.Execute(() => appService.GetLanguageForEdit(new NullableIdDto(id)), GetLanguageForEditSuccessed); }); }
/// <summary> /// 保存 /// </summary> protected override async void Save() { await SetBusyAsync(async() => { await WebRequest.Execute(async() => { await appService.CreateOrUpdateRole(new CreateOrUpdateRoleInput() { Role = Map <RoleEditDto>(Role), GrantedPermissionNames = treesService.GetSelectedItems() }); }); base.Save(); }); }
protected override async void Save() { await SetBusyAsync(async() => { await WebRequest.Execute(() => tenantAppService.UpdateTenantFeatures(new UpdateTenantFeaturesInput() { Id = Id, FeatureValues = featuresService.GetSelectedItems() }), async() => { base.Save(); await Task.CompletedTask; }); }); }