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

            if (rowsCount > 0)
            {
                university.Model.CCOM.User_notice model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new university.Model.CCOM.User_notice();
                    if (dt.Rows[n]["id"].ToString() != "")
                    {
                        model.id = long.Parse(dt.Rows[n]["id"].ToString());
                    }
                    if (dt.Rows[n]["User_id"].ToString() != "")
                    {
                        model.User_id = long.Parse(dt.Rows[n]["User_id"].ToString());
                    }
                    model.Notice_id      = dt.Rows[n]["Notice_id"].ToString();
                    model.Notice_read_id = dt.Rows[n]["Notice_read_id"].ToString();


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