Exemplo n.º 1
0
        public static void NewUserAddEmailGen(SendEmailCommandRequest request, Email email, DvtDatabaseContext dbContext, IApiInfrastructure apiInfrastructure)
        {
            var user  = dbContext.UserAccount.Include(g => g.Token).Single(f => f.UserAccountId == request.TransferObject.UserAccountId);
            var model = new NewUserAddModel
            {
                Name    = user.FirstName,
                Email   = user.Email,
                HostUrl = apiInfrastructure.ApiConfiguration.GetAppSetting("HostUrl"),
                Token   = user.Token.Single(g => g.ExpiryDate > apiInfrastructure.Clock.NowAsSouthAfrican && g.TokenTypeId == (int)TokenType.SetPassword).Value.ToString()
            };

            var emailBody = CompileEmailTemplate.Compile(model, "NewUserAdd.cshtml");

            email.Body    = emailBody;
            email.Subject = "User Invitation";
            email.To      = user.Email;
        }
Exemplo n.º 2
0
        public static void UserAddedToStokvelEmailGen(SendEmailCommandRequest request, Object email, DvtDatabaseContext dbContext, IApiInfrastructure apiInfrastructure)
        {
            //var user = dbContext.Users.Include(g => g.UserTokens).Single(f => f.Id == request.TransferObject.UserId);
            //var model = new StokvelWelcomeModel
            //{
            //    Name = user.FirstName
            //};

            //var emailBody = CompileEmailTemplate.Compile(model, "StokvelWelcome.cshtml");
            //email.Body = emailBody;
            //email.Subject = "eStokvel Invitation";
            //email.To = user.Email;
        }
Exemplo n.º 3
0
        public static void ForgotPasswordNotificationEmailGen(SendEmailCommandRequest request, Email newEmail, DvtDatabaseContext dbContext, IApiInfrastructure apiInfrastructure)
        {
            var token = dbContext.Token.Include(o => o.Id).Single(o => o.Id == request.TransferObject.TokenId);

            var model = new ForgotPasswordModel
            {
                Name    = token.User.FirstName,
                HostUrl = apiInfrastructure.ApiConfiguration.GetAppSetting("HostUrl"),
                Token   = token.Value.ToString()
            };
            var emailBody = CompileEmailTemplate.Compile(model, "ForgotPassword.cshtml");

            newEmail.Body    = emailBody;
            newEmail.Subject = "Password Reset";
            newEmail.To      = token.User.Email;
        }
Exemplo n.º 4
0
 public GetAllSystemFunctionGroupsRequestHandler(DvtDatabaseContext dbContext)
 {
     _dbContext = dbContext;
 }
Exemplo n.º 5
0
 public SysProfileFunctionLinkCommandRequestHandler(DvtDatabaseContext dbContext, IClock clock)
 {
     _dbContext = dbContext;
     _clock     = clock;
 }
Exemplo n.º 6
0
 public DisableUserCommandRequestHandler(DvtDatabaseContext dbContex)
 {
     _dbContext = dbContex;
 }
Exemplo n.º 7
0
 private readonly IMediator _mediator; // used to avoid JobHandler constructor from exploision. Used to send messeages.
 public JobHandler(DvtDatabaseContext dbContext, IMediator mediator)
 {
     _dbContext = dbContext;
     _mediator  = mediator;
 }
Exemplo n.º 8
0
 public UserLoginQueryRequestHandler(DvtDatabaseContext dbContext)
 {
     _dbContext = dbContext;
 }
Exemplo n.º 9
0
 public GetUserByIdRequestHandler(DvtDatabaseContext dbContext)
 {
     _dbContext = dbContext;
 }
Exemplo n.º 10
0
 public SendEmailCommandRequestHandler(DvtDatabaseContext dbContext, IApiInfrastructure apiInfrastructure) : base(apiInfrastructure, dbContext)
 {
     _dbContext         = dbContext;
     _apiInfrastructure = apiInfrastructure;
 }
Exemplo n.º 11
0
 public GetAllCoursesRequestHandler(DvtDatabaseContext dbContext)
 {
     _dbContext = dbContext;
 }
Exemplo n.º 12
0
 protected RequestHandlerBase(IApiInfrastructure apiInfrastructure, DvtDatabaseContext context) : base(apiInfrastructure)
 {
     Database = context;
 }
Exemplo n.º 13
0
 public FnGroupAddCommandRequestHandler(DvtDatabaseContext dbContext, IClock clock)
 {
     _dbContext = dbContext;
     _clock     = clock;
 }
Exemplo n.º 14
0
 public SysFunctionAddCommandRequestHandler(DvtDatabaseContext dbContext, IClock clock)
 {
     _dbContext = dbContext;
     _clock     = clock;
 }
Exemplo n.º 15
0
 public AddPasswordCommandRequestHandler(DvtDatabaseContext dbContext)
 {
     _dbContext = dbContext;
 }
Exemplo n.º 16
0
 public UserUpdateCommandRequestHandler(DvtDatabaseContext dbContex)
 {
     _dbContext = dbContex;
 }