private void loadDevices() { try { List <MDevice> lstDevice = SQLiteCommon.GetALlDevices(); BindingDataGridView(dgvDevices, lstDevice); } catch (Exception ex) { log.Error(ex); ShowMsg(MessageBoxIcon.Error, ex.Message); } }
private List <MDevice> searchListDevice() { var key = this.txtKeySeach.Text.Trim()?.ToLower(); try { List <MDevice> lstDevice = SQLiteCommon.GetALlDevices().Where(i => string.IsNullOrEmpty(key) || i.DeviceName.ToLower().Contains(key) || i.MacAddress.ToLower().Contains(key)).ToList(); return(lstDevice); } catch (Exception ex) { throw ex; } }