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.
 
 
 
 
 
 

286 lines
11 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_Members
/// </summary>
public partial class OTB_SYS_Members
{
private readonly IOTB_SYS_Members dal = DataAccess.Create<IOTB_SYS_Members>("OTB_SYS_Members");
private readonly string _strUseWebservice = ConfigurationManager.AppSettings["UseWebservice"].ToString();
private readonly string _strWebserviceUrl = ConfigurationManager.AppSettings["WebserviceUrl"].ToString() + "OTB_SYS_Members.asmx";
public OTB_SYS_Members()
{ }
#region Method
/// <summary>
/// 是否存在該記錄
/// </summary>
public bool Exists(string MemberID)
{
if (string.IsNullOrEmpty(_strUseWebservice) || _strUseWebservice.ToLower().Equals("false"))
{
return dal.Exists(MemberID);
}
else
{
string[] aryParam = new string[1];
aryParam[0] = MemberID;
return (bool)OT.BLL.Common.WebServiceHelper.InvokeWebService(_strWebserviceUrl, "WS_Exists", aryParam);
}
}
/// <summary>
/// 是否存在該記錄
/// </summary>
public bool ExistsColor(string MemberID, string Calcolor)
{
if (string.IsNullOrEmpty(_strUseWebservice) || _strUseWebservice.ToLower().Equals("false"))
{
return dal.ExistsColor(MemberID, Calcolor);
}
else
{
string[] aryParam = new string[2];
aryParam[0] = MemberID;
aryParam[1] = Calcolor;
return (bool)OT.BLL.Common.WebServiceHelper.InvokeWebService(_strWebserviceUrl, "WS_Exists", aryParam);
}
}
/// <summary>
/// 增加一條資料
/// </summary>
public bool Add(OT.Model.OTB_SYS_Members 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_Members 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 UpdatePop(string MemberID, string MemberName, string Password, string CalColor, string ModifyUser, string SysShowMode)
{
if (string.IsNullOrEmpty(_strUseWebservice) || _strUseWebservice.ToLower().Equals("false"))
{
return dal.UpdatePop(MemberID, MemberName, Password, CalColor, ModifyUser, SysShowMode);
}
else
{
string[] aryParam = new string[6];
aryParam[0] = MemberID;
aryParam[1] = MemberName;
aryParam[2] = Password;
aryParam[3] = CalColor;
aryParam[4] = ModifyUser;
aryParam[5] = SysShowMode;
return (bool)OT.BLL.Common.WebServiceHelper.InvokeWebService(_strWebserviceUrl, "WS_UpdatePop", aryParam);
}
}
/// <summary>
/// 刪除一條資料
/// </summary>
public int Delete(string MemberID)
{
if (string.IsNullOrEmpty(_strUseWebservice) || _strUseWebservice.ToLower().Equals("false"))
{
return dal.Delete(MemberID);
}
else
{
string[] aryParam = new string[1];
aryParam[0] = MemberID;
return (int)OT.BLL.Common.WebServiceHelper.InvokeWebService(_strWebserviceUrl, "WS_Delete", aryParam);
}
}
/// <summary>
/// 刪除一條資料
/// </summary>
public bool DeleteList(string MemberIDlist)
{
if (string.IsNullOrEmpty(_strUseWebservice) || _strUseWebservice.ToLower().Equals("false"))
{
return dal.DeleteList(MemberIDlist);
}
else
{
string[] aryParam = new string[1];
aryParam[0] = MemberIDlist;
return (bool)OT.BLL.Common.WebServiceHelper.InvokeWebService(_strWebserviceUrl, "WS_DeleteList", aryParam);
}
}
/// <summary>
/// 得到一個對象實體
/// </summary>
public OT.Model.OTB_SYS_Members GetModel(string MemberID)
{
if (string.IsNullOrEmpty(_strUseWebservice) || _strUseWebservice.ToLower().Equals("false"))
{
return dal.GetModel(MemberID);
}
else
{
string[] aryParam = new string[1];
aryParam[0] = MemberID;
return (OT.Model.OTB_SYS_Members)Common.ObjDeserialize.Deserialize(OT.BLL.Common.WebServiceHelper.InvokeWebService(_strWebserviceUrl, "WS_GetModel", aryParam).ToString(), typeof(OT.Model.OTB_SYS_Members));
}
}
/// <summary>
/// 獲得資料列表
/// </summary>
public DataSet GetList(int StartRecordIndex, int EndRecordIndex, string strMemberID, string strMemberNAME, string Effective, string SortExpression)
{
if (string.IsNullOrEmpty(_strUseWebservice) || _strUseWebservice.ToLower().Equals("false"))
{
return dal.GetList(StartRecordIndex, EndRecordIndex, strMemberID, strMemberNAME, Effective, SortExpression);
}
else
{
string[] aryParam = new string[7];
aryParam[0] = StartRecordIndex.ToString();
aryParam[1] = EndRecordIndex.ToString();
aryParam[2] = strMemberID;
aryParam[3] = strMemberNAME;
aryParam[4] = SortExpression;
return (DataSet)OT.BLL.Common.WebServiceHelper.InvokeWebService(_strWebserviceUrl, "WS_GetList", aryParam);
}
}
/// <summary>
/// 獲得資料總筆數
/// </summary>
public int GetListCount(string strMemberID, string strMemberNAME, string Effective)
{
if (string.IsNullOrEmpty(_strUseWebservice) || _strUseWebservice.ToLower().Equals("false"))
{
return dal.GetListCount(strMemberID, strMemberNAME, Effective);
}
else
{
string[] aryParam = new string[2];
aryParam[0] = strMemberID;
aryParam[1] = strMemberNAME;
return (int)OT.BLL.Common.WebServiceHelper.InvokeWebService(_strWebserviceUrl, "WS_GetListCount", aryParam);
}
}
/// <summary>
/// 獲得資料列表
/// </summary>
public DataSet GetListByID(int StartRecordIndex, int EndRecordIndex, string MemberID, string MemberName, string DepartmentID, string JobtitleName, string Effective, string SortExpression)
{
if (string.IsNullOrEmpty(_strUseWebservice) || _strUseWebservice.ToLower().Equals("false"))
{
return dal.GetList(StartRecordIndex, EndRecordIndex, MemberID, MemberName, DepartmentID, JobtitleName, Effective, SortExpression);
}
else
{
string[] aryParam = new string[8];
aryParam[0] = StartRecordIndex.ToString();
aryParam[1] = EndRecordIndex.ToString();
aryParam[2] = MemberID.ToString();
aryParam[3] = MemberName.ToString();
aryParam[4] = DepartmentID;
aryParam[5] = JobtitleName;
aryParam[6] = Effective;
aryParam[7] = SortExpression;
return (DataSet)OT.BLL.Common.WebServiceHelper.InvokeWebService(_strWebserviceUrl, "WS_GetList", aryParam);
}
}
/// <summary>
/// 獲得資料總筆數
/// </summary>
public int GetListCount(string MemberID, string MemberName, string DepartmentID, string JobTitle, string Effective)
{
if (string.IsNullOrEmpty(_strUseWebservice) || _strUseWebservice.ToLower().Equals("false"))
{
return dal.GetListCount(MemberID, MemberName, DepartmentID, JobTitle, Effective);
}
else
{
string[] aryParam = new string[5];
aryParam[0] = MemberID.ToString();
aryParam[1] = MemberName.ToString();
aryParam[2] = DepartmentID;
aryParam[3] = JobTitle;
aryParam[4] = Effective;
return (int)OT.BLL.Common.WebServiceHelper.InvokeWebService(_strWebserviceUrl, "WS_GetListCount", aryParam);
}
}
public DataSet SearchMember(int StartRecordIndex, int EndRecordIndex, string strSearch, string SortExpression)
{
if (string.IsNullOrEmpty(_strUseWebservice) || _strUseWebservice.ToLower().Equals("false"))
{
return dal.SearchMember(StartRecordIndex, EndRecordIndex, strSearch, SortExpression);
}
else
{
string[] aryParam = new string[4];
aryParam[0] = StartRecordIndex.ToString();
aryParam[1] = EndRecordIndex.ToString();
aryParam[2] = '%' + strSearch.ToString() + '%';
aryParam[3] = SortExpression;
return (DataSet)OT.BLL.Common.WebServiceHelper.InvokeWebService(_strWebserviceUrl, "WS_GetList", aryParam);
}
}
/// <summary>
/// 獲得資料總筆數
/// </summary>
public int SearchMemberCount(string MemberID, string MemberName, string RuleID, string RuleName)
{
if (string.IsNullOrEmpty(_strUseWebservice) || _strUseWebservice.ToLower().Equals("false"))
{
return dal.SearchMemberCount(MemberID, MemberName, RuleID, RuleName);
}
else
{
string[] aryParam = new string[4];
aryParam[0] = '%' + MemberID.ToString() + '%';
aryParam[1] = '%' + MemberName.ToString() + '%';
aryParam[2] = '%' + RuleID.ToString() + '%';
aryParam[3] = '%' + RuleName.ToString() + '%';
return (int)OT.BLL.Common.WebServiceHelper.InvokeWebService(_strWebserviceUrl, "WS_GetListCount", aryParam);
}
}
#endregion Method
}
}