Esempio n. 1
0
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List <ROYcms.Sys.Model.ROYcms_CaiRss> DataTableToList(DataTable dt)
        {
            List <ROYcms.Sys.Model.ROYcms_CaiRss> modelList = new List <ROYcms.Sys.Model.ROYcms_CaiRss>();
            int rowsCount = dt.Rows.Count;

            if (rowsCount > 0)
            {
                ROYcms.Sys.Model.ROYcms_CaiRss model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new ROYcms.Sys.Model.ROYcms_CaiRss();
                    if (dt.Rows[n]["id"].ToString() != "")
                    {
                        model.id = int.Parse(dt.Rows[n]["id"].ToString());
                    }
                    model.RssUrl   = dt.Rows[n]["RssUrl"].ToString();
                    model.Encode   = dt.Rows[n]["Encode"].ToString();
                    model.HtmlStar = dt.Rows[n]["HtmlStar"].ToString();
                    model.HtmlEnd  = dt.Rows[n]["HtmlEnd"].ToString();
                    model.Path     = dt.Rows[n]["Path"].ToString();
                    if (dt.Rows[n]["Time"].ToString() != "")
                    {
                        model.Time = DateTime.Parse(dt.Rows[n]["Time"].ToString());
                    }
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
Esempio n. 2
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public void Update(ROYcms.Sys.Model.ROYcms_CaiRss model)
 {
     dal.Update(model);
 }
Esempio n. 3
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int  Add(ROYcms.Sys.Model.ROYcms_CaiRss model)
 {
     return(dal.Add(model));
 }