Esempio n. 1
0
 public CategoryViewModel(string editedCategorySignature)
 {
     this.editedCategorySignature = editedCategorySignature;
     this.Name = UserDataAccessor.GetCategoryWithSignature(editedCategorySignature).Title;
 }
 public static void EditDefaultConfigFile(UserDataAccessor dal, Preferences preferences) => Process.Start(dal.GetConfigEditorPath(), $"{preferences.DBDefaultConfFilePath} {preferences.ConfigEditorAdditionalParameters}");
 public static void RunConfigEditor(UserDataAccessor dal, Preferences preferences) => Process.Start(dal.GetConfigEditorPath(), preferences.ConfigEditorAdditionalParameters);
        public Task <IdentityResult> UpdateAsync(User user, CancellationToken cancellationToken)
        {
            UserDataAccessor.UpdateUser(user.Id, user);

            return(Task.FromResult(IdentityResult.Success));
        }
Esempio n. 5
0
        public static async Task <SMA_Lookup_User> GetUserByUsername(string userName)
        {
            var user = await UserDataAccessor.GetUserByUsername(userName);

            return(user);
        }
 public Task <User> FindByNameAsync(string normalizedUserName, CancellationToken cancellationToken)
 {
     return(Task.FromResult(UserDataAccessor.GetByUsername(normalizedUserName)));
 }
 public Task <User> FindByIdAsync(string userId, CancellationToken cancellationToken)
 {
     return(Task.FromResult(UserDataAccessor.Get(Convert.ToInt32(userId))));
 }
 public LightUserStore(PrizeDrawDatabaseContext databaseContext)
 {
     UserDataAccessor = new UserDataAccessor(databaseContext);
     RoleDataAccessor = new RoleDataAccessor(databaseContext);
 }
        public Task <IList <User> > GetUsersInRoleAsync(string roleName, CancellationToken cancellationToken)
        {
            Role role = RoleDataAccessor.GetByName(roleName);

            return(Task.FromResult(UserDataAccessor.GetUsersInRole(role.Id)));
        }
        public Task AddToRoleAsync(User user, string roleName, CancellationToken cancellationToken)
        {
            UserDataAccessor.AddUserToRole(user.Id, roleName);

            return(Task.FromResult(default(Task)));
        }