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