Ejemplo n.º 1
0
        public void AdminAdd(AdminForRegisterDto adminregister, string password)
        {
            byte[] passwordHash, passwordSalt, mailHash, mailSalt;
            HashingHelper.CreateMailHash(adminregister.Mail, out mailHash, out mailSalt);
            HashingHelper.CreatePasswordHash(password, out passwordHash, out passwordSalt);
            var admin = new Admin
            {
                Role              = adminregister.AdminRole,
                PasswordHash      = passwordHash,
                PasswordSalt      = passwordSalt,
                AdminUserNameHash = mailHash,
                AdminUserNameSalt = mailSalt,
                UserName          = adminregister.UserName,
                Status            = true,
                Mail              = adminregister.Mail
            };

            _adminDal.Insert(admin);
        }
Ejemplo n.º 2
0
 public bool Insert(Admin model)
 {
     try
     {
         return(adminDal.Insert(model));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Ejemplo n.º 3
0
        public void AddAdmin(AdminDto admin)
        {
            byte[] passwordHash, passwordSalt;
            CreatePasswordHash(admin.Password, out passwordHash, out passwordSalt);
            var ad = new Admin
            {
                AdminUserName = admin.UserName,
                PasswordHash  = passwordHash,
                PasswordSalt  = passwordSalt,
                AdminRole     = admin.AdminRole
            };

            _adminDal.Insert(ad);
        }
Ejemplo n.º 4
0
 public void AdminAdd(Admin admin)
 {
     _adminDal.Insert(admin);
 }
Ejemplo n.º 5
0
 public void AdminAdd(Admin admin)
 {
     admin.AdminUserName = lm.Encrypt(admin.AdminUserName);
     admin.AdminPassword = lm.PasswordHash(admin.AdminPassword);
     _adminDal.Insert(admin);
 }
Ejemplo n.º 6
0
 public void Add(Admin entity)
 {
     _adminDal.Insert(entity);
 }