Beispiel #1
0
 /// <summary>
 /// Adoptions Controller Constructor
 /// </summary>
 /// <param name="context">AdotAquiDbContext</param>
 /// <param name="userManager">UserManager</param>
 /// <param name="notificatonService">NotificationService</param>
 /// <param name="emailSender">EmailSender</param>
 public AdoptionsController(AdotAquiDbContext context, UserManager <User> userManager, INotificationService notificatonService, IEmailSender emailSender)
 {
     _context             = context;
     _userManager         = userManager;
     _notificationService = notificatonService;
     _emailSender         = emailSender;
 }
        /// <summary>
        /// Used to register a new notification, can send email
        /// </summary>
        /// <param name="context">AdotAquiDbContext</param>
        /// <param name="notification">Notification Details</param>
        /// <param name="emailService">Email Details (optional)</param>
        public void Register(AdotAquiDbContext context, UserNotification notification, IEmailSender emailService = null)
        {
            context.UserNotification.Add(notification);
            context.SaveChanges();

            if (emailService != null)
            {
                var user = context.Users.Find(notification.UserId);
                emailService.SendEmailAsync(user.Email, "Nova Notificação", "Olá, <p>Gostariamos de informar que tem uma nova notificação!</p><p>Visite <a href='http://eswapp.azurewebsites.net/'>Adotaqui</a> para mais detalhes</p>");
            }
        }
Beispiel #3
0
 public ManageController(
     AdotAquiDbContext context,
     UserManager <User> userManager,
     SignInManager <User> signInManager,
     IEmailSender emailSender,
     ISmsSender smsSender,
     ILoggerFactory loggerFactory)
 {
     _context       = context;
     _userManager   = userManager;
     _signInManager = signInManager;
     _emailSender   = emailSender;
     _smsSender     = smsSender;
     _logger        = loggerFactory.CreateLogger <ManageController>();
 }
Beispiel #4
0
 public AccountController(
     AdotAquiDbContext context,
     UserManager <User> userManager,
     SignInManager <User> signInManager,
     IEmailSender emailSender,
     ISmsSender smsSender,
     ILoggerFactory loggerFactory,
     IStringLocalizer <SharedResources> sharedLocalizer,
     IHttpContextAccessor httpContextAccessor)
 {
     _context             = context;
     _userManager         = userManager;
     _signInManager       = signInManager;
     _emailSender         = emailSender;
     _smsSender           = smsSender;
     _logger              = loggerFactory.CreateLogger <AccountController>();
     _localizer           = sharedLocalizer;
     _httpContextAccessor = httpContextAccessor;
 }
Beispiel #5
0
 /// <summary>
 /// AnimalComments Constructor
 /// </summary>
 /// <param name="context">AdotAquiDbContext</param>
 public AnimalCommentsController(AdotAquiDbContext context)
 {
     _context = context;
 }
Beispiel #6
0
 /// <summary>
 /// Users Constructor
 /// </summary>
 /// <param name="context">AdotAquiDbContext</param>
 public UsersController(AdotAquiDbContext context)
 {
     _context = context;
 }
Beispiel #7
0
 public HomeController(AdotAquiDbContext context, IHttpContextAccessor httpContextAccessor)
 {
     _context             = context;
     _httpContextAccessor = httpContextAccessor;
 }
Beispiel #8
0
 internal void InitializeDatabaseWithDataTest()
 {
     _context = new AdotAquiDbContext(_options);
 }
 /// <summary>
 /// UserNotifications Constructor
 /// </summary>
 /// <param name="context"></param>
 /// <param name="userManager"></param>
 public UserNotificationsController(AdotAquiDbContext context, UserManager <User> userManager)
 {
     _context     = context;
     _userManager = userManager;
 }
Beispiel #10
0
 /// <summary>
 /// Log Constructor
 /// </summary>
 /// <param name="context">AdotAquiDbContext</param>
 public LogsController(AdotAquiDbContext context)
 {
     _context = context;
 }