private User GetUserInfo(bool isUpdating) { User user; if (isUpdating) { user = _business.Get(SelectedUserID); } else { user = new User(); user.id = IDGenerator.NewId <User>(true); user.user_name = tbUserName.Text.ToLowerInvariant(); user.created_date = DateTime.Now; user.created_by = SystemParam.CurrentUser.id; user.deleted = false; } var password = string.IsNullOrEmpty(tbNewPassword.Text) ? tbCurrentPassword.Text : tbNewPassword.Text; password = PasswordServiceProvider.Encrypt(user.user_name, password); user.password = password; user.role = cboRole.SelectedValue.ToString(); user.staff_id = tbStaffID.Text; user.active_status = chkActive.Checked; return(user); }
public void GetDefaultPassword() { var admin = PasswordServiceProvider.Encrypt("admin", "admin"); var Supervisor = PasswordServiceProvider.Encrypt("Supervisor", "Supervisor"); var Staff = PasswordServiceProvider.Encrypt("Staff", "Staff"); var NhanVien = PasswordServiceProvider.Encrypt("NhanVien", "1"); var ThanhHuong = PasswordServiceProvider.Encrypt("ThanhHuong", "manman12"); }
public void GetPassword() { string key = "nhanvien2"; string pass = "******"; string encrypt = PasswordServiceProvider.Encrypt(key, pass); }