private void button1_Click(object sender, EventArgs e) { SqlConnection cn = new SqlConnection(str); string sql = "SELECT * FROM TaiKhoan where TaiKhoan='" + txtTaiKhoan.Text + "'and MatKhau='" + txtMatKhau.Text + "'"; cn.Open(); SqlCommand cmd = new SqlCommand(sql, cn); SqlDataReader reader = cmd.ExecuteReader(); if (reader.Read()) { cn.Close(); this.Hide(); FrmMain f = new FrmMain(); f.Show(); } else { MessageBox.Show("Bạn Đăng Nhập không thành công!"); txtMatKhau.Text = ""; txtTaiKhoan.Text = ""; txtTaiKhoan.Focus(); } }
// private void FrmChiTietThue_FormClosed(object sender, FormClosedEventArgs e) { FrmMain k = new FrmMain(); k.Show(); }
private void FrmNhanVien_FormClosed(object sender, FormClosedEventArgs e) { FrmMain f = new FrmMain(); f.Show(); }
private void FrmKhachHang_FormClosed(object sender, FormClosedEventArgs e) { FrmMain f = new FrmMain(); f.Show(); }