109 lines
4.0 KiB
C#
109 lines
4.0 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using System.IO;
|
|
namespace CCH
|
|
{
|
|
public static class AppFolderSystem
|
|
{
|
|
// ROOT
|
|
public static readonly string appDataFolderRoot = @"C:\LevelCode";
|
|
|
|
// SISTEMA
|
|
public static readonly string appDataFolderSystem = Path.Combine(appDataFolderRoot, "LevelOS");
|
|
public static readonly string appDataFolderConfig = Path.Combine(appDataFolderSystem, "Config");
|
|
|
|
// USUÁRIO
|
|
public static readonly string appDataFolderUser = Path.Combine(appDataFolderSystem, "UserData");
|
|
public static readonly string appDataFolderUserTemp = Path.Combine(appDataFolderUser, "Temp");
|
|
public static readonly string appDataFolderUserCache = Path.Combine(appDataFolderUser, "Cache");
|
|
|
|
// LOGS
|
|
public static readonly string appDataFolderLogs = Path.Combine(appDataFolderSystem, "Logs");
|
|
public static readonly string appDataFolderLogsError = Path.Combine(appDataFolderLogs, "Error");
|
|
public static readonly string appDataFolderLogsAccess = Path.Combine(appDataFolderLogs, "Access");
|
|
|
|
// BACKUP
|
|
public static readonly string appDataFolderBackup = Path.Combine(appDataFolderSystem, "Backup");
|
|
public static readonly string appDataFolderBackupDatabase = Path.Combine(appDataFolderBackup, "Database");
|
|
public static readonly string appDataFolderBackupFiles = Path.Combine(appDataFolderBackup, "Files");
|
|
|
|
// RELATÓRIOS
|
|
public static readonly string appDataFolderReports = Path.Combine(appDataFolderSystem, "Reports");
|
|
public static readonly string appDataFolderReportsPDF = Path.Combine(appDataFolderReports, "PDF");
|
|
public static readonly string appDataFolderReportsTemp = Path.Combine(appDataFolderReports, "Temp");
|
|
|
|
// UPLOADS
|
|
public static readonly string appDataFolderUploads = Path.Combine(appDataFolderSystem, "Uploads");
|
|
public static readonly string appDataFolderUploadsImages = Path.Combine(appDataFolderUploads, "Images");
|
|
public static readonly string appDataFolderUploadsDocuments = Path.Combine(appDataFolderUploads, "Documents");
|
|
|
|
// CONTRATOS / OS
|
|
public static readonly string appDataFolderContracts = Path.Combine(appDataFolderSystem, "Contracts");
|
|
public static readonly string appDataFolderOS = Path.Combine(appDataFolderSystem, "OrdemServico");
|
|
|
|
// EXPORTAÇÕES
|
|
public static readonly string appDataFolderExport = Path.Combine(appDataFolderSystem, "Export");
|
|
public static readonly string appDataFolderImport = Path.Combine(appDataFolderSystem, "Import");
|
|
public static readonly string appDataFolderExportXML = Path.Combine(appDataFolderSystem, "Xml");
|
|
|
|
public static void CriarEstruturaPastas()
|
|
{
|
|
var pastas = new[]
|
|
{
|
|
// ROOT
|
|
appDataFolderRoot,
|
|
|
|
// SISTEMA
|
|
appDataFolderSystem,
|
|
appDataFolderConfig,
|
|
|
|
// USUÁRIO
|
|
appDataFolderUser,
|
|
appDataFolderUserTemp,
|
|
appDataFolderUserCache,
|
|
|
|
// LOGS
|
|
appDataFolderLogs,
|
|
appDataFolderLogsError,
|
|
appDataFolderLogsAccess,
|
|
|
|
// BACKUP
|
|
appDataFolderBackup,
|
|
appDataFolderBackupDatabase,
|
|
appDataFolderBackupFiles,
|
|
|
|
// RELATÓRIOS
|
|
appDataFolderReports,
|
|
appDataFolderReportsPDF,
|
|
appDataFolderReportsTemp,
|
|
|
|
// UPLOADS
|
|
appDataFolderUploads,
|
|
appDataFolderUploadsImages,
|
|
appDataFolderUploadsDocuments,
|
|
|
|
// CONTRATOS / OS
|
|
appDataFolderContracts,
|
|
appDataFolderOS,
|
|
|
|
// EXPORTAÇÃO
|
|
appDataFolderExport,
|
|
appDataFolderImport,
|
|
appDataFolderExportXML
|
|
};
|
|
|
|
foreach (var pasta in pastas)
|
|
{
|
|
if (!Directory.Exists(pasta))
|
|
{
|
|
Directory.CreateDirectory(pasta);
|
|
}
|
|
}
|
|
}//Criando estruturaDePastas
|
|
}
|
|
|
|
}
|