Okay, so I am guessing in the AppNotifier I would just query the users table in the notification method and then check if each user is subscribed to this notification and then send them the email?
I was looking at that, which did seem like a great way to do it. I just ended up doing it a little differently. In the Login method instead of throwing an exception I just returned a MVCAjaxResponse with Success = false. That way I was able to return an error pretty easily and then catch it in the Ajax call back and display the error message that way.
I added a couple methods to the AppNotifier class. I want to be able to send emails when a user gets a notification, that they received a specific notification. Would you have any good ideas how I can do this for the ones where people are only registered to receive the notification?
I use it in the AccountController in the Login method. I am creating a user lockout functionality on 3 failed login attempts.
I actually think I figured something out reading the ASPNET Boilerplate documentation on Unit of Work. I didn't realize that if an exception is thrown that it rolls back the database transaction.
In the Login method when a user failed to provide the correct password I returned a UserFriendlyException with the message of how many login attempts they have left. I haven't tested this theory yet but I am guessing if I change how I am returning the error message it will work. I just need to figure out a better way to return the error.
I am first going to try the [UnitOfWork] attribute but the way the documentation sounded I am not going to be able to do that in the UserStore. I just liked how easy it was to return an error message to the popup error modal using a UserFriendlyException.
Does anyone have any thoughts on this? I am completely stuck. I also tried using the UpdateAsync method that is in the AbpUserStore. That also didn't work. It just doesn't ever update the database. Here is an example that isn't working in the UserStore.
/// <summary>
/// Increment failed access count
/// </summary>
/// <param name="user"></param>
/// <returns></returns>
public Task<int> IncrementAccessFailedCountAsync(User user)
{
user.AccessFailedCount++;
//Example of an update not working.
UpdateAsync(user);
//Also tried this
//_userRepository.UpdateAsync(user);
return Task.FromResult(user.AccessFailedCount);
}
I extended the User entity by adding the following properties...
public virtual bool LockoutEnabled { get; set; }
public virtual int AccessFailedCount { get; set; }
public virtual DateTime? LockoutEndDateUtc { get; set; }
I then went to extend the UserStore by implementing the IUserLockStore<User, long> interface. This works all fine. But when I try to update the user by using the User repository in the UserStore like this _userRepository.UpdateAsync(user) it doesn't actually update the user in the database.
When I debug I can see it go through without any errors being thrown, but it just doesn't update the user. Would you have any ideas why this could be happening?
Unfortunately, that did not work either.
Sure, I was trying to do something like below
<td width="12.5%" ng-if="tar.day1 != null" class="yes-record">
<span class="label label-info" popover-title="Time Given: {{tar.time}}" uib-popover-html="Given By: {{tar.day1}}" popover-placement="top" popover-trigger="mouseenter click">Entries Exist</span>
</td>
From what I was reading in the documentation at <a class="postlink" href="https://angular-ui.github.io/bootstrap/">https://angular-ui.github.io/bootstrap/</a> it seems like I am doing it correctly. But I must be missing something.
I saw you use the uib-popover directive from <a class="postlink" href="https://angular-ui.github.io/bootstrap/">https://angular-ui.github.io/bootstrap/</a> and got that working just fine. But I want to use HTMl in the popup. Bootstrap does have a uib-popover-html directive but it doesn't work with asp.net Zero. Are you using a customized version of angular UI bootstrap that doesn't include the uib-popover-html?
I should have read further down. All I needed to do was add the size parameter. For example like below...
var modalInstance = $uibModal.open({
templateUrl: '~/App/tenant/views/client/businessModal.cshtml',
controller: 'tenant.views.client.businessModal as vm',
backdrop: 'static',
size: 'lg',
resolve: {
mrn: function () {
return clientId;
}
}