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