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

            if (rowsCount > 0)
            {
                university.Model.CCOM.Notice_type model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new university.Model.CCOM.Notice_type();
                    if (dt.Rows[n]["Notice_type_id"].ToString() != "")
                    {
                        model.Notice_type_id = long.Parse(dt.Rows[n]["Notice_type_id"].ToString());
                    }
                    model.Notice_type_name = dt.Rows[n]["Notice_type_name"].ToString();
                    if (dt.Rows[n]["Notice_type_creator_id"].ToString() != "")
                    {
                        model.Notice_type_creator_id = long.Parse(dt.Rows[n]["Notice_type_creator_id"].ToString());
                    }
                    if (dt.Rows[n]["Notice_type_date"].ToString() != "")
                    {
                        model.Notice_type_date = DateTime.Parse(dt.Rows[n]["Notice_type_date"].ToString());
                    }


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