private void Enterloging_jobseek_bt_Click(object sender, EventArgs e) { try { var user_name = textBox_username.Text; var password = textBox_Password.Text; var IsValid = true; var Jobseeker_details = _db.Jobseeker_details.FirstOrDefault(q => q.User_Name == user_name && q.Password == password); if (Jobseeker_details == null) { IsValid = false; MessageBox.Show("Required field is empty"); } if (IsValid) { MessageBox.Show("Welcome " + user_name); Job_Seeker_Accountview job_Seeker_Accountview = new Job_Seeker_Accountview(textBox_username.Text); job_Seeker_Accountview.ShowDialog(); Close(); } } catch (Exception ex) { MessageBox.Show(ex.Message); //throw; } }
private void Enterloging_jobseek_bt_Click(object sender, EventArgs e) { try { //SHA256 sha = SHA256.Create(); var user_name = textBox_username.Text; var password = textBox_Password.Text; var IsValid = true; var hashed_password = Utils.HashedPassword(password); var Jobseeker_details = _db.Jobseeker_details.FirstOrDefault(q => q.User_Name == user_name && q.Password == hashed_password); JsId = Jobseeker_details.id; if (Jobseeker_details == null) { IsValid = false; MessageBox.Show("Please re-enter user name and password"); } if (IsValid) { MessageBox.Show("Welcome " + user_name); this.Hide(); Job_Seeker_Accountview job_Seeker_Accountview = new Job_Seeker_Accountview(JsId, textBox_username.Text); job_Seeker_Accountview.ShowDialog(); this.Close(); } } catch (Exception ex) { MessageBox.Show(ex.Message); //throw; } }