Exemple #1
0
        public static void Import(string path)
        {
            if (File.Exists(path))
            {
                string content = File.ReadAllText(path);

                try
                {
                    licContent = GetLicContent(content);

                    DBManager.ExecuteQuery("DELETE FROM license");
                    DBManager.ExecuteQuery(string.Format("INSERT INTO license(content) VALUES('{0}');", content));
                }
                catch (Exception e)
                {
                    LoggerSingleton.GetInstance.Error(e.Message);
                    throw new InvalidFileException();
                }
            }
            else
            {
                throw new InvalidFileException();
            }
        }
Exemple #2
0
 public static void Load()
 {
     DBManager.RunQueryResults("select TOP 1 content FROM license", (System.Data.SqlClient.SqlDataReader reader) => {
         licContent = GetLicContent(reader["content"].ToString());
     });
 }
Exemple #3
0
 public static void Load(string content)
 {
     licContent = GetLicContent(content);
 }