private void SignInUser(string UserId, string Password) { BankUser user = bll.GetBankUser(UserId); if (user.StatusCode == "0") { string md5HashOfPassword = bll.GenerateMD5Hash(Password); if (user.Password == md5HashOfPassword) { AssignSessionVariables(user); } else { string msg = "INVALID PASSWORD SUPPLIED"; bll.InsertIntoAuditLog("Login", "", user.BankCode, user.Id, "Unsuccessfull login of User with ID :" + user.Id + " Error: " + msg); ShowMessage(msg, true); } } else { string msg = user.StatusDesc; bll.InsertIntoAuditLog("Login", "", user.BankCode, user.Id, "Unsuccessfull login of User with ID :" + user.Id + " Error: " + msg); ShowMessage(msg, true); } }
protected void btnSave_Click(object sender, EventArgs e) { try { string OldPassword = txtOldPassword.Text; string NewPassword = txtNewPassword.Text; string ConfirmedPassword = txtConfirmPassword.Text; if (NewPassword != ConfirmedPassword) { string msg = "Msg: Your New Password Doesnt match the confirmed Password"; bll.ShowMessage(lblMsg, msg, true); } else if (bll.GenerateMD5Hash(OldPassword) != user.Password) { string msg = "Msg: Your Old Password Is Incorrect"; bll.ShowMessage(lblMsg, msg, true); } else { user.Password = bll.GenerateMD5Hash(NewPassword); user.ModifiedBy = user.Id; Result result = bll.ChangeUsersPassword(user.Id, user.BankCode, user.Password); if (result.StatusCode == "0") { string msg = "Password Changed Successfully"; bll.ShowMessage(lblMsg, msg, false); } else { string msg = result.StatusDesc; bll.ShowMessage(lblMsg, msg, true); } } } catch (Exception ex) { string msg = "FAILED: " + ex.Message; bll.ShowMessage(lblMsg, msg, true); } }
private void SignInUser(string UserId, string Password) { BankUser user = bll.GetBankUser(UserId); if (user.StatusCode == "0") { string md5HashOfPassword = bll.GenerateMD5Hash(Password); if (user.Password == md5HashOfPassword) { AssignSessionVariables(user); } else { ShowMessage("INVALID PASSWORD SUPPLIED", true); } } else { ShowMessage(user.StatusDesc, true); } }