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