コード例 #1
0
        public SetUserDetailsVar(string username, string password)
        {
            _Username = username;
            _Password = PasswordSecurity.EncryptMD5(password);

            OleDbDataReader dataReader = CreateCommand().ExecuteReader();

            GetIdAndAdmin(dataReader);
        }
コード例 #2
0
        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);
        }
コード例 #3
0
        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);
        }
コード例 #4
0
        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);
        }
コード例 #5
0
 private string GetHashedPassword()
 {
     return(PasswordSecurity.EncryptMD5(manageWorker.txtBoxPassword.Text));
     //return manageWorker.txtBoxPassword.Text;
 }
コード例 #6
0
 public static bool LoginDetailsIsCorrect(string username, string password)
 {
     _Username = username;
     _Password = PasswordSecurity.EncryptMD5(password);
     return(CreateDataReader().HasRows);
 }