Example #1
0
File: Form1.cs Project: yihyun/LTTQ
        private void btlogin_Click(object sender, EventArgs e)
        {
            BanHang2017.Classes.DataProcess dtbase = new BanHang2017.Classes.DataProcess();
            SqlConnection con = dtbase.laycon();

            con.Open();
            string        sq     = "select *from dbo.[User] where Username='******'";
            SqlCommand    cm     = new SqlCommand(sq, con);
            SqlDataReader reader = cm.ExecuteReader();
            DataTable     h      = new DataTable();

            h = dtbase.SelectTable(sq);
            if (h.Rows.Count == 0)
            {
                lbhien.Text = "Thông Tin Tài Khoản Mật Khẩu Không Chính Xác";
                tbuser1.Focus();
            }

            if (reader.HasRows)
            {
                reader.Read();
                if (tbpw1.Text == reader.GetString(2).ToString())
                {
                    this.Hide();
                    //MessageBox.Show("đăng nhập thành công");
                    FormKhachHang frmKH = new FormKhachHang();
                    frmKH.Show();
                }
                else
                {
                    lbhien.Text = "Thông Tin Tài Khoản Mật Khẩu Không Chính Xác";
                    tbpw1.Focus();
                }
            }
        }
Example #2
0
File: Main.cs Project: yihyun/LTTQ
        private void barButtonItem1_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            FormKhachHang kh = new FormKhachHang();

            kh.Show();
        }
Example #3
0
File: Main.cs Project: yihyun/LTTQ
        private void navBarItem2_LinkClicked(object sender, DevExpress.XtraNavBar.NavBarLinkEventArgs e)
        {
            FormKhachHang kh = new FormKhachHang();

            kh.Show();
        }