private void btn_login_Click(object sender, EventArgs e) { if (txt_pass.Text == "" || txt_username.Text == "") { MessageBox.Show("Please Enter UserName & Password"); return; } con.Open(); SqlCommand cmd = new SqlCommand(" select * from emp_login('" + txt_username.Text + "')", con); SqlDataReader Rd = cmd.ExecuteReader(); find = false; while (Rd.Read()) { find = true; if ((Rd["password"].ToString()).Trim() == txt_pass.Text) { id = Convert.ToInt32(Rd["emp_id"]); Admin_Page.Form4 f = new Admin_Page.Form4((int)Rd["emp_id"]); f.Show(); this.Hide(); break; } else { MessageBox.Show("Wrong Password"); } } if (!find) { MessageBox.Show("this username isn`t exist"); } Rd.Close(); con.Close(); }
private void editflight_Click(object sender, EventArgs e) { Admin_Page.Form4 g = new Admin_Page.Form4(id); g.Show(); this.Hide(); }