private void DoChangePwd() { try { List <USER_USER> lstUser = new List <USER_USER>(); USER_USER usrObj = new USER_USER(); DbOperations.FindBy <USER_USER>(ref lstUser, usrObj, x => x.GUID == KsfSI.UserGuid); lstUser[0].PASSWORD = KasifHelper.GetSha512HashedData(txtNewPwd.Value); lstUser[0].LAST_PWD_CHANGE_DATE = KasifHelper.GetCurrentDate(); DbOperations.Update(lstUser[0]); } catch (Exception ex) { throw ex; } }
private bool CheckOldPasswordCorrectness(string oldPwd) { try { List <USER_USER> lstUser = new List <USER_USER>(); string[] prmNames = new string[] { "P_EMAIL", "P_PASSWORD" }; object[] prmValues = new object[] { KsfSI.Email, KasifHelper.GetSha512HashedData(oldPwd) }; DbOperations.RunDbQuery <USER_USER>(ref lstUser, DbQueryName.GET_USER_BY_EMAIL, prmNames, prmValues); if (lstUser == null || lstUser.Count == 0) { return(false); } else { return(true); } } catch (Exception ex) { throw ex; } }
public OLogin(string userId, string pwd) { this.userId = userId; this.hashedPwd = KasifHelper.GetSha512HashedData(pwd); }