Example #1
0
        public Form1()
        {
            InitializeComponent();

            // Загрузка баз данных
            ConfigDB = SQLiteDataBase.Open("config.db");
            Dir      = Directories.GetFromDB(ConfigDB);
            LogDB    = SQLiteDataBase.Open(ConfigDB.GetConfigValue("Log"));

            Update_Label();
        }
Example #2
0
        static public SQLiteDataBase Create(string FileName, string Query)
        {
            SQLiteDataBase NewBase = new SQLiteDataBase(FileName);

            if (NewBase.CreateDB(Query))
            {
                return(NewBase);
            }
            else
            {
                return(null);
            }
        }
Example #3
0
        static public SQLiteDataBase Open(string FileName)
        {
            SQLiteDataBase NewBase = new SQLiteDataBase(FileName);

            if (NewBase.OpenDB())
            {
                return(NewBase);
            }
            else
            {
                return(null);
            }
        }
Example #4
0
        public static Directories GetFromDB(SQLiteDataBase DB)
        {
            Directories Dir = new Directories();

            Dir.Work          = DB.GetConfigValue("Work_Directory") + @"\";
            Dir.Prep          = Dir.Work + DB.GetConfigValue("Prep_Directory") + @"\";
            Dir.Template      = Dir.Work + DB.GetConfigValue("Template_Directory") + @"\";
            Dir.Archive       = DB.GetConfigValue("Archive_Directory") + @"\";
            Dir.Archive_Photo = DB.GetConfigValue("Archive_Directory_Photo") + @"\";
            Dir.Data          = Dir.Prep + DB.GetConfigValue("Prep_Data_Directory") + @"\";
            Dir.Output        = Dir.Prep + DB.GetConfigValue("Prep_Output_Directory") + @"\";
            Dir.Source        = Dir.Prep + DB.GetConfigValue("Prep_Source_Directory") + @"\";
            Dir.Cloud         = DB.GetConfigValue("Cloud_Directory") + @"\";

            if (!Directory.Exists(Dir.Archive))
            {
                Directory.CreateDirectory(Dir.Archive);
            }
            if (!Directory.Exists(Dir.Archive_Photo))
            {
                Directory.CreateDirectory(Dir.Archive_Photo);
            }
            return(Dir);
        }