/// <summary> /// Handles the Click event of the btnchPwd control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param> /// <remarks></remarks> protected void btnchPwd_Click(object sender, EventArgs e) { ViewState["ModifyPassword"] = null; if (cmpConfirmPassowrd.IsValid && reqConfirmPassword.IsValid && reqNewPassword.IsValid) { ViewState["ModifyPassword"] = txtNewPassword.Text.Trim(); } else { throw new Exception(Constants.incorrectPWd); } try { if (Session["Acc_Num"] != null && ViewState["ModifyPassword"] != null) { CardHolderManager um = new CardHolderManager(); CardHolder_MstDTO user = um.FindUserByCrNumber(Session["Acc_Num"].ToString()); if (user.User_pwd == ViewState["ModifyPassword"].ToString()) { lblErrpwd.Text = Constants.NotEqualPwd; DivPwd.Attributes.CssStyle.Add("display", "block"); } else { user.User_pwd = ViewState["ModifyPassword"].ToString(); um.UpdateCardHolder(user); ClearControls(); // Response.Redirect("login.aspx"); ScriptManager.RegisterStartupScript(this, GetType(), "displayalertmessage", "Showalert();", true); } } else { ScriptManager.RegisterStartupScript(this, GetType(), "showalert", "alert('" + Constants.GeneralRequestError + "');", true); ClearControls(); } } catch (Exception) { ScriptManager.RegisterStartupScript(this, GetType(), "showalert", "alert('" + Constants.GeneralRequestError + "');", true); ClearControls(); } }
/// <summary> /// Handles the Click event of the btnSubmitfinal control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param> /// <remarks></remarks> protected void btnSubmitfinal_Click(object sender, EventArgs e) { //Start Added by abhijeet on 09/10/2019 to restrict 3 OTP in one session VAPT issue if (Session["OTP_Frg_User"] != null && Session["OTP_Frg_User"].ToString() != "") { int cnt = 0; if (Int32.TryParse(Session["OTP_Frg_User"].ToString(), out cnt) && cnt >= 3) { LabelOTPMessage.Text = Constants.MaxNoOfOTPMessage; DivOTPMessage.Attributes.CssStyle.Add("display", "block"); return; } } //End Added by abhijeet on 09/10/2019 to restrict 3 OTP in one session VAPT issue if (!string.IsNullOrEmpty(FirstFour.Text) && !string.IsNullOrEmpty(SecondFour.Text) && !string.IsNullOrEmpty(ThirdFour.Text) && !string.IsNullOrEmpty(ForthFour.Text)) { hdnCard1.Value = FirstFour.Text.Encrypt(); hdnCard2.Value = SecondFour.Text.Encrypt(); hdnCard3.Value = ThirdFour.Text.Encrypt(); hdnCard4.Value = ForthFour.Text.Encrypt(); FirstFour.Text = "xxxx"; SecondFour.Text = "xxxx"; ThirdFour.Text = "xxxx"; ForthFour.Text = "xxxx"; } CardHolder_MstDTO user = new CardHolder_MstDTO(); if (IsValidInfo()) { string fullCardnumber = (FirstFour.Text + SecondFour.Text + ThirdFour.Text + ForthFour.Text).Trim(); //string DateOfBirth = DateTime.ParseExact(txtbirthdate.Text, "dd/MM/yyyy", CultureInfo.InvariantCulture).ToString("MM/dd/yyyy"); string DateOfBirth = Convert.ToString(GetDateTime(txtbirthdate.Text)); int ExpiryMonth = Convert.ToInt32(ddlmonth.SelectedItem.Text); int ExpiryYear = Convert.ToInt32(ddlyear.SelectedItem.Text); // Step 1 Find CARD In Oracle Database CardManager cm = new CardManager(); CH_CardDTO card = cm.AuthenticateCrNumberDOB(new CH_CardDTO() { card_number = fullCardnumber, EXPIRY_MONTH = ExpiryMonth, EXPIRY_YEAR = ExpiryYear, BIRTH_DATE = Convert.ToDateTime(DateOfBirth) }); // Step 2 Find CARD In SQL Database Either exists or not // CardHolderManager Cardholder = new CardHolderManager(); if (card != null) { user = Cardholder.FindUserByCrNumber(card.Cr_Account_Nbr.Encrypt()); } else { lblMessage.Text = Constants.InvalidEntries; DivMessage.Attributes.CssStyle.Add("display", "block"); txtCaptchaFirst.Text = string.Empty; mvFrgtUname.ActiveViewIndex = 0; return; } //CardHolder_MstDTO user = Cardholder.FindUserByCrNumber(fullCardnumber.Encrypt()); if (card != null && user != null) { string mobilenum = ""; ViewState["Mobile_Num"] = card.PHONE_MOBILE; if (ViewState["Mobile_Num"] != null) { mobilenum = ViewState["Mobile_Num"].ToString(); } //Session["Card_Num"] = fullCardnumber.Encrypt(); Session["Acc_Num"] = card.Cr_Account_Nbr.Encrypt(); ViewState["UserName"] = user.User_nm; ViewState["CardHolder_name"] = card.FULL_NAME; ViewState["Email_ID"] = card.EMAIL_ID; string lastFourdgts = string.Empty; if (mobilenum != "") { int numberkength = mobilenum.Length; if (numberkength > 4) { lastFourdgts = mobilenum.Substring(numberkength - 4, 4); } else { lastFourdgts = mobilenum; } txtMobileNo.Text = mobilenum; } //mobilenum = mobilenum.Substring(6, 4); //lblDescOTP.Text = Constants.OTPDescforchangePwd; //lblmob.Text = "(i.e. XXXXXX" + lastFourdgts + ")"; //lbl3.Text = Constants.OTPDesc2; string OtpSuccess = GenerateOTP(); if (OtpSuccess != "0" && !string.IsNullOrEmpty(OtpSuccess)) { mvFrgtUname.ActiveViewIndex = 1; StartOTPTimer(); lblMessage.Text = string.Empty; DivMessage.Attributes.CssStyle.Add("display", "none"); } else { ClearControls(); LblErrorMessage.Text = Constants.TechnicalError; DivERROR.Attributes.CssStyle.Add("display", "block"); return; } } else if (card != null && user == null) { lblMessage.Text = Constants.NotRegister; DivMessage.Attributes.CssStyle.Add("display", "block"); mvFrgtUname.ActiveViewIndex = 0; } else { lblMessage.Text = Constants.InvalidEntries; DivMessage.Attributes.CssStyle.Add("display", "block"); mvFrgtUname.ActiveViewIndex = 0; } } }