public IList<users> Select(string where, bool bParentTable, bool bChildrenTable)
{
IList<users> list = new List<users>();
SqlParameter[] param ={
new SqlParameter("@where",SqlDbType.VarChar,8000)
};
param[0].Value = where;
string sqlCommand = "usersSelectByParams";
using (SqlDataReader dr = SqlHelper.ExecuteReader(Conn.SqlConn,CommandType.StoredProcedure, sqlCommand, param))
{
while (dr.Read())
{
list.Add(this.Select(dr));
}
}
foreach (users obj in list)
{
this.Select(obj, bParentTable, bChildrenTable);
}
return list;
}
public IList<users> Select(string where)
{
return this.Select(where, false, false);
}
中的 list.Add(this.Select(dr)); 什么意思 ??
还有这个
foreach (users obj in list)
{
this.Select(obj, bParentTable, bChildrenTable);
}
return list;
public IList<users> Select(string where, bool bParentTable, bool bChildrenTable)
{
IList<users> list = new List<users>();
SqlParameter[] param ={
new SqlParameter("@where",SqlDbType.VarChar,8000)
};
param[0].Value = where;
string sqlCommand = "usersSelectByParams";
using (SqlDataReader dr = SqlHelper.ExecuteReader(Conn.SqlConn, CommandType.StoredProcedure, sqlCommand, param))
{
while (dr.Read())
{
list.Add(this.Select(dr));//应该还有个Select方法吧,参数类型为dr的。
}
}
foreach (users obj in list)
{
this.Select(obj, bParentTable, bChildrenTable);//倒底有几个Select方法....
}
return list;
}
public IList<users> Select(string where)
{
return this.Select(where, false, false);//调用上面的Select方法
}
你这个应该是方法的类有多个Select的重载方法,多贴些代码看看。
Select应该是有重载方法吧,
Select(SqlDataReader dr);
Select(Users obj, bool bParentTable,bool bChildrenTable)