private void loadSearch(string text) { dataGridView1.DataSource = libraryapp.FindAccount(text); switch (dataGridView1.Rows.Count) { case 0: EnableBtn(false); break; default: EnableBtn(true); break; } }
private object loadSearch(string text) { switch (selectedTable) { case TblEnums.Book: return(libraryapp.FindBook(text)); case TblEnums.Account: return(libraryapp.FindAccount(text)); case TblEnums.Borrow: return(libraryapp.FindBorrowHistory(text)); default: throw new NotImplementedException(); } }