public void changePassword() { string newPasswordEncrypt; MD5Sample oMD5 = new MD5Sample(); oMD5._source = _password; newPasswordEncrypt = oMD5.GetMd5Hash(); cMySQLCommands cMySQLChangePassword = new cMySQLCommands(); cMySQLChangePassword._tblName = "usertab"; cMySQLChangePassword._fields = "usertab.usr_pass"; cMySQLChangePassword._values = "'" + newPasswordEncrypt + "'"; cMySQLChangePassword._condition = ("usertab.usr_login = '******'"); cMySQLChangePassword.updateQuery(); }
public bool verifyLogin() { MySqlDataReader reader; MD5Sample oMD5 = new MD5Sample(); oMD5._source = _password; cMySQLCommands cMySQLVerify = new cMySQLCommands(); cMySQLVerify._tblName = "usertab"; cMySQLVerify._fields = ""; cMySQLVerify._condition = "usertab.usr_login = '******' and usertab.usr_pass= '******'"; //oMD5.GetMd5Hash() reader = cMySQLVerify.selectQueryWhere(); if (reader.HasRows) { while (reader.Read()) { _userlogin = reader.GetString(1); _fullname = reader.GetString(2); _location = reader.GetString(6); _department = reader.GetString(7); _passEncrypt = reader.GetString(3); _position = reader.GetString(8); _locationName = getLocation(); _departmentName = getCompany(); } return(true); } else { reader.Dispose(); return(false); } }