コード例 #1
0
ファイル: Login.cs プロジェクト: phuongthuy218/Nhansu
        private void butdangnhap_Click(object sender, EventArgs e)
        {
            SqlCommand cmd = new SqlCommand();

            cmd.Connection  = conn;
            cmd.CommandType = CommandType.Text;
            cmd.CommandText = @"select * from nguoidung
                                        where (tendangnhap=@tendangnhap)
                                         And (matkhau=@matkhau)";
            cmd.Parameters.Add("@tendangnhap", SqlDbType.NVarChar, 50).Value = txtusername.Text;
            cmd.Parameters.Add("@matkhau", SqlDbType.NVarChar, 50).Value     = txtpass.Text;
            da.SelectCommand = cmd;
            da.Fill(dt);

            if (dt.Rows.Count > 0)
            {
                Trangchu _trangchu = new Trangchu();
                _trangchu.Show();
                Hide();
            }
            else
            {
                MessageBox.Show("Bạn sai tài khoản hoặc quên mật khẩu", "đăng nhập", MessageBoxButtons.OK);
            }
        }
コード例 #2
0
ファイル: Trinhdo.cs プロジェクト: phuongthuy218/Nhansu
        private void tsbhome_Click(object sender, EventArgs e)
        {
            Trangchu tc = new Trangchu();

            tc.Show();
            this.Close();
        }
コード例 #3
0
ファイル: Daotao.cs プロジェクト: phuongthuy218/Nhansu
        private void toolStripButton1_Click(object sender, EventArgs e)
        {
            Trangchu tc = new Trangchu();

            tc.ShowDialog();
            this.Hide();
        }
コード例 #4
0
        private void tsbhome_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show("Bạn có muốn về trang chủ không?", "Thông báo", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation) == DialogResult.Yes)
            {
                Dispose();
            }
            Trangchu tc = new Trangchu();

            tc.ShowDialog();
        }
コード例 #5
0
        private void toolStripButton1_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show("Bạn có muốn thoát?", "Thông báo", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation) == DialogResult.Yes)
            {
                Dispose();
            }
            Trangchu tc = new Trangchu();

            tc.Show();
            this.Hide();
        }
コード例 #6
0
        private void tsbthoat_Click(object sender, EventArgs e)
        {
            if (DialogResult.Yes == MessageBox.Show("Bạn có muốn thoát không?", "Thông báo", MessageBoxButtons.YesNo, MessageBoxIcon.Question))
            {
                Dispose();
            }
            Trangchu tc = new Trangchu();

            tc.Show();
            this.Hide();
        }