业务逻辑接口
//name:wujc 2013-06-20
namespace Yc.BLL
{
public class DataDomain : IDataService
{
private readonly IDataService dal = DataAccess.CreateService();
public DataDomain()
{ }
#region 成员方法
/// <summary>
/// 获取表行数
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="strWhere"></param>
/// <returns></returns>
public int GetRowsCount<T>(string strWhere) where T : BaseModel, new() { return dal.GetRowsCount<T>(strWhere); }
/// <summary>
/// 获取表行数
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="sql"></param>
/// <returns></returns>
public int GetRowsCount(string sql) { return dal.GetRowsCount(sql); }
/// <summary>
/// 是否存在该记录
/// </summary>
public bool Exists<T>(string id) where T : BaseModel, new() { return dal.Exists<T>(id); }
/// <summary>
/// 增加一条数据
/// </summary>
public bool Add<T>(T model) where T : BaseModel, new() { return dal.Add<T>(model); }
/// <summary>
/// 增加多条数据
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="modelList"></param>
/// <returns></returns>
public bool Add<T>(List<T> modelList) where T : BaseModel, new() { return dal.Add<T>(modelList); }
/// <summary>
/// 更新一条数据
/// </summary>
public bool Update<T>(T model) where T : BaseModel, new() { return dal.Update<T>(model); }
/// <summary>
/// 更新多条数据
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="model"></param>
/// <returns></returns>
public bool Update<T>(List<T> modelList) where T : BaseModel, new() { return dal.Update<T>(modelList); }
/// <summary>
/// 删除一条数据
/// </summary>
public bool Delete<T>(string id) where T : BaseModel, new() { return dal.Delete<T>(id); }
/// <summary>
/// 删除一条数据
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="id"></param>
/// <returns></returns>
public bool Delete<T>(T model) where T : BaseModel, new() { return dal.Delete<T>(model); }
/// <summary>
/// 删除多条数据
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="model"></param>
/// <returns></returns>
public bool Delete<T>(List<T> modelList) where T : BaseModel, new() { return dal.Delete<T>(modelList); }
/// <summary>
/// 批量删除数据
/// </summary>
/// <param name="idList">逗号分隔</param>
/// <returns></returns>
public bool DeleteList<T>(string idList) where T : BaseModel, new() { return dal.DeleteList<T>(idList); }
/// <summary>
/// 得到一个对象实体
/// </summary>
public T GetModel<T>(string id) where T : BaseModel, new() { return dal.GetModel<T>(id); }
/// <summary>
/// 得到全部对象实体
/// </summary>
public List<T> GetModelList<T>(string strWhere) where T : BaseModel, new() { return dal.GetModelList<T>(strWhere); }
/// <summary>
/// 获得数据列表
/// </summary>
public DataSet GetList<T>(string strWhere) where T : BaseModel, new() { return dal.GetList<T>(strWhere); }
/// <summary>
/// 获得数据表
/// </summary>
public DataTable GetTable<T>(string strWhere) where T : BaseModel, new() { return dal.GetTable<T>(strWhere); }
/// <summary>
/// 根据分页获得数据列表
/// </summary>
public DataSet GetList<T>(string strWhere, string orderby, int startIndex, int endIndex) where T : BaseModel, new() { return dal.GetList<T>(strWhere, orderby, startIndex, endIndex); }
/// <summary>
/// 根据分页获得数据列表
/// </summary>
public DataSet GetListBySql(string sql, string orderby, int startIndex, int endIndex) { return dal.GetListBySql(sql, orderby, startIndex, endIndex); }
/// <summary>
/// 执行SQL语句,返回影响的记录数
/// </summary>
/// <param name="SQLString">SQL语句</param>
/// <returns>影响的记录数</returns>
public int ExecuteSql(string SQLString) { return dal.ExecuteSql(SQLString); }
/// <summary>
/// 执行查询语句,返回DataSet
/// </summary>
/// <param name="SQLString">查询语句</param>
/// <returns>DataSet</returns>
public DataSet Query(string SQLString) { return dal.Query(SQLString); }
/// <summary>
/// 执行多条SQL语句,实现数据库事务。
/// </summary>
/// <param name="SQLStringList">SQL语句的哈希表(key为sql语句,value是该语句的SqlParameter[])</param>
public void ExecuteSqlTran(Hashtable SQLStringList) { dal.ExecuteSqlTran(SQLStringList); }
#endregion 成员方法
  因为这还是个公司框架,还不能开源,不过看完以上接口定义之后,已经知道个大概了吧。