using System; using System.IO; namespace GummingCommon { public static class SystemConst { public const string DefaultRoleScope = "Admin"; public const string Completed = "Completed"; public const string ApplicationLeaveConfirm = "配方流程正在运行,不能关闭!"; public static string SystemFolder { get { return Path.Combine(AppFolder, @"Config\System"); } } public static string DatabasePath { get { return Path.Combine(AppFolder, @"Database\habitusdb.sdf"); } } public static string TempImagePath { get { return Path.Combine(AppFolder, @"Capture"); } } public static string ChartPath { get { return Path.Combine(TempImagePath, "Chart"); } } public static string TestImagePath { get { return Path.Combine(AppFolder, @"Capture\Test.jpg"); } } public static string TestToImagePath { get { return Path.Combine(AppFolder, @"Capture\TestTo.jpg"); } } public static string ImageBackgroundFilePath { get { return Path.Combine(AppFolder, @"Resource\Background.png"); } } public static string ChartBackgroundFilePath { get { return Path.Combine(AppFolder, @"Resource\Chart.png"); } } public static string TableBackgroundFilePath { get { return Path.Combine(AppFolder, @"Resource\TableBack.png"); } } public static string CurrentExcelPath { get { return Path.Combine(AppFolder, @"Excel"); } } public static string CurrentExcelLinkFolder { get { return Path.Combine(AppFolder, @"Excel"); } } public static string AppFolder { get { return Environment.CurrentDirectory; } } public static string ModulesFolder { get { return Path.Combine(AppFolder, @"Modules"); } } public static string ConnectionFile { get { return Path.Combine(SystemFolder, @"Connections.config"); } } public static string SystemFile { get { return Path.Combine(SystemFolder, @"Systems.config"); } } public static string PaintFile { get { return Path.Combine(SystemFolder, @"paint.config"); } } public static string BaseConfigFile { get { return Path.Combine(SystemFolder, @"Systems.ini"); } } public static string TemplateFolder { get { return Path.Combine(AppFolder, @"Config\Templates"); } } public static string ValidationFolder { get { return Path.Combine(AppFolder, @"Config\Validations"); } } public static string ResourceFolder { get { return Path.Combine(AppFolder, @"Resource"); } } public static string ResourcePath(string fn) { string resourcePath = Path.Combine(AppFolder, @"Resource", fn); if (File.Exists(resourcePath)) { return resourcePath; } //Provide default template if not exists. return "/GummingCommon;component/Resource/template.png"; } public static string CapturePath(string fn) { string resourcePath = Path.Combine(AppFolder, @"Capture", fn); if (File.Exists(resourcePath)) { return resourcePath; } //Provide default template if not exists. return "/GummingCommon;component/Resource/template.png"; } public static string TemplateFile(string fn) { return Path.Combine(TemplateFolder, fn); } } }