/// <summary> /// 获得数据列表 /// </summary> public List <DiDaJiangCheng.Model.tbClassInfo> DataTableToList(DataTable dt) { List <DiDaJiangCheng.Model.tbClassInfo> modelList = new List <DiDaJiangCheng.Model.tbClassInfo>(); int rowsCount = dt.Rows.Count; if (rowsCount > 0) { DiDaJiangCheng.Model.tbClassInfo model; for (int n = 0; n < rowsCount; n++) { model = new DiDaJiangCheng.Model.tbClassInfo(); if (dt.Rows[n]["ClassId"].ToString() != "") { model.ClassId = int.Parse(dt.Rows[n]["ClassId"].ToString()); } model.ClassName = dt.Rows[n]["ClassName"].ToString(); if (dt.Rows[n]["SpecialtyId"].ToString() != "") { model.SpecialtyId = int.Parse(dt.Rows[n]["SpecialtyId"].ToString()); } model.classroomId = dt.Rows[n]["classroomId"].ToString(); model.eductionalSystem = dt.Rows[n]["eductionalSystem"].ToString(); if (dt.Rows[n]["enterTime"].ToString() != "") { model.enterTime = DateTime.Parse(dt.Rows[n]["enterTime"].ToString()); } model.Marks = dt.Rows[n]["Marks"].ToString(); modelList.Add(model); } } return(modelList); }
/// <summary> /// 更新一条数据 /// </summary> public bool Update(DiDaJiangCheng.Model.tbClassInfo model) { return(dal.Update(model)); }
/// <summary> /// 增加一条数据 /// </summary> public int Add(DiDaJiangCheng.Model.tbClassInfo model) { return(dal.Add(model)); }