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.
 
 
 
 
 
 

158 lines
5.5 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_ModuleList
/// </summary>
public partial class OTB_SYS_ModuleList
{
private readonly IOTB_SYS_ModuleList dal = DataAccess.Create<IOTB_SYS_ModuleList>("OTB_SYS_ModuleList");
private readonly string _strUseWebservice = ConfigurationManager.AppSettings["UseWebservice"].ToString();
private readonly string _strWebserviceUrl = ConfigurationManager.AppSettings["WebserviceUrl"].ToString() + "OTB_SYS_ModuleList.asmx";
public OTB_SYS_ModuleList()
{ }
#region Method
/// <summary>
/// 是否存在該記錄
/// </summary>
public bool Exists( string ModuleID)
{
if (string.IsNullOrEmpty(_strUseWebservice) || _strUseWebservice.ToLower().Equals("false"))
{
return dal.Exists( ModuleID);
}
else
{
string[] aryParam = new string[1];
aryParam[0] = ModuleID;
return (bool)OT.BLL.Common.WebServiceHelper.InvokeWebService(_strWebserviceUrl, "WS_Exists", aryParam);
}
}
/// <summary>
/// 增加一條資料
/// </summary>
public bool Add(OT.Model.OTB_SYS_ModuleList 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_ModuleList 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(OT.Model.OTB_SYS_ModuleList model)
{
if (string.IsNullOrEmpty(_strUseWebservice) || _strUseWebservice.ToLower().Equals("false"))
{
return dal.Delete(model);
}
else
{
string[] aryParam = new string[1];
aryParam[0] = Common.ObjSerialize.Serialize(model);
return (bool)OT.BLL.Common.WebServiceHelper.InvokeWebService(_strWebserviceUrl, "WS_Delete", aryParam);
}
}
/// <summary>
/// 得到一個對象實體
/// </summary>
public OT.Model.OTB_SYS_ModuleList GetModel( string ModuleID)
{
if (string.IsNullOrEmpty(_strUseWebservice) || _strUseWebservice.ToLower().Equals("false"))
{
return dal.GetModel( ModuleID);
}
else
{
string[] aryParam = new string[1];
aryParam[0] = ModuleID;
return (OT.Model.OTB_SYS_ModuleList)Common.ObjDeserialize.Deserialize(OT.BLL.Common.WebServiceHelper.InvokeWebService(_strWebserviceUrl, "WS_GetModel", aryParam).ToString(), typeof(OT.Model.OTB_SYS_ModuleList));
}
}
/// <summary>
/// 取得欄位總筆數
/// </summary>
public int GetListCount(string strModuleID, string strModuleName)
{
if (string.IsNullOrEmpty(_strUseWebservice) || _strUseWebservice.ToLower().Equals("false"))
{
return dal.GetListCount(strModuleID, strModuleName);
}
else
{
string[] aryParam = new string[2];
aryParam[0] = strModuleID;
aryParam[1] = strModuleName;
return (int)OT.BLL.Common.WebServiceHelper.InvokeWebService(_strWebserviceUrl, "WS_GetListCount", aryParam);
}
}
/// <summary>
/// 取得資料表
/// </summary>
public DataSet GetList(int StartRecordIndex, int EndRecordIndex, string strModuleID, string strModuleName, string SortExpression)
{
if (string.IsNullOrEmpty(_strUseWebservice) || _strUseWebservice.ToLower().Equals("false"))
{
return dal.GetList(StartRecordIndex, EndRecordIndex, strModuleID, strModuleName, SortExpression);
}
else
{
string[] aryParam = new string[5];
aryParam[0] = StartRecordIndex.ToString();
aryParam[1] = EndRecordIndex.ToString();
aryParam[2] = strModuleID;
aryParam[3] = strModuleName;
aryParam[4] = SortExpression;
return (DataSet)OT.BLL.Common.WebServiceHelper.InvokeWebService(_strWebserviceUrl, "WS_GetList", aryParam);
}
}
#endregion Method
}
}