You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
157 lines
4.6 KiB
157 lines
4.6 KiB
///-----------------------------------------------------------------------
|
|
/// <copyright file="SystemSettingHelper.cs" company="Origtek">
|
|
/// 程式代號: SystemSettingHelper
|
|
/// 程式名稱: SystemSettingHelper
|
|
/// 程式說明:
|
|
/// 起始作者: Hercules
|
|
/// 起始日期: 2017/05/11 17:15:06
|
|
/// 最新修改人: Hercules
|
|
/// 最新修日期: 2017/05/18 17:45:54
|
|
/// </copyright>
|
|
///-----------------------------------------------------------------------
|
|
#region 程式異動記錄
|
|
/// xx.YYYY/MM/DD VER AUTHOR COMMENTS(說明修改的內容)
|
|
/// 01.2017/05/11 1.000 Hercules 加入Folder使用(RV.4250)
|
|
/// 02.2017/05/16 1.001 Hercules 更新Log4net(RV.4317)
|
|
/// 03.2017/05/18 1.002 Hercules 補程式Header註解(RV.4375)
|
|
#endregion
|
|
|
|
namespace CounsellorBL.Helper
|
|
{
|
|
|
|
using MonumentDefine;
|
|
using OT.COM.ArsenalDB;
|
|
using SoldierData.EnterprizeV4;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using static CounsellorBL.Common.EntityBaseExtension;
|
|
|
|
/// <summary>
|
|
/// 類別名稱:SystemSettingHelper
|
|
/// 類別說明:
|
|
/// 起始作者:
|
|
/// 起始日期:
|
|
/// 最新修改人:
|
|
/// 最新修改日:
|
|
/// </summary>
|
|
public static class SystemSettingHelper
|
|
{
|
|
/// <summary>
|
|
/// 類別成員、類別屬性說明:EPath
|
|
/// </summary>
|
|
public enum EPath
|
|
{
|
|
EP_FILE = 0,
|
|
EP_FILETMP = 1
|
|
}
|
|
|
|
public static string GetSettings(out List<tb_sys_system_setting> i_sResult)
|
|
{
|
|
string sMsg = null;
|
|
List<tb_sys_system_setting> oRes = null;
|
|
|
|
do
|
|
{
|
|
|
|
|
|
tb_sys_system_setting oDisplay = new tb_sys_system_setting();
|
|
oDisplay.SetFullDirtyEx(EColumnFilter.ES_NO_SYSTEMCOLUMN);
|
|
|
|
|
|
Command c = Command.SetupSelectCmd(oDisplay);
|
|
ArsenalInterface ai = ArsenalDBMgr.GetInst(c, null);
|
|
List<tb_sys_system_setting> lo = ai.RunQueryList<tb_sys_system_setting>(c);
|
|
|
|
if (lo != null && lo.Any())
|
|
{
|
|
oRes = lo;
|
|
}
|
|
sMsg = c.LastErrorMsg;
|
|
|
|
}
|
|
while (false);
|
|
i_sResult = oRes;
|
|
|
|
return sMsg;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 函式名稱:GetSetting
|
|
/// 函式說明:
|
|
/// 起始作者:
|
|
/// 起始日期:
|
|
/// 最新修改人:
|
|
/// 最新修改日:
|
|
/// </summary>
|
|
/// <param name="i_sID"></param>
|
|
/// <param name="i_sResult">
|
|
/// 參數說明
|
|
/// </param>
|
|
/// <returns>
|
|
/// 回傳
|
|
/// </returns>
|
|
public static string GetSetting(string i_sID, out tb_sys_system_setting i_sResult)
|
|
{
|
|
string sMsg = null;
|
|
tb_sys_system_setting oRes = null;
|
|
|
|
do
|
|
{
|
|
if (i_sID == null)
|
|
{
|
|
break;
|
|
}
|
|
|
|
tb_sys_system_setting oDisplay = new tb_sys_system_setting();
|
|
oDisplay.SetFullDirtyEx(EColumnFilter.ES_NO_SYSTEMCOLUMN);
|
|
tb_sys_system_setting oCond = new tb_sys_system_setting() { name = i_sID };
|
|
|
|
Command c = Command.SetupSelectCmd(typeof(tb_sys_system_setting), oDisplay, oCond);
|
|
ArsenalInterface ai = ArsenalDBMgr.GetInst(c, null);
|
|
List<tb_sys_system_setting> lo = ai.RunQueryList<tb_sys_system_setting>(c);
|
|
|
|
if (lo != null && lo.Any())
|
|
{
|
|
oRes = lo[0];
|
|
}
|
|
sMsg = c.LastErrorMsg;
|
|
|
|
}
|
|
while (false);
|
|
i_sResult = oRes;
|
|
|
|
return sMsg;
|
|
}
|
|
/// <summary>
|
|
/// 函式名稱:FileFolder
|
|
/// 函式說明:
|
|
/// 起始作者:
|
|
/// 起始日期:
|
|
/// 最新修改人:
|
|
/// 最新修改日:
|
|
/// </summary>
|
|
/// <param name="i_epType">
|
|
/// 參數說明
|
|
/// </param>
|
|
/// <returns>
|
|
/// 回傳
|
|
/// </returns>
|
|
public static string FileFolder(EPath i_epType)
|
|
{
|
|
string sRes = null;
|
|
string sID = i_epType switch
|
|
{
|
|
EPath.EP_FILE => BLWording.PATH_UPLOAD,
|
|
_ => BLWording.PATH_TEMPUPLOAD,
|
|
};
|
|
if (GetSetting(sID, out tb_sys_system_setting oRes) == null)
|
|
{
|
|
sRes = oRes.key_value;
|
|
}
|
|
|
|
|
|
|
|
return sRes;
|
|
}
|
|
}
|
|
}
|