在看别人的代码感觉很晕啊...我之前是写c++的,看不懂什么意思,高手来解释下为什么这么写,很郁闷的说.... public class ReBLL
{
private ReDAL dal; public ReBLL()
{
dal = new ReDAL();
} public void Add(Re re)
{
dal.Add(re);
} public void Update(Re re)
{
dal.Update(re);
} public void Delete(string id)
{
dal.Delete(id);
} public Re GetById(string id)
{
return dal.GetById(id);
} public IList GetPage(int pageIndex, int pageSize, string where, string orderBy)
{
return dal.GetPage(pageIndex, pageSize, where, orderBy);
} public string GetPageSet(int pageIndex, int pageSize, string where, string urlFormat, int mode)
{
return dal.GetPageSet(pageIndex, pageSize, where, urlFormat, mode);
} public IList GetAll(string where, string orderBy)
{
return dal.GetAll(where, orderBy);
} public int ExecuteNonQuery(string sqlString)
{
return dal.ExecuteNonQuery(sqlString);
}
}
{
private ReDAL dal; public ReBLL()
{
dal = new ReDAL();
} public void Add(Re re)
{
dal.Add(re);
} public void Update(Re re)
{
dal.Update(re);
} public void Delete(string id)
{
dal.Delete(id);
} public Re GetById(string id)
{
return dal.GetById(id);
} public IList GetPage(int pageIndex, int pageSize, string where, string orderBy)
{
return dal.GetPage(pageIndex, pageSize, where, orderBy);
} public string GetPageSet(int pageIndex, int pageSize, string where, string urlFormat, int mode)
{
return dal.GetPageSet(pageIndex, pageSize, where, urlFormat, mode);
} public IList GetAll(string where, string orderBy)
{
return dal.GetAll(where, orderBy);
} public int ExecuteNonQuery(string sqlString)
{
return dal.ExecuteNonQuery(sqlString);
}
}
解决方案 »
- sql连接字符串 意思
- treeview展开层次控制
- 如何引用动态生成的CheckBoxList?(思归等达人求救,抓狂几天了)
- ***********************请问怎么将c++的char数组传递给c#啊*********************
- 谁能给个网站的SE0优化的全过程
- 如何让WebForm里的 TEXTBOX 控件里的内容居右显示??(注:不是HTML里的TEXBOX) -------- 在线等...
- smtp服务里SENDusing配置无效是什么意思
- 请教一个字符型主键插入问题!!
- 生成部署文件出错的问题。高手来看看。
- 网页的问题
- finally里面的流关闭出错,大家帮忙,谢
- 急求助往sqlserver库中以二进制格式存照片已经存进去了,可是库中其他的字段并非是二进制格式的如何将它们一并存入库中
sf .那就给你说一下.
先看ReDAL数据层
再看ReBLL商业逻辑 就明白多了
public class ReBLL
{
private ReDAL dal; public ReBLL()
{
dal = new ReDAL();
} public void Add(Re re) //增 没猜错的话.这儿传的是一个DTO 类型
{
dal.Add(re);
} public void Update(Re re) //改
{
dal.Update(re);
} public void Delete(string id) //删 {
dal.Delete(id);
} public Re GetById(string id) //查
{
return dal.GetById(id);
}
//以下的都是构造Sql 语句,注意参数就行了
public IList GetPage(int pageIndex, int pageSize, string where, string orderBy) //取当前页数
{
return dal.GetPage(pageIndex, pageSize, where, orderBy);
} public string GetPageSet(int pageIndex, int pageSize, string where, string urlFormat, int mode) //设置第几页
{
return dal.GetPageSet(pageIndex, pageSize, where, urlFormat, mode);
} public IList GetAll(string where, string orderBy) //取的全部数据,注意参数
{
return dal.GetAll(where, orderBy);
} public int ExecuteNonQuery(string sqlString) //执行,并返回影响的行数
{
return dal.ExecuteNonQuery(sqlString);
}
}
那儿看不明白?