Beispiel #1
0
        public void SetPassword(long userId, string password)
        {
            if (password == null)
            {
                throw new ArgumentNullException("password");
            }

            var salt = _converter.GenerateSalt();
            var hash = _converter.GetPasswordHash(password, salt);

            _executor.Execute("[dbo].[User_SetPassword]", new { userId, salt, hash });
        }
Beispiel #2
0
        public long Add(string name, string login, string password, string email, string language)
        {
            var salt         = _converter.GenerateSalt();
            var passwordHash = _converter.GetPasswordHash(password, salt);

            return(_executor.Query <long>("[dbo].[Forwarder_Add]", new
            {
                login,
                PasswordHash = passwordHash,
                PasswordSalt = salt,
                language,
                name,
                email
            }));
        }
Beispiel #3
0
        public long Add(SenderData data, string password)
        {
            var salt         = _converter.GenerateSalt();
            var passwordHash = _converter.GetPasswordHash(password, salt);

            return(_executor.Query <long>("[dbo].[Sender_Add]", new
            {
                data.Login,
                PasswordHash = passwordHash,
                PasswordSalt = salt,
                TwoLetterISOLanguageName = data.Language,
                data.Name,
                data.Email,
                data.TariffOfTapePerBox,
                data.Contact,
                data.Phone,
                data.Address
            }));
        }
Beispiel #4
0
        public long Add(string name, string email, string phone, string contact, string address,
                        string login, string password, string language)
        {
            var salt         = _converter.GenerateSalt();
            var passwordHash = _converter.GetPasswordHash(password, salt);

            return(_executor.Query <long>("[dbo].[Carrier_Add]", new
            {
                login,
                PasswordHash = passwordHash,
                PasswordSalt = salt,
                language,
                name,
                email,
                phone,
                contact,
                address
            }));
        }