private void gridView1_RowCellClick(object sender, DevExpress.XtraGrid.Views.Grid.RowCellClickEventArgs e) { if (gridView1.FocusedRowHandle >= 0) { maSP = gridView1.GetRowCellDisplayText(e.RowHandle, "MaSP").ToString(); initChar(con.GetValue("select TenSP from SanPham where MaSP='" + maSP + "'")); btnNow_Click(sender, e); } }
private void btnDangNhap_Click(object sender, EventArgs e) { try { if (conn.GetValue("Select * from TAIKHOAN where TenTK = '" + txtTenDangNhap.Text + "'" + "and MatKhau = " + "'" + txtMatKhau.Text + "'") != "") { this.Hide(); dal_TaiKhoan.LayQuyenTaiKhoan(txtTenDangNhap.Text); Form frm = new frmMenu(txtTenDangNhap.Text.Trim(), dal_TaiKhoan.LayQuyenTaiKhoan(txtTenDangNhap.Text)); frm.ShowDialog(); this.Show(); } else { MessageBox.Show("Đăng nhập thất bại"); } } catch (Exception) { MessageBox.Show("Lỗi"); } }