private void btnReg_Click(object sender, EventArgs e) { if (txtName.Text == "" || txtMail.Text == "" || txtPass.Text == "" || txtPassCon.Text == "") { MessageBox.Show("Please fill all Mandatory fields"); } else if (txtPass.Text != txtPassCon.Text) { MessageBox.Show("Password do not match"); } else { using (SqlConnection sqlCon = new SqlConnection(connectionSting)) { sqlCon.Open(); SqlCommand sqlCmd = new SqlCommand("insert into JobseekerDetails (j_name, j_mail, j_password) values(@j_name,@j_mail,@j_password)", sqlCon); sqlCmd.Parameters.AddWithValue("@j_name", txtName.Text.Trim()); sqlCmd.Parameters.AddWithValue("@j_mail", txtMail.Text.Trim()); sqlCmd.Parameters.AddWithValue("@j_password", txtPass.Text.Trim()); sqlCmd.ExecuteNonQuery(); MessageBox.Show("Account Created Successfully"); Clear(); } Form f2 = new LogJobseeker(); f2.Show(); this.Hide(); f2.Closed += (s, args) => this.Close(); } void Clear() { txtName.Text = txtMail.Text = txtPass.Text = txtPassCon.Text = ""; } }
private void loginToolStripMenuItem_Click(object sender, EventArgs e) { LogJobseeker LogJ = new LogJobseeker(); LogJ.Show(); this.Hide(); LogJ.Closed += (s, args) => this.Close(); }