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