protected void Button1_Click(object sender, EventArgs e) { var cllg = new DlLogins(); //check passwords is ok first if (cllg.Getuser(Session["pusername"].ToString(), TextBox1.Text) != null) { if (TextBox2.Text == TextBox3.Text) { //change pwd cllg.Chgpwdrec(Session["pusername"].ToString(), TextBox2.Text); Label4.Text = "Password Changed, please use this from now onwards"; TextBox1.Text = ""; TextBox2.Text = ""; TextBox3.Text = ""; } else { Label4.Text = "New Password donot match"; } } else { //check pwd Label4.Text = "Please Check your old password"; } }
protected void Button2_Click(object sender, EventArgs e) { var lg = new DlLogins(); var rand = new Random(); var chash = new ClPwdhash(); if (TextBox3.Text != string.Empty && TextBox2.Text != string.Empty) { if (lg.Getuser(TextBox2.Text, TextBox3.Text) == TextBox2.Text) { Session["pusername"] = TextBox2.Text; //the below method is overloaded Session["pwelcomename"] = lg.Userwelcomename(TextBox2.Text, 1, 0); string addhash2 = chash.GetMd5Hash(rand.Next(1000, 10000).ToString(CultureInfo.InvariantCulture)); Session["cuserval"] = addhash2; setjobcookie(addhash2); Response.Redirect(cpath + "/Recruiters/Rechome.aspx?Fg=1"); } } }