示例#1
0
 private static bool GetUpdateDetailsList(string detailsFilePath)
 {
     try
     {
         var dbReader = new DbSqLiteHelper(detailsFilePath);
         dbReader.ConnectionInit();
         var dt = dbReader.ExecuteDataTable(SQL_GET_UPDATE_DETAILS);
         if (dt == null || dt.Rows.Count == 0)
         {
             return(false);
         }
         for (int index = 0; index < dt.Rows.Count; index++)
         {
             var details = new UpdateDetails();
             details.Type         = (TargetType)dt.Rows[index][0];
             details.UpdateSource = (string)dt.Rows[index][1];
             details.UpdateTarget = (string)dt.Rows[index][2];
             _updateDetailsList.Add(details);
         }
         return(true);
     }
     catch (Exception ex)
     {
         return(false);
     }
 }
示例#2
0
 public void Dispose()
 {
     if (_helper != null)
     {
         _helper.Dispose();
     }
     _helper = null;
     _sqliteAcc = null;
 }
 private static bool Initialize()
 {
     bool res = CheckFileExistAndMoveTo();
     if (!res)
     {
         return false;
     }
     _helper = new DbSqLiteHelper(ConstValue.SMART_CONFIG_DB_NAME);
     _helper.ConnectionString = "DataSource=" + ConstValue.SMART_CONFIG_DB_NAME;
     
     res = _helper.ConnectionInit(_helper.ConnectionString);
     if (!res)
     {
         return false;
     }
     IniSQLiteTable();
     return true;
 }
示例#4
0
 private static bool GetUpdateDetailsList(string detailsFilePath)
 {
     try
     {
         var dbReader = new DbSqLiteHelper(detailsFilePath);
         dbReader.ConnectionInit();
         var dt = dbReader.ExecuteDataTable(SQL_GET_UPDATE_DETAILS);
         if (dt == null || dt.Rows.Count == 0)
         {
             return false;
         }
         for (int index = 0; index < dt.Rows.Count; index++)
         {
             var details = new UpdateDetails();
             details.Type = (TargetType)dt.Rows[index][0];
             details.UpdateSource = (string)dt.Rows[index][1];
             details.UpdateTarget = (string)dt.Rows[index][2];
             _updateDetailsList.Add(details);
         }
         return true;
     }
     catch (Exception ex)
     {
         return false;
     }
 }