public SetUserDetailsVar(string username, string password) { _Username = username; _Password = PasswordSecurity.EncryptMD5(password); OleDbDataReader dataReader = CreateCommand().ExecuteReader(); GetIdAndAdmin(dataReader); }
private OleDbCommand GetCommand() { OleDbCommand oleDbCommand = oleDbConnection.CreateCommand(); oleDbCommand.CommandText = GetCommandText(); oleDbCommand.Parameters.AddWithValue("Username", ADMIN); oleDbCommand.Parameters.AddWithValue("[Password]", PasswordSecurity.EncryptMD5(ADMIN)); oleDbCommand.Parameters.AddWithValue("Admin", "-1"); return(oleDbCommand); }
private OleDbCommand CreateCommand(SeeTeam seeTeam) { OleDbCommand oleDbCommand = oleDbConnection.CreateCommand(); oleDbCommand.CommandText = GetCommandText(); oleDbCommand.Parameters.AddWithValue("@Username", seeTeam.TxtBoxUsername.Text); oleDbCommand.Parameters.AddWithValue("@Password", PasswordSecurity.EncryptMD5(seeTeam.TxtBoxPassword.Text)); oleDbCommand.Parameters.AddWithValue("@Admin", seeTeam.checkBox1.Checked); oleDbCommand.Parameters.AddWithValue("@WorkerID", seeTeam.dataGridView1.SelectedRows[0].Cells[0].Value.ToString()); return(oleDbCommand); }
private OleDbCommand CreateCommand(UserDetails userDetails) { OleDbCommand oleDbCommand = oleDbConnection.CreateCommand(); oleDbCommand.CommandText = GetCommandText(); oleDbCommand.Parameters.AddWithValue("@Password", PasswordSecurity.EncryptMD5(userDetails.TxtboxPassword.Text)); oleDbCommand.Parameters.AddWithValue("@Username", userDetails.TxtboxUsername.Text); oleDbCommand.Parameters.AddWithValue("@Admin", userDetails.checkBox1.Checked); oleDbCommand.Parameters.AddWithValue("@WorkerID", UserDetailsVAR.Id); return(oleDbCommand); }
private string GetHashedPassword() { return(PasswordSecurity.EncryptMD5(manageWorker.txtBoxPassword.Text)); //return manageWorker.txtBoxPassword.Text; }
public static bool LoginDetailsIsCorrect(string username, string password) { _Username = username; _Password = PasswordSecurity.EncryptMD5(password); return(CreateDataReader().HasRows); }