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