public bool VerifyPassword(int UserID, string Password) { DataSet ds = new DataSet(); try { ds = SqlHelper.ExecuteDataset(Base_BLL_CommonSettings.ConnectionString, "USP_Admin_GetPassword_ForChange", UserID); //Decrypt Both string PassOrg = "Org"; string PassTyped = "Typ"; if (ds.Tables[0].Rows.Count > 0) { PassOrg = Base_BLL_Cryptography.Decrypt(ds.Tables[0].Rows[0][0].ToString(), true); PassTyped = Base_BLL_Cryptography.Decrypt(Password, true); } if (PassOrg == PassTyped) { return(true); } return(false); } catch (Exception ex) { throw ex; } }
public bool VerifyLogin(string UserID, string Password) { DataSet ds = new DataSet(); try { ds = SqlHelper.ExecuteDataset(Base_BLL_CommonSettings.ConnectionString, "USP_Login_GetPassword", UserID); if (ds != null && ds.Tables[0].Rows.Count > 0) { string PassOrg = "Org"; string PassTyped = "Typ"; string s = ds.Tables[0].Rows[0]["Password"].ToString(); PassOrg = Base_BLL_Cryptography.Decrypt(s, true); PassTyped = Base_BLL_Cryptography.Decrypt(Password, true); if (PassOrg == PassTyped) { this.CurrentUser = ds.Tables[0]; return(true); } } return(false); } catch (Exception ex) { throw ex; } }