/// <summary> /// 获得数据列表 /// </summary> public List <DiDaJiangCheng.Model.tbUserInfo> DataTableToList(DataTable dt) { List <DiDaJiangCheng.Model.tbUserInfo> modelList = new List <DiDaJiangCheng.Model.tbUserInfo>(); int rowsCount = dt.Rows.Count; if (rowsCount > 0) { DiDaJiangCheng.Model.tbUserInfo model; for (int n = 0; n < rowsCount; n++) { model = new DiDaJiangCheng.Model.tbUserInfo(); if (dt.Rows[n]["UserId"].ToString() != "") { model.UserId = int.Parse(dt.Rows[n]["UserId"].ToString()); } model.UserName = dt.Rows[n]["UserName"].ToString(); model.UserPassword = dt.Rows[n]["UserPassword"].ToString(); modelList.Add(model); } } return(modelList); }
/// <summary> /// 更新一条数据 /// </summary> public bool Update(DiDaJiangCheng.Model.tbUserInfo model) { return(dal.Update(model)); }
/// <summary> /// 增加一条数据 /// </summary> public int Add(DiDaJiangCheng.Model.tbUserInfo model) { return(dal.Add(model)); }