/// <summary> /// 获得数据列表 /// </summary> public List <university.Model.CCOM.User_subject_value> DataTableToList(DataTable dt) { List <university.Model.CCOM.User_subject_value> modelList = new List <university.Model.CCOM.User_subject_value>(); int rowsCount = dt.Rows.Count; if (rowsCount > 0) { university.Model.CCOM.User_subject_value model; for (int n = 0; n < rowsCount; n++) { model = new university.Model.CCOM.User_subject_value(); if (dt.Rows[n]["Usv_id"].ToString() != "") { model.Usv_id = long.Parse(dt.Rows[n]["Usv_id"].ToString()); } if (dt.Rows[n]["Subject_id"].ToString() != "") { model.Subject_id = int.Parse(dt.Rows[n]["Subject_id"].ToString()); } if (dt.Rows[n]["User_id"].ToString() != "") { model.User_id = long.Parse(dt.Rows[n]["User_id"].ToString()); } model.Usv_value = dt.Rows[n]["Usv_value"].ToString(); if (dt.Rows[n]["Usv_children"].ToString() != "") { model.Usv_children = int.Parse(dt.Rows[n]["Usv_children"].ToString()); } modelList.Add(model); } } return(modelList); }
/// <summary> /// 更新一条数据 /// </summary> public bool Update(university.Model.CCOM.User_subject_value model) { return(dal.Update(model)); }
/// <summary> /// 增加一条数据 /// </summary> public long Add(university.Model.CCOM.User_subject_value model) { return(dal.Add(model)); }