chore: 首次簽入 Thinkyu ASP.NET 專案
- 加入 Visual Studio / ASP.NET .gitignore - 排除建置輸出、IDE 設定、NuGet packages、大型 MSI 安裝檔
This commit is contained in:
@@ -0,0 +1,255 @@
|
||||
using NPOI.SS.Formula.Functions;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Web;
|
||||
using System.Web.UI.WebControls;
|
||||
using WebLib;
|
||||
|
||||
namespace Education
|
||||
{
|
||||
public class PublicVariable : WebLib.PublicVariable
|
||||
{
|
||||
private static Random r = new Random();
|
||||
|
||||
// 常用變數
|
||||
public static string[] 換行分隔 = { "\r\n" };
|
||||
|
||||
#region SESSION 變數名稱
|
||||
public const string CompanyId = "CompanyId";
|
||||
public const string EmployeeId = "EmployeeId";
|
||||
public const string EmployeeName = "EmployeeName";
|
||||
public const string EmployeeFunction = "EmployeeFunction";
|
||||
public const string CurrentPlace = "CurrentPlace";
|
||||
public const string CurrentPlaceName = "CurrentPlaceName";
|
||||
public const string UserGroups = "UserGroups";
|
||||
public const string EventPicturePath = "~/Upload/Event/";
|
||||
public const string BulletinAttachPath = "~/Upload/Attach/";
|
||||
public const string IsManager = "IsManager";
|
||||
public const string IsWorker = "IsWorker";
|
||||
public const string IsBackend = "IsBackend";
|
||||
#endregion
|
||||
|
||||
#region 檔案上傳/圖檔上傳路徑
|
||||
public const string 講師照片路徑 = "~/PhotoUpload/Teacher/";
|
||||
public const string 場地照片路徑 = "~/PhotoUpload/Place/";
|
||||
public const string 課程剪影路徑 = "~/PhotoUpload/Class/";
|
||||
public const string 證照上傳路徑 = "~/DocUpload/Certificate/";
|
||||
public const string 溝通記錄上傳路徑 = "~/DocUpload/Communication/";
|
||||
#endregion
|
||||
|
||||
#region 系統設定變數,由 Global.asax 讀取 web.config 中的設定
|
||||
|
||||
/// <summary>
|
||||
/// 系統名稱
|
||||
/// </summary>
|
||||
public static string SystemName = "Education";
|
||||
|
||||
/// <summary>
|
||||
/// 未登入時開放某些功能
|
||||
/// </summary>
|
||||
public static bool NoLoginFunction = false;
|
||||
|
||||
/// <summary>
|
||||
/// 是否為偵錯模式,會將系統錯誤訊息顯示在網頁上
|
||||
/// </summary>
|
||||
public static bool DEBUG = true;
|
||||
|
||||
/// <summary>
|
||||
/// 管理員群組
|
||||
/// </summary>
|
||||
public static string ManagerGroup = "'TR01'";
|
||||
|
||||
/// <summary>
|
||||
/// 承辦人群組
|
||||
/// </summary>
|
||||
public static string WorkerGroup = "'TR02'";
|
||||
|
||||
/// <summary>
|
||||
/// 總管理處ID
|
||||
/// </summary>
|
||||
public static int 總管理處ID = 2;
|
||||
|
||||
/// <summary>
|
||||
/// 人資部ID
|
||||
/// </summary>
|
||||
public static int 人資部ID = 56;
|
||||
|
||||
/// <summary>
|
||||
/// 財務部ID
|
||||
/// </summary>
|
||||
public static int 財務部ID = 60;
|
||||
|
||||
/// <summary>
|
||||
/// 是否使用 SSL 登入發郵件
|
||||
/// </summary>
|
||||
public static bool SendMailBySSL = false;
|
||||
|
||||
/// <summary>
|
||||
/// 郵件發送主機
|
||||
/// </summary>
|
||||
public static string SendMailHost = "";
|
||||
|
||||
/// <summary>
|
||||
/// 郵件發送通訊埠,不使用 SSL 的通常是 25,使用 SSL 的通常是 465
|
||||
/// </summary>
|
||||
public static int SendMailPort = 25;
|
||||
|
||||
/// <summary>
|
||||
/// 郵件發送帳號
|
||||
/// </summary>
|
||||
public static string SendMailUserName = "";
|
||||
|
||||
/// <summary>
|
||||
/// 郵件發送密碼
|
||||
/// </summary>
|
||||
public static string SendMailPassword = "";
|
||||
|
||||
#region 滿意度調查催填設定
|
||||
public const string SurveyReminderDeadlineDaysKey = "SurveyReminderDeadlineDays";
|
||||
public const string SurveyReminderExcludeEmployeesKey = "SurveyReminderExcludeEmployees";
|
||||
public const string SurveyReminderMinCourseDateKey = "SurveyReminderMinCourseDate";
|
||||
public const string SiteBaseUrlKey = "SiteBaseUrl";
|
||||
|
||||
/// <summary>
|
||||
/// 上課後幾天內要填寫滿意度調查
|
||||
/// </summary>
|
||||
public static int SurveyReminderDeadlineDays = 10;
|
||||
|
||||
/// <summary>
|
||||
/// 排除催填的員工編號(逗號分隔)
|
||||
/// </summary>
|
||||
public static string SurveyReminderExcludeEmployees = "00002,00003";
|
||||
|
||||
/// <summary>
|
||||
/// 只催填此日期之後的課程
|
||||
/// </summary>
|
||||
public static DateTime SurveyReminderMinCourseDate = new DateTime(2026, 7, 1);
|
||||
|
||||
/// <summary>
|
||||
/// 站台基礎 URL(如 http://hostname:port)
|
||||
/// </summary>
|
||||
public static string SiteBaseUrl = "";
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
|
||||
public static string SystemVersion
|
||||
{
|
||||
get
|
||||
{
|
||||
System.Reflection.Assembly assembly = System.Reflection.Assembly.GetExecutingAssembly();
|
||||
FileVersionInfo fvi = FileVersionInfo.GetVersionInfo(assembly.Location);
|
||||
return fvi.FileVersion;
|
||||
}
|
||||
}
|
||||
|
||||
private static DateTime? _領據關帳年月UpdateTime = null;
|
||||
private static string _領據關帳年月 = string.Empty;
|
||||
public static string 領據關帳年月
|
||||
{
|
||||
get
|
||||
{
|
||||
if (string.IsNullOrEmpty(_領據關帳年月) || !_領據關帳年月UpdateTime.HasValue || _領據關帳年月UpdateTime < DateTime.Now.AddMinutes(-10))
|
||||
{
|
||||
using (var conn = DAC.NewConnection())
|
||||
{
|
||||
var daoBWEX = new DAC_BWEX(conn);
|
||||
_領據關帳年月 = daoBWEX.Read領據關帳年月;
|
||||
_領據關帳年月UpdateTime = DateTime.Now;
|
||||
}
|
||||
}
|
||||
return _領據關帳年月;
|
||||
}
|
||||
set
|
||||
{
|
||||
_領據關帳年月 = value;
|
||||
_領據關帳年月UpdateTime = DateTime.Now;
|
||||
using (var conn = DAC.NewConnection())
|
||||
{
|
||||
new DAC_BWEX(conn).WriteSetting("領據關帳年月", 1, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static decimal? _領據執行業務所得課稅門檻 = null;
|
||||
public static decimal 領據執行業務所得課稅門檻
|
||||
{
|
||||
get
|
||||
{
|
||||
if (!_領據執行業務所得課稅門檻.HasValue)
|
||||
{
|
||||
using (var conn = DAC.NewConnection())
|
||||
{
|
||||
_領據執行業務所得課稅門檻 = new DAC_BRTE(conn).領據執行業務所得課稅門檻;
|
||||
}
|
||||
}
|
||||
return _領據執行業務所得課稅門檻.Value;
|
||||
}
|
||||
}
|
||||
|
||||
private static decimal? _領據薪資課稅門檻 = null;
|
||||
public static decimal 領據薪資課稅門檻
|
||||
{
|
||||
get
|
||||
{
|
||||
if (!_領據薪資課稅門檻.HasValue)
|
||||
{
|
||||
using (var conn = DAC.NewConnection())
|
||||
{
|
||||
_領據薪資課稅門檻 = new DAC_BRTE(conn).領據薪資課稅門檻;
|
||||
}
|
||||
}
|
||||
return _領據薪資課稅門檻.Value;
|
||||
}
|
||||
}
|
||||
|
||||
private static decimal? _領據基本工資 = null;
|
||||
public static decimal 領據基本工資
|
||||
{
|
||||
get
|
||||
{
|
||||
if (!_領據基本工資.HasValue)
|
||||
{
|
||||
using (var conn = DAC.NewConnection())
|
||||
{
|
||||
_領據基本工資 = new DAC_BRTE(conn).領據基本工資;
|
||||
}
|
||||
}
|
||||
return _領據基本工資.Value;
|
||||
}
|
||||
}
|
||||
|
||||
private static decimal? _領據執行業務所得稅率 = null;
|
||||
public static decimal 領據執行業務所得稅率
|
||||
{
|
||||
get
|
||||
{
|
||||
if (!_領據執行業務所得稅率.HasValue)
|
||||
{
|
||||
using (var conn = DAC.NewConnection())
|
||||
{
|
||||
_領據執行業務所得稅率 = new DAC_BRTE(conn).領據執行業務所得稅率;
|
||||
}
|
||||
}
|
||||
return _領據執行業務所得稅率.Value;
|
||||
}
|
||||
}
|
||||
|
||||
private static decimal? _領據薪資稅率 = null;
|
||||
public static decimal 領據薪資稅率
|
||||
{
|
||||
get
|
||||
{
|
||||
if (!_領據薪資稅率.HasValue)
|
||||
{
|
||||
using (var conn = DAC.NewConnection())
|
||||
{
|
||||
_領據薪資稅率 = new DAC_BRTE(conn).領據薪資稅率;
|
||||
}
|
||||
}
|
||||
return _領據薪資稅率.Value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user