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