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.
 
 
 
 
 
 

171 lines
6.0 KiB

using System;
using System.Data;
using System.Configuration;
using System.Collections.Generic;
using OT.Model;
using OT.DALFactory;
using OT.IDAL;
namespace OT.BLL
{
/// <summary>
/// OTB_SYS_Authorize
/// </summary>
public partial class OTB_SYS_Authorize
{
private readonly IOTB_SYS_Authorize dal = DataAccess.Create<IOTB_SYS_Authorize>("OTB_SYS_Authorize");
private readonly string _strUseWebservice = ConfigurationManager.AppSettings["UseWebservice"].ToString();
private readonly string _strWebserviceUrl = ConfigurationManager.AppSettings["WebserviceUrl"].ToString() + "OTB_SYS_Authorize.asmx";
public OTB_SYS_Authorize()
{ }
#region Method
/// <summary>
/// 是否存在該記錄
/// </summary>
public bool Exists( string RuleID, string ProgramID)
{
if (string.IsNullOrEmpty(_strUseWebservice) || _strUseWebservice.ToLower().Equals("false"))
{
return dal.Exists( RuleID, ProgramID);
}
else
{
string[] aryParam = new string[2];
aryParam[0] = RuleID;
aryParam[1] = ProgramID;
return (bool)OT.BLL.Common.WebServiceHelper.InvokeWebService(_strWebserviceUrl, "WS_Exists", aryParam);
}
}
/// <summary>
/// 增加一條資料
/// </summary>
public bool Add(OT.Model.OTB_SYS_Authorize model)
{
if (string.IsNullOrEmpty(_strUseWebservice) || _strUseWebservice.ToLower().Equals("false"))
{
return dal.Add(model);
}
else
{
string[] aryParam = new string[1];
aryParam[0] = Common.ObjSerialize.Serialize(model);
return (bool)OT.BLL.Common.WebServiceHelper.InvokeWebService(_strWebserviceUrl, "WS_Add", aryParam);
}
}
/// <summary>
/// 更新一條資料
/// </summary>
public bool Update(OT.Model.OTB_SYS_Authorize model)
{
if (string.IsNullOrEmpty(_strUseWebservice) || _strUseWebservice.ToLower().Equals("false"))
{
return dal.Update(model);
}
else
{
string[] aryParam = new string[1];
aryParam[0] = Common.ObjSerialize.Serialize(model);
return (bool)OT.BLL.Common.WebServiceHelper.InvokeWebService(_strWebserviceUrl, "WS_Update", aryParam);
}
}
/// <summary>
/// 刪除一條資料
/// </summary>
public bool Delete( string RuleID, string ProgramID)
{
if (string.IsNullOrEmpty(_strUseWebservice) || _strUseWebservice.ToLower().Equals("false"))
{
return dal.Delete( RuleID, ProgramID);
}
else
{
string[] aryParam = new string[2];
aryParam[0] = RuleID;
aryParam[1] = ProgramID;
return (bool)OT.BLL.Common.WebServiceHelper.InvokeWebService(_strWebserviceUrl, "WS_Delete", aryParam);
}
}
/// <summary>
/// 得到一個對象實體
/// </summary>
public OT.Model.OTB_SYS_Authorize GetModel( string RuleID, string ProgramID)
{
if (string.IsNullOrEmpty(_strUseWebservice) || _strUseWebservice.ToLower().Equals("false"))
{
return dal.GetModel( RuleID, ProgramID);
}
else
{
string[] aryParam = new string[2];
aryParam[0] = RuleID;
aryParam[1] = ProgramID;
return (OT.Model.OTB_SYS_Authorize)Common.ObjDeserialize.Deserialize(OT.BLL.Common.WebServiceHelper.InvokeWebService(_strWebserviceUrl, "WS_GetModel", aryParam).ToString(), typeof(OT.Model.OTB_SYS_Authorize));
}
}
/// <summary>
/// 儲存權限表
/// </summary>
public bool Save(OT.Model.OTB_SYS_Authorize model)
{
if (string.IsNullOrEmpty(_strUseWebservice) || _strUseWebservice.ToLower().Equals("false"))
{
return dal.Save(model);
}
else
{
string[] aryParam = new string[1];
aryParam[0] = Common.ObjSerialize.Serialize(model);
return (bool)OT.BLL.Common.WebServiceHelper.InvokeWebService(_strWebserviceUrl, "WS_Save", aryParam);
}
}
/// <summary>
/// 複製權限
/// </summary>
public bool GetDirectRoleByRoleSource(string strRoleSource, string strRoleDirect, string CreateUser)
{
if (string.IsNullOrEmpty(_strUseWebservice) || _strUseWebservice.ToLower().Equals("false"))
{
return dal.GetDirectRoleByRoleSource(strRoleSource, strRoleDirect, CreateUser);
}
else
{
string[] aryParam = new string[3];
aryParam[0] = strRoleSource;
aryParam[1] = strRoleDirect;
aryParam[2] = CreateUser;
return (bool)OT.BLL.Common.WebServiceHelper.InvokeWebService(_strWebserviceUrl, "WS_GetDirectRoleByRoleSource", aryParam);
}
}
/// <summary>
/// 根據登入者判斷權限大小
/// </summary>
public DataSet GetListByRuleID(string strMemberID)
{
if (string.IsNullOrEmpty(_strUseWebservice) || _strUseWebservice.ToLower().Equals("false"))
{
return dal.GetListByRuleID(strMemberID);
}
else
{
string[] aryParam = new string[1];
aryParam[0] = strMemberID;
return (DataSet)OT.BLL.Common.WebServiceHelper.InvokeWebService(_strWebserviceUrl, "WS_GetListByRuleID", aryParam);
}
}
#endregion Method
}
}