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