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