Exemplo n.º 1
0
 private void loadDevices()
 {
     try
     {
         List <MDevice> lstDevice = SQLiteCommon.GetALlDevices();
         BindingDataGridView(dgvDevices, lstDevice);
     }
     catch (Exception ex)
     {
         log.Error(ex);
         ShowMsg(MessageBoxIcon.Error, ex.Message);
     }
 }
Exemplo n.º 2
0
        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;
            }
        }