Exemplo n.º 1
0
 public void backup(string inPath, string outPath)
 {
     fileFolder ff = new fileFolder();
     ff.directoryCopy(inPath, outPath, true);
 }
Exemplo n.º 2
0
        public void startUp()
        {
            try
            {
                dataBase db = new dataBase();
                fileFolder ff = new fileFolder();
                //check the core folder database exists - if not create it
                ff.createFolder(path);
                ff.createFolder(path + @"extra\");
                ff.createFolder(path + @"tasks\");
                ff.createFolder(path + @"maintenence\");
                ff.createFolder(path + @"maintenence\inventory\");
                ff.createFolder(path + @"contractors\");
                ff.createFolder(path + @"contractors\lists\");
                ff.createFolder(path + @"\contractors\providers\lists\");
                ff.createFolder(Application.StartupPath + @"\database\config\");
                ff.createFolder(Application.StartupPath + @"\database\temp\");

                db.create("contractor_lists", path + @"\contractors\lists\contractors.xml");
                db.create("contractors_today", path + @"\contractors\" + fileNameDate + ".xml");
                db.create("provider_lists", path + @"\contractors\providers\lists\providers.xml");

                //check if tasks xml datbase exists
                db.create("tasks", path + @"tasks\tasklist.xml");
                if (db.create("extra_tasks", path + @"extra\" + DateTime.Now.ToString("MMMM-yyyy") + ".xml"))
                {
                    createExtraTasks();
                }

                //check if todays tasks xml datbase exists
                if (db.create("root", path + DateTime.Now.ToString("d-MM-yyyy") + ".xml"))
                {
                    //file does not exist returns true - create todays tasks
                    createTodaysTasks();
                }
                db.create("inventory", path + @"maintenence\inventory\list.xml");
                db.create("item_maintenence", path + @"maintenence\"+fileNameDate+".xml");

                //check for update

            }
            catch (Exception err)
            {
                debugTerminal terminal = new debugTerminal();
                terminal.output(err.ToString());
            }
        }