コード例 #1
0
ファイル: DangNhap.cs プロジェクト: thinhquiduy/demo
 private void button1_Click(object sender, EventArgs e)
 {
     BoPhanQuanLi f = new BoPhanQuanLi();
     this.Hide();
     f.ShowDialog();
     this.Show();
 }
コード例 #2
0
ファイル: BanHangChiNhanh.cs プロジェクト: thinhquiduy/demo
        public BanHangChiNhanh()
        {
            InitializeComponent();
            BoPhanQuanLi f1 = new BoPhanQuanLi();
            //  f1.Show();
            DataTable DanhMucChiNhanh = f1.DocBangDanhMucChiNhanh();

            dgvDanhMucChinhanh.DataSource = f1.DocBangDanhMucChiNhanh();
        }
コード例 #3
0
ファイル: DangNhap.cs プロジェクト: thinhquiduy/demo
        private void button1_Click(object sender, EventArgs e)
        {
            string sql = " select Count(*) from [Login].[dbo].Login where TaiKhoan =@acc and MatKhau=@pass";

            conn = new SqlConnection(strConnection);
            conn.Open();
            command = new SqlCommand(sql, conn);
            command.Parameters.Add(new SqlParameter("@acc", tbdangnhap.Text));
            command.Parameters.Add(new SqlParameter("@pass", tbmatkhau.Text));
            int x = (int)command.ExecuteScalar();

            if (x == 1)
            {
                MessageBox.Show("Đăng nhập thành công", "Nofitication");
                BoPhanQuanLi f = new BoPhanQuanLi();
                this.Hide();
                f.ShowDialog();
                this.Show();
            }
            else
            {
                MessageBox.Show("Đăng nhập thất bại", "Nofitication");
            }
        }