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