chore: 首次簽入 Thinkyu ASP.NET 專案
- 加入 Visual Studio / ASP.NET .gitignore - 排除建置輸出、IDE 設定、NuGet packages、大型 MSI 安裝檔
This commit is contained in:
@@ -0,0 +1,119 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Web;
|
||||
using WebLib;
|
||||
|
||||
namespace Education
|
||||
{
|
||||
///<summary>
|
||||
/// 付款設定.扣繳類別 下拉清單資料類別
|
||||
///</summary>
|
||||
public class 扣繳類別
|
||||
{
|
||||
public const string 扣繳類別_50薪資 = "50";
|
||||
public const string 扣繳類別_9A55執行業務所得_心理師 = "9A55";
|
||||
public const string 扣繳類別_9A70執行業務所得_表演人 = "9A70";
|
||||
public const string 扣繳類別_9A90執行業務所得_其他 = "9A90";
|
||||
public const string 扣繳類別_9A92執行業務所得_程式設計師 = "9A92";
|
||||
public const string 扣繳類別_9B98執行業務所得_稿費 = "9B98A";
|
||||
public const string 扣繳類別_9B98執行業務所得_演講之鐘點費 = "9B98B";
|
||||
|
||||
///<summary>
|
||||
/// 付款設定.扣繳類別 輸入用下拉清單資料
|
||||
///</summary>
|
||||
public static NameValueList InputSelectList = new NameValueList()
|
||||
{
|
||||
{ "(請選擇)", "" },
|
||||
{ "50 薪資", 扣繳類別_50薪資 },
|
||||
{ "9A-55 執行業務所得-心理師", 扣繳類別_9A55執行業務所得_心理師 },
|
||||
{ "9A-70 執行業務所得-表演人", 扣繳類別_9A70執行業務所得_表演人 },
|
||||
{ "9A-90 執行業務所得-其他", 扣繳類別_9A90執行業務所得_其他 },
|
||||
{ "9A-92 執行業務所得-程式設計師", 扣繳類別_9A92執行業務所得_程式設計師 },
|
||||
{ "9B-98 執行業務所得-稿費", 扣繳類別_9B98執行業務所得_稿費 },
|
||||
{ "9B-98 執行業務所得-演講之鐘點費", 扣繳類別_9B98執行業務所得_演講之鐘點費 }
|
||||
};
|
||||
|
||||
///<summary>
|
||||
/// 付款設定.扣繳類別 查詢用下拉清單資料
|
||||
///</summary>
|
||||
public static NameValueList SearchSelectList = new NameValueList()
|
||||
{
|
||||
{ "(全部)", "" },
|
||||
{ "50 薪資", 扣繳類別_50薪資 },
|
||||
{ "9A-55 執行業務所得-心理師", 扣繳類別_9A55執行業務所得_心理師 },
|
||||
{ "9A-70 執行業務所得-表演人", 扣繳類別_9A70執行業務所得_表演人 },
|
||||
{ "9A-90 執行業務所得-其他", 扣繳類別_9A90執行業務所得_其他 },
|
||||
{ "9A-92 執行業務所得-程式設計師", 扣繳類別_9A92執行業務所得_程式設計師 },
|
||||
{ "9B-98 執行業務所得-稿費", 扣繳類別_9B98執行業務所得_稿費 },
|
||||
{ "9B-98 執行業務所得-演講之鐘點費", 扣繳類別_9B98執行業務所得_演講之鐘點費 }
|
||||
};
|
||||
|
||||
public static NameValueList ActialValueList = new NameValueList()
|
||||
{
|
||||
{ "50", 扣繳類別_50薪資 },
|
||||
{ "9A-55", 扣繳類別_9A55執行業務所得_心理師 },
|
||||
{ "9A-70", 扣繳類別_9A70執行業務所得_表演人 },
|
||||
{ "9A-90", 扣繳類別_9A90執行業務所得_其他 },
|
||||
{ "9A-92", 扣繳類別_9A92執行業務所得_程式設計師 },
|
||||
{ "9B-98", 扣繳類別_9B98執行業務所得_稿費 },
|
||||
{ "9B-98", 扣繳類別_9B98執行業務所得_演講之鐘點費 }
|
||||
};
|
||||
|
||||
///<summary>
|
||||
/// 付款設定.扣繳類別 由值取得名稱
|
||||
///</summary>
|
||||
public static string GetName(object value)
|
||||
{
|
||||
return InputSelectList.GetName(value);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 取得真實世界的值
|
||||
/// </summary>
|
||||
/// <param name="value"></param>
|
||||
/// <returns></returns>
|
||||
public static string GetActuralValue(object value)
|
||||
{
|
||||
return ActialValueList.GetName(value);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 試圖對應出扣繳類別的欄位值
|
||||
/// </summary>
|
||||
/// <param name="v"></param>
|
||||
/// <returns></returns>
|
||||
internal static string MapValue(string v)
|
||||
{
|
||||
if (string.IsNullOrEmpty(v))
|
||||
return string.Empty;
|
||||
|
||||
var upper = v.ToUpper();
|
||||
// 取第一個由英文字母與數字(可含連字號)組成的區段,再移除連字號
|
||||
var m = Regex.Match(upper, @"[A-Z0-9]+(?:-[A-Z0-9]+)*");
|
||||
if (!m.Success)
|
||||
return string.Empty;
|
||||
|
||||
var va1 = m.Value.Replace("-", "");
|
||||
|
||||
if (va1 == 扣繳類別_50薪資
|
||||
|| va1 == 扣繳類別_9A55執行業務所得_心理師
|
||||
|| va1 == 扣繳類別_9A70執行業務所得_表演人
|
||||
|| va1 == 扣繳類別_9A90執行業務所得_其他
|
||||
|| va1 == 扣繳類別_9A92執行業務所得_程式設計師)
|
||||
{
|
||||
return va1;
|
||||
}
|
||||
else if (va1.StartsWith("9B98"))
|
||||
{
|
||||
// 從第一個符合區段之後的文字中尋找關鍵字
|
||||
var remainder = upper.Substring(m.Index + m.Length);
|
||||
if (remainder.Contains("稿")) { return 扣繳類別_9B98執行業務所得_稿費; }
|
||||
else if (remainder.Contains("演講") || remainder.Contains("鐘點")) { return 扣繳類別_9B98執行業務所得_演講之鐘點費; }
|
||||
else return string.Empty;
|
||||
}
|
||||
return string.Empty;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user