-
Notifications
You must be signed in to change notification settings - Fork 0
/
AdminCustomer.cs
39 lines (34 loc) · 1.06 KB
/
AdminCustomer.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace GameStoreManagement
{
public partial class AdminCustomer : UserControl
{
private DataAccess da
{ get; set; }
public AdminCustomer()
{
InitializeComponent();
da = new DataAccess();
PopulateGridView();
}
public void PopulateGridView(string sql = "select * from OrderDetails;")
{
var ds = this.da.ExecuteQuery(sql);
this.dataGridView1.AutoGenerateColumns = false;
this.dataGridView1.DataSource = ds.Tables[0];
}
private void txtSearchProduct_TextChanged(object sender, EventArgs e)
{
var sql = "select * from OrderDetails where ID like '" + this.txtSearchOder.Text + "%';";
this.PopulateGridView(sql);
}
}
}