예제 #1
0
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List <university.Model.CCOM.Nation> DataTableToList(DataTable dt)
        {
            List <university.Model.CCOM.Nation> modelList = new List <university.Model.CCOM.Nation>();
            int rowsCount = dt.Rows.Count;

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


                    modelList.Add(model);
                }
            }
            return(modelList);
        }
예제 #2
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(university.Model.CCOM.Nation model)
 {
     return(dal.Update(model));
 }
예제 #3
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int Add(university.Model.CCOM.Nation model)
 {
     return(dal.Add(model));
 }