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