List<>数据存贮的问题。
UserGroup.cs 中有一方法:
public List <UserInfo> GetAllUserList()
{
DataSet dsGetUserList;
dsGetUserList = UserDBAgent.GetAllUserList();
int rowCount = dsGetUserList.Tables[0].Rows.Count;
if (rowCount > 0)
{
UserInfo ui = new UserInfo();
List <UserInfo> userList = new List <UserInfo> ();
for (int i = 0; i < rowCount; i++)
{
ui.UserID = dsGetUserList.Tables[0].Rows[i][ "UserID "].ToString();
ui.Name = dsGetUserList.Tables[0].Rows[i][ "UserName "].ToString();
ui.GroupID = int.Parse(dsGetUserList.Tables[0].Rows[i][ "GroupID "].ToString());
ui.State = int.Parse(dsGetUserList.Tables[0].Rows[i][ "State "].ToString());
userList.Add(ui);
}
return userList;
}
else if (rowCount <= 0)
{
ugErrormsg = "当前没有用户! ";