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); }
public ShowUserSecurityFromDataGrid(SeeTeam seeTeam) { OleDbDataReader oleDbDataReader = GetCommand(seeTeam).ExecuteReader(); while (oleDbDataReader.Read()) { seeTeam.TxtBoxUsername.Text = oleDbDataReader["UserName"].ToString().Trim(); seeTeam.TxtBoxPassword.Text = PasswordSecurity.DecryptMD5(oleDbDataReader["Password"].ToString().Trim()); seeTeam.checkBox1.Checked = bool.Parse(oleDbDataReader["Admin"].ToString()); } }
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); }
public ShowUserSecurity(UserDetails userControl) { OleDbDataReader oleDbDataReader = GetCommand().ExecuteReader(); while (oleDbDataReader.Read()) { userControl.TxtboxUsername.Text = oleDbDataReader["UserName"].ToString().Trim(); userControl.TxtboxPassword.Text = PasswordSecurity.DecryptMD5(oleDbDataReader["Password"].ToString().Trim()); userControl.checkBox1.Checked = bool.Parse(oleDbDataReader["Admin"].ToString()); } if (!userControl.checkBox1.Checked) { userControl.checkBox1.Visible = false; userControl.label6.Visible = false; } }
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); }