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