/// <summary> /// 获得数据列表 /// </summary> public List <ForKids.DB.Model.KIDCOURSE> DataTableToList(DataTable dt) { List <ForKids.DB.Model.KIDCOURSE> modelList = new List <ForKids.DB.Model.KIDCOURSE>(); int rowsCount = dt.Rows.Count; if (rowsCount > 0) { ForKids.DB.Model.KIDCOURSE model; for (int n = 0; n < rowsCount; n++) { model = new ForKids.DB.Model.KIDCOURSE(); if (dt.Rows[n]["ID"] != null && dt.Rows[n]["ID"].ToString() != "") { model.ID = int.Parse(dt.Rows[n]["ID"].ToString()); } if (dt.Rows[n]["KIDID"] != null && dt.Rows[n]["KIDID"].ToString() != "") { model.KIDID = int.Parse(dt.Rows[n]["KIDID"].ToString()); } if (dt.Rows[n]["COURSEID"] != null && dt.Rows[n]["COURSEID"].ToString() != "") { model.COURSEID = int.Parse(dt.Rows[n]["COURSEID"].ToString()); } if (dt.Rows[n]["ATTENDANCE"] != null && dt.Rows[n]["ATTENDANCE"].ToString() != "") { model.ATTENDANCE = double.Parse(dt.Rows[n]["ATTENDANCE"].ToString()); } if (dt.Rows[n]["PERFORMANCE"] != null && dt.Rows[n]["PERFORMANCE"].ToString() != "") { model.PERFORMANCE = dt.Rows[n]["PERFORMANCE"].ToString(); } if (dt.Rows[n]["CREDIT"] != null && dt.Rows[n]["CREDIT"].ToString() != "") { model.CREDIT = int.Parse(dt.Rows[n]["CREDIT"].ToString()); } modelList.Add(model); } } return(modelList); }
/// <summary> /// 获得数据列表 /// </summary> public List<ForKids.DB.Model.KIDCOURSE> DataTableToList(DataTable dt) { List<ForKids.DB.Model.KIDCOURSE> modelList = new List<ForKids.DB.Model.KIDCOURSE>(); int rowsCount = dt.Rows.Count; if (rowsCount > 0) { ForKids.DB.Model.KIDCOURSE model; for (int n = 0; n < rowsCount; n++) { model = new ForKids.DB.Model.KIDCOURSE(); if(dt.Rows[n]["ID"]!=null && dt.Rows[n]["ID"].ToString()!="") { model.ID=int.Parse(dt.Rows[n]["ID"].ToString()); } if(dt.Rows[n]["KIDID"]!=null && dt.Rows[n]["KIDID"].ToString()!="") { //model.KIDID=dt.Rows[n]["KIDID"].ToString(); } if(dt.Rows[n]["COURSEID"]!=null && dt.Rows[n]["COURSEID"].ToString()!="") { //model.COURSEID=dt.Rows[n]["COURSEID"].ToString(); } if(dt.Rows[n]["ATTENDANCE"]!=null && dt.Rows[n]["ATTENDANCE"].ToString()!="") { //model.ATTENDANCE=dt.Rows[n]["ATTENDANCE"].ToString(); } if(dt.Rows[n]["PERFORMANCE"]!=null && dt.Rows[n]["PERFORMANCE"].ToString()!="") { model.PERFORMANCE=dt.Rows[n]["PERFORMANCE"].ToString(); } if(dt.Rows[n]["CREDIT"]!=null && dt.Rows[n]["CREDIT"].ToString()!="") { //model.CREDIT=dt.Rows[n]["CREDIT"].ToString(); } modelList.Add(model); } } return modelList; }
/// <summary> /// 更新一条数据 /// </summary> public bool Update(ForKids.DB.Model.KIDCOURSE model) { return(dal.Update(model)); }
/// <summary> /// 增加一条数据 /// </summary> public bool Add(ForKids.DB.Model.KIDCOURSE model) { return(dal.Add(model)); }