public async Task<CustomerListDto> GetCustomerById(IdInput input) { var lst = _list.FirstOrDefault(x => x.Id == input.Id); var model = await Task.FromResult(lst); return model; }
public async Task SetNotificationAsRead(IdInput<Guid> input) { var userNotification = await _userNotificationManager.GetUserNotificationAsync(AbpSession.TenantId, input.Id); if (userNotification.UserId != AbpSession.GetUserId()) { throw new ApplicationException(string.Format("Given user notification id ({0}) is not belong to the current user ({1})", input.Id, AbpSession.GetUserId())); } await _userNotificationManager.UpdateUserNotificationStateAsync(AbpSession.TenantId, input.Id, UserNotificationState.Read); }
public async Task DeleteLanguage(IdInput input) { var language = await _languageRepository.GetAsync(input.Id); await _applicationLanguageManager.RemoveAsync(AbpSession.TenantId, language.Name); }
public virtual async Task DeleteAsync(IdInput input) { await _fiscalYearUnitRepository.DeleteAsync(input.Id); }
public async Task DeleteOrganizationUnit(IdInput<long> input) { await _organizationUnitManager.DeleteAsync(input.Id); }
public async Task<PermissionDto> GetById(IdInput input) { var permission= await permissionRepository.GetAsync(input.Id); return permission.MapTo<PermissionDto>(); }
public async Task ResetUserSpecificPermissions(IdInput<long> input) { var user = await UserManager.GetUserByIdAsync(input.Id); await UserManager.ResetAllPermissionsAsync(user); }
public async Task<RoleEditDto> GetRole(IdInput<Guid> input) { var rs = await _repository.FirstOrDefaultAsync(x => x.Id == input.Id); return rs.MapTo<RoleEditDto>(); }
public async Task<ActionEditDto> GetAction(IdInput<Guid> id) { var action = await _repository.FirstOrDefaultAsync(x => x.Id == id.Id); return action.MapTo<ActionEditDto>(); }
public async Task<JsonResult> SetDefaultLanguage(IdInput input) { await _languageAppService.SetDefaultLanguage(input); return Json(new MvcAjaxResponse { Result = "设置成功!" }); }
public async Task<JsonResult> DeleteLanguage(IdInput input) { //todo 实现关闭软删除功能,直接数据库删除掉数据(本身已关闭多租户过滤器,如何同时关闭软删除过滤器?) await _languageAppService.DeleteLanguage(input); return Json(new MvcAjaxResponse { Result = "删除成功!" }); }
public async Task DeleteUser(IdInput<Guid> input) { var usr = await _repository.FirstOrDefaultAsync(x => x.Id == input.Id); if (usr.UserName == "admin") { throw new UserFriendlyException(string.Format(L("CanNotDeleteAdminUser"), "admin")); } await _repository.DeleteAsync(input.Id); }
public async Task DeleteCustomer(IdInput input) { await this.customerRepository.DeleteAsync(input.Id); }
public virtual async Task DeleteAsync(IdInput <long> input) { await _attachedObjectUnitRepository.DeleteAsync(input.Id); }
public async Task <AuditLog> GetDetail(IdInput <long> input) { var auditLog = await auditRepository.GetAsync(input.Id); return(auditLog); }
public async Task DeleteUser(IdInput<long> input) { var user = await UserManager.GetUserByIdAsync(input.Id); CheckErrors(await UserManager.DeleteAsync(user)); }
public async Task<AuditLog> GetDetail(IdInput<long> input) { var auditLog= await auditRepository.GetAsync(input.Id); return auditLog; }
public async Task Delete(IdInput<long> input) { var user = await userManager.GetUserByIdAsync(input.Id); await userManager.DeleteAsync(user); }
public async Task Delete(IdInput<Guid> input) { await _repository.DeleteAsync(input.Id); }
public async Task<dynamic> GetUserPermissions(IdInput<long> input) { var user = await userManager.GetUserByIdAsync(input.Id); var permissions = await userManager.GetGrantedPermissionsAsync(user); var list = new List<dynamic>(); foreach (Permission permission in permissionManager.GetAllPermissions()) { var data = new { permission.Name, DisplayName = permission.DisplayName.Localize(localizationContext), ParentName = permission.Parent == null ? "无" : permission.Parent.Name, IsGrantedByDefault = permissions.Contains(permission) || permission.IsGrantedByDefault }; list.Add(data); } return list; }
public async Task<GetUserPermissionsForEditOutput> GetUserPermissionsForEdit(IdInput<long> input) { var user = await UserManager.GetUserByIdAsync(input.Id); var permissions = PermissionManager.GetAllPermissions(); var grantedPermissions = await UserManager.GetGrantedPermissionsAsync(user); return new GetUserPermissionsForEditOutput { Permissions = permissions.MapTo<List<FlatPermissionDto>>().OrderBy(p => p.DisplayName).ToList(), GrantedPermissionNames = grantedPermissions.Select(p => p.Name).ToList() }; }
public async Task SetDefaultLanguage(IdInput input) { var language = await _languageRepository.GetAsync(input.Id); await _applicationLanguageManager.SetDefaultLanguageAsync( AbpSession.TenantId, GetCultureInfoByChecking(language.Name).Name ); }
public async Task DeleteUser(IdInput<long> input) { if (input.Id == AbpSession.GetUserId()) { throw new UserFriendlyException(L("YouCanNotDeleteOwnAccount")); } var user = await UserManager.GetUserByIdAsync(input.Id); CheckErrors(await UserManager.DeleteAsync(user)); }
public async Task Delete(IdInput input) { var role =await roleManager.GetRoleByIdAsync(input.Id); await roleManager.DeleteAsync(role); }
public async Task Delete(IdInput input) { await permissionRepository.DeleteAsync(input.Id); }
public async Task ClearCache(IdInput<string> input) { var cache = _cacheManager.GetCache(input.Id); await cache.ClearAsync(); }
public override void Delete(IdInput<int> input) { base.Delete(input); }
/// <summary> /// Delete Address by AddressId /// </summary> /// <param name="input"></param> /// <returns></returns> public async Task DeleteAddressUnit(IdInput <long> input) { await _addressUnitRepository.DeleteAsync(p => p.Id == input.Id); }