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