private void homeToolStripMenuItem_Click(object sender, EventArgs e) { Form f = new CandidateHome(); f.Show(); this.Hide(); }
private void Home_Click(object sender, EventArgs e) { Form f = new CandidateHome(); f.Show(); this.Hide(); }
private void LoginButton_Click(object sender, EventArgs e) { SqlConnection con = new SqlConnection(@"Data Source=OLA\SQLSERVER;Initial Catalog=ApplicantTrackingSystem;Integrated Security=True;Connect Timeout=15;Encrypt=False;TrustServerCertificate=False"); con.Open(); if (!string.IsNullOrEmpty(UsernameBox.Text) && !(UsernameBox.Text == "Username") && !string.IsNullOrEmpty(PasswordBox.Text) && !(PasswordBox.Text == "Password")) { SqlCommand cmd = new SqlCommand("select Mail,Username, Password from [Candidate]", con); SqlDataReader rdr = cmd.ExecuteReader(); bool exist = false; while (rdr.Read()) { string Username = (string)rdr["Username"]; string Password = (string)rdr["Password"]; if (Username == UsernameBox.Text && Password == PasswordBox.Text) { exist = true; LocalUsername = Username; Form Candidate = new CandidateHome(); Candidate.Show(); this.Hide(); break; } else if (Username == UsernameBox.Text && Password != PasswordBox.Text) { exist = true; MessageBox.Show("Please Enter Correct Password."); PasswordBox.Clear(); } } if (!exist) { MessageBox.Show("Make Sure You Entered Correct Username."); } } else { MessageBox.Show("Please Fill The Empty Boxes."); } con.Close(); }
protected void Delete_Click(object sender, EventArgs e) { Button button = sender as Button; SqlConnection con = new SqlConnection(@"Data Source=OLA\SQLSERVER;Initial Catalog=ApplicantTrackingSystem;Integrated Security=True;Connect Timeout=15;Encrypt=False;TrustServerCertificate=False"); con.Open(); SkillID = button.TabIndex; SqlCommand cmd = new SqlCommand("Delete from [Skill] where SkillID=@SkillID", con); cmd.Parameters.AddWithValue("@SkillID", SkillID); cmd.ExecuteNonQuery(); MessageBox.Show("Skill has been deleted successfully"); Form f = new CandidateHome(); f.Show(); this.Hide(); }