protected void Button1_Click(object sender, EventArgs e) { var cllg = new DlLogins(); //check passwords is ok first if (cllg.Getjobuser(Session["pusername"].ToString(), TextBox1.Text) != null) { if (TextBox2.Text == TextBox3.Text) { //change pwd cllg.Chgpwdjs(Session["pusername"].ToString(), TextBox2.Text); Label4.Text = "Password Changed, please use this from now onwards"; } 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.Getjobuser(TextBox2.Text, TextBox3.Text) == TextBox2.Text) { Session["pusername"] = TextBox2.Text; Session["pwelcomename"] = lg.Userwelcomename(TextBox2.Text, 2); string addhash2 = chash.GetMd5Hash(rand.Next(1000, 10000).ToString(CultureInfo.InvariantCulture)); Session["cuserval"] = addhash2; setjobcookie(addhash2); Response.Redirect(cpath + "/Jobseekers/JobSeekerHome.aspx?CRF=2"); } } }