Beispiel #1
0
        protected virtual async Task <UserLoginData> CreateSuperAdmin(UserAdminInputData input, UserManager <User> userManager)
        {
            User superAdmin = new User()
            {
                Id             = Guid.NewGuid().ToString(),
                FirstName      = "Super",
                LastName       = "Admin",
                OrganizationID = input.OrganizationID,
                Email          = input.Email,
                UserName       = input.Email,
                CreateBy       = "Provider Organization",
                UpdateBy       = "Provider Organization",
                CreateDate     = DateTimeService.ProvideDateTime(),
                UpdateDate     = DateTimeService.ProvideDateTime()
            };

            string password = Guid.NewGuid().ToString();

            await userManager.CreateAsync(superAdmin, password);

            await userManager.AddToRoleAsync(superAdmin, "SuperAdmin");

            UserLoginData userLogin = new UserLoginData()
            {
                Password = password, UserName = input.Email
            };

            return(userLogin);
        }
Beispiel #2
0
 public BaseEFService(ERPContext dbContext, IMapper mapper, IHttpContextAccessor httpContextAccessor, DateTimeService dateTimeService, IEmailSender emailSender)
 {
     DbContext           = dbContext;
     Mapper              = mapper;
     HttpContextAccessor = httpContextAccessor;
     DateTimeService     = dateTimeService;
     EmailSender         = emailSender;
 }
Beispiel #3
0
        public virtual void SetBaseModelFieldOnUpdate(BaseModel instance)
        {
            var userSession = GetUserSession();

            instance.UpdateBy       = userSession.UserFullName;
            instance.UpdateDate     = DateTimeService.ProvideDateTime();
            instance.OrganizationID = userSession.OrganizationID;
        }
Beispiel #4
0
 public BaseEFService(ERPContext dbContext, IMapper mapper, IHttpContextAccessor httpContextAccessor, DateTimeService dateTimeService)
     : this(dbContext, mapper, httpContextAccessor, dateTimeService, null)
 {
 }