コード例 #1
0
ファイル: SQLiteCommon.cs プロジェクト: cuongjpitdnu/Project
        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;
            }
        }
コード例 #2
0
 public ListBoxItem(KeyDevice key, string name_shr, bool bChecked)
 {
     this.key      = key;
     this.name_shr = name_shr;
     this.bChecked = bChecked;
     bVisibled     = false;
 }