#region
|
|
using System.Data;
|
using CSFrameworkV5.Common;
|
using CSFrameworkV5.Core;
|
using CSFrameworkV5.DataAccess;
|
using CSFrameworkV5.Interfaces.Bridge;
|
using CSFrameworkV5.Models;
|
using CSFrameworkV5.WebRef;
|
|
#endregion
|
|
namespace CSFrameworkV5.Business
|
{
|
public class bllDocNoRule : bllBaseDataDict
|
{
|
private IBridge_DocNoRule _Bridge;
|
|
public bllDocNoRule()
|
{
|
_KeyFieldName = sys_DocNoRule.__KeyName; //主键字段
|
_SummaryTableName = sys_DocNoRule.__TableName; //表名
|
_DataDictBridge =
|
BridgeFactory.CreateDataDictBridge(typeof(sys_DocNoRule));
|
_Bridge = CreateBridge();
|
}
|
|
public bool CheckNoExistsEx(string DBID, string docCode)
|
{
|
return _Bridge.CheckNoExistsEx(DBID, docCode);
|
}
|
|
private IBridge_DocNoRule CreateBridge()
|
{
|
if (BridgeFactory.IsADODirect) //直连模式
|
return new dal_DocNoRule(Loginer.CurrentUser);
|
|
if (BridgeFactory.IsWCFBridge) return new WCF_DocNoRule();
|
|
if (BridgeFactory.BridgeType != BridgeType.ADODirect)
|
throw new CustomException("请使用ADO-Direct模式测试!");
|
|
return null;
|
}
|
|
public void CreateDataBinder(string DBID, string keyValue)
|
{
|
_DataBinder = GetDataByKey(DBID, keyValue);
|
}
|
|
public bool Delete(string DBID, string keyValue)
|
{
|
return _Bridge.Delete(DBID, keyValue);
|
}
|
|
public DataTable GetDataByKey(string DBID, string keyValue)
|
{
|
return _Bridge.GetDataByKey(DBID, keyValue);
|
}
|
|
public DataTable GetSummaryData(string DBID, bool resetCurrent)
|
{
|
var data = _Bridge.GetData(DBID);
|
SetDefault(data);
|
if (resetCurrent) _SummaryTable = data;
|
|
return data;
|
}
|
|
public bool UpdateToDB(string DBID)
|
{
|
_DataBinder.Rows[0].EndEdit();
|
UpdateDetailCommonValue(_DataBinder);
|
|
return _Bridge.UpdateToDB(DBID, _DataBinder);
|
}
|
}
|
}
|