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

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


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