diff --git a/Source Code/TeamHobby.HobbyProjectGenerator.Archive/ArchiveController.cs b/Source Code/TeamHobby.HobbyProjectGenerator.Archive/ArchiveController.cs index e76171b..2661298 100644 --- a/Source Code/TeamHobby.HobbyProjectGenerator.Archive/ArchiveController.cs +++ b/Source Code/TeamHobby.HobbyProjectGenerator.Archive/ArchiveController.cs @@ -12,18 +12,33 @@ namespace TeamHobby.HobbyProjectGenerator.Archive _conn = dataSource; } - public IDataSource GetDataSource(){ - return _conn; - } // Create the folder where the compress file will be stored public bool CreateArchiveFolder(){ + string curPath = Directory.GetCurrentDirectory(); + //string temp = @ + string archiveFolder = curPath + "\\HobbyArhive"; + //Console.WriteLine("Creating a new folder at: {0}", archiveFolder); + if (!Directory.Exists(archiveFolder)) + { + Console.WriteLine("Creating a new folder at: {0}", archiveFolder); + Directory.CreateDirectory(archiveFolder); + } return true; } // Return the name of the new output file with Path - public string CreateOutFileName(){ - return "hello"; + public string CreateOutFileName() { + try { + string path = Directory.GetCurrentDirectory(); + Console.WriteLine("The current directory is {0}", path); + return path; + } + catch + { + Console.WriteLine("ArchiveCon: Creating a file name failed. "); + return ""; + } } // put everything toget here diff --git a/Source Code/main/Controller.cs b/Source Code/main/Controller.cs index 1932939..dfb67a9 100644 --- a/Source Code/main/Controller.cs +++ b/Source Code/main/Controller.cs @@ -1,6 +1,7 @@ using main; using System; using System.Data.Odbc; +using TeamHobby.HobbyProjectGenerator.Archive; using TeamHobby.HobbyProjectGenerator.DataAccess; @@ -67,6 +68,16 @@ namespace TeamHobby.HobbyProjectGenerator.Main // Closing the connection sqlDS.getConnection().Close(); + // Testing archive Manager + ArchiveController archive = new ArchiveController(datasource); + string curPath = archive.CreateOutFileName(); + + //Creating the folder Archive + Console.WriteLine("Creating a new folder ..."); + archive.CreateArchiveFolder(); + + + // 2.Inserting Data into the database: //string sqlWrite = "INSERT into log(lvname, catname, userop, logmessage) values " + // "('Info', 'View', 'Testing DAL stuffs', 'new DAL method tested');"; diff --git a/Source Code/main/main.csproj b/Source Code/main/main.csproj index 63f5952..8853c02 100644 --- a/Source Code/main/main.csproj +++ b/Source Code/main/main.csproj @@ -12,6 +12,7 @@ +