Hi @ismcagdas Thanks You di solution work fine. I'have add _abpsession.using in BackgroundJob how in example. Best Regards
Tanks i found the switchToAccount function, that resolve my problem.
Best Regards Dennis Bellancini
Tank you very mutch.
Tankyou i have revolded add my custom check here https://github.com/aspnetzero/aspnet-zero-core/blob/51233d56669623ad85186cb80371489ed15ea5c1/angular/src/app/shared/common/auth/auth-route-guard.ts#L94
I have resolted it by add this line of code for every form input element
(click)="$event.stopPropagation();"
I used this code but when I place the cursor on the textbox the menu closes.
<div class="btn-group dropdown" dropdown container="body">
<button class="btn btn-primary btn-lg dropdown-toggle" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" dropdownToggle>
<i class="flaticon-email"></i> Invia Notifica
</button>
<div class="dropdown-menu dropdown-menu-lg dropdown-menu-lg-right" *dropdownMenu>
<form class="form-horizontal" #sendClaimNotification="ngForm">
<div *ngIf="!isAdmin" class="form-group">
<label for="notificationMessage">Destinatario</label>
<select name="userId" id="userId" [(ngModel)]="claimNotification.toUserId" class="form-control" required>
<option value="undefined">Seleziona un utente a cui inviare la notifica</option>
<option *ngFor="let user of users" [value]="user.id">{{user.name}} + ' ' + {{user.surname}}</option>
</select>
</div>
<div class="form-group">
<label for="notificationMessage">Messaggio</label>
<textarea name="notificationMessage" id="notificationMessage" rows="8" [(ngModel)]="claimNotification.message" class="form-control"></textarea>
</div>
<button [disabled]="!sendClaimNotification.form.valid" type="button" class="btn btn-primary" (click)="sendNotification()"><i class="flaticon2-send-1"></i> Invia</button>
</form>
</div>
</div>
Hello, I solved, there was a bug generated by asynchronous methods, I solved using AsyncHelper.RunSync for these methods. The bug could also involve ABP.ModulZero ImportUsersToExcelJob Current
[UnitOfWork]
public override void Execute(ImportUsersFromExcelJobArgs args)
{
using (CurrentUnitOfWork.SetTenantId(args.TenantId))
{
var users = GetUserListFromExcelOrNull(args);
if (users == null || !users.Any())
{
SendInvalidExcelNotification(args);
return;
}
CreateUsers(args, users);
}
}
private void SendInvalidExcelNotification(ImportUsersFromExcelJobArgs args)
{
_appNotifier.SendMessageAsync(
args.User,
_localizationSource.GetString("FileCantBeConvertedToUserList"),
Abp.Notifications.NotificationSeverity.Warn);
}
Rewrite
[UnitOfWork]
public override void Execute(ImportUsersFromExcelJobArgs args)
{
using (CurrentUnitOfWork.SetTenantId(args.TenantId))
{
var users = GetUserListFromExcelOrNull(args);
if (users == null || !users.Any())
{
AsyncHelper.RunSync(() =>SendInvalidExcelNotification(args));
return;
}
CreateUsers(args, users);
}
}
private async Task SendInvalidExcelNotification(ImportUsersFromExcelJobArgs args)
{
await _appNotifier.SendMessageAsync(
args.User,
_localizationSource.GetString("FileCantBeConvertedToUserList"),
Abp.Notifications.NotificationSeverity.Warn);
}