private void btnSearch_Click(object sender, EventArgs e) { BUS.LoanBUS bus = new BUS.LoanBUS(); string searchValue = txtSearch.Text; if (searchValue == "") { bsItem.DataSource = bus.getAllLoans(); dgvHistory.DataSource = bsItem; return; } bsItem.DataSource = bus.getLoanByID(searchValue); dgvHistory.DataSource = bsItem; }
public void LoadData(int role, string UserID) { BUS.LoanBUS bus = new BUS.LoanBUS(); if (role == 1) { bsItem.DataSource = bus.getLoanByID(UserID); dgvHistory.DataSource = bsItem; } else { bsItem.DataSource = bus.getAllLoans(); dgvHistory.DataSource = bsItem; } bnList.BindingSource = bsItem; }