Пример #1
0
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List <university.Model.CCOM.Degree> DataTableToList(DataTable dt)
        {
            List <university.Model.CCOM.Degree> modelList = new List <university.Model.CCOM.Degree>();
            int rowsCount = dt.Rows.Count;

            if (rowsCount > 0)
            {
                university.Model.CCOM.Degree model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new university.Model.CCOM.Degree();
                    if (dt.Rows[n]["Degree_id"].ToString() != "")
                    {
                        model.Degree_id = int.Parse(dt.Rows[n]["Degree_id"].ToString());
                    }
                    model.Degree_name = dt.Rows[n]["Degree_name"].ToString();


                    modelList.Add(model);
                }
            }
            return(modelList);
        }
Пример #2
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(university.Model.CCOM.Degree model)
 {
     return(dal.Update(model));
 }
Пример #3
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int  Add(university.Model.CCOM.Degree model)
 {
     return(dal.Add(model));
 }