有一个组列表,它假设从表中返回所有记录,但它不返回任何内容。这里有什么遗漏吗?
用户组dalce:
public UserGroupDs.UserGroupDataTable Sel(int? id, string name, int mode)
{
connection();
UserGroupDs ds = new UserGroupDs();
com = new SqlCommand("spp_userGroup_sel", conn);
com.CommandType = CommandType.StoredProcedure;
com.Parameters.AddWithValue("@id", id == null ? dbNull : id);
com.Parameters.AddWithValue("@name", string.IsNullOrEmpty(name) ? dbNull : name.Trim());
com.Parameters.AddWithValue("@mode", Convert.ToInt32(mode));
FillDataSet(com, ds, new string[] { ds.UserGroup.TableName });
return ds.UserGroup;
}
用户组bc:
public List<UserGroup> ListGroup()
{
List<UserGroup> ListGroup = new List<UserGroup>();
UserGroupDs.UserGroupDataTable dt = Dalc.Sel(null, null, 1);
for (int i = 0; i < dt.Count; i++)
{
UserGroup groups = this.LoadGroup(dt[i]);
ListGroup.Add(groups);
}
return ListGroup;
}
控制器:
[HttpGet]
public List<UserGroup> List()
{
UserGroupBc bc = new UserGroupBc();
return bc.ListGroup();
}