RoadFlow2.1 临时演示

Config.cs 2.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. namespace RoadFlow.Utility
  6. {
  7. public class Config
  8. {
  9. /// <summary>
  10. /// 平台连接字符串
  11. /// </summary>
  12. public static string PlatformConnectionStringMSSQL
  13. {
  14. get
  15. {
  16. return System.Configuration.ConfigurationManager.ConnectionStrings["PlatformConnection"].ConnectionString;
  17. }
  18. }
  19. /// <summary>
  20. /// 平台连接字符串
  21. /// </summary>
  22. public static string PlatformConnectionStringORACLE
  23. {
  24. get
  25. {
  26. return System.Configuration.ConfigurationManager.ConnectionStrings["PlatformConnectionOracle"].ConnectionString;
  27. }
  28. }
  29. /// <summary>
  30. /// 数据库类型
  31. /// </summary>
  32. public static string DataBaseType
  33. {
  34. get
  35. {
  36. string dbType = System.Configuration.ConfigurationManager.AppSettings["DatabaseType"];
  37. return dbType.IsNullOrEmpty() ? "MSSQL" : dbType.ToUpper();
  38. }
  39. }
  40. /// <summary>
  41. /// 系统初始密码
  42. /// </summary>
  43. public static string SystemInitPassword
  44. {
  45. get
  46. {
  47. string pass = System.Configuration.ConfigurationManager.AppSettings["InitPassword"];
  48. return pass.IsNullOrEmpty() ? "111" : pass.Trim();
  49. }
  50. }
  51. /// <summary>
  52. /// 得到当前主题
  53. /// </summary>
  54. public static string Theme
  55. {
  56. get
  57. {
  58. var cookie = System.Web.HttpContext.Current.Request.Cookies["theme_platform"];
  59. return cookie != null && !cookie.Value.IsNullOrEmpty() ? cookie.Value : "Blue";
  60. }
  61. }
  62. /// <summary>
  63. /// 允许上传的文件类型
  64. /// </summary>
  65. public static string UploadFileType
  66. {
  67. get
  68. {
  69. return System.Configuration.ConfigurationManager.AppSettings["UploadFileType"];
  70. }
  71. }
  72. /// <summary>
  73. /// 日期格式
  74. /// </summary>
  75. public static string DateFormat
  76. {
  77. get
  78. {
  79. return "yyyy-MM-dd";
  80. }
  81. }
  82. /// <summary>
  83. /// 日期时间格式
  84. /// </summary>
  85. public static string DateTimeFormat
  86. {
  87. get
  88. {
  89. return "yyyy-MM-dd HH:mm";
  90. }
  91. }
  92. /// <summary>
  93. /// 日期时间格式(带秒)
  94. /// </summary>
  95. public static string DateTimeFormatS
  96. {
  97. get
  98. {
  99. return "yyyy-MM-dd HH:mm:ss";
  100. }
  101. }
  102. }
  103. }