Example #1
0
 public bool ChangePassword(ChangePassword data)
 {
     if (dataProvider.ChangePassword(data.OldPassword, data.NewPassword))
     {
         dataProvider = new MsSqlDataProvider(CreateConnectionString(User.Login, data.NewPassword));
         return true;
     }
     return false;
 }
Example #2
0
        public bool Authenticate(Credentials credentials)
        {
            string connectionString = CreateConnectionString(credentials.Username, credentials.Password);

            var provider = new MsSqlDataProvider(connectionString);

            if (provider.TestConnection())
            {
                dataProvider = provider;
                User = provider.GetItem(new UserDataFilter { Login = credentials.Username });
                return true;
            }

            return false;
        }