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

            if (rowsCount > 0)
            {
                university.Model.CCOM.Notice_attach model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new university.Model.CCOM.Notice_attach();
                    if (dt.Rows[n]["Notice_attach_id"].ToString() != "")
                    {
                        model.Notice_attach_id = long.Parse(dt.Rows[n]["Notice_attach_id"].ToString());
                    }
                    if (dt.Rows[n]["Notice_id"].ToString() != "")
                    {
                        model.Notice_id = long.Parse(dt.Rows[n]["Notice_id"].ToString());
                    }
                    model.Notice_attach_name    = dt.Rows[n]["Notice_attach_name"].ToString();
                    model.Notice_attach_address = dt.Rows[n]["Notice_attach_address"].ToString();


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