public static List <KeyDevice> GetALlKeyDevices() { List <KeyDevice> lstKeyDevice = new List <KeyDevice>(); try { string sql = "SELECT * FROM KEYDEVICES"; var result = SQLiteCommon.ExecuteSqlWithResult(sql); if (result != null && result.HasRows) { while (result.Read()) { KeyDevice keyDevice = new KeyDevice(); keyDevice.KeyCode = result["KEYCODE"]?.ToString(); keyDevice.MachineCode = result["MACHINECODE"]?.ToString(); keyDevice.MacAddress = result["MACADDRESS"]?.ToString(); keyDevice.UserId = result["USERID"]?.ToString(); keyDevice.CreateDate = Convert.ToDateTime(result["CREATEDATE"]?.ToString()); lstKeyDevice.Add(keyDevice); } } return(lstKeyDevice); } catch (Exception ex) { throw ex; } }
public ListBoxItem(KeyDevice key, string name_shr, bool bChecked) { this.key = key; this.name_shr = name_shr; this.bChecked = bChecked; bVisibled = false; }