示例#1
0
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List <Maticsoft.Model.t_Favorites> DataTableToList(DataTable dt)
        {
            List <Maticsoft.Model.t_Favorites> modelList = new List <Maticsoft.Model.t_Favorites>();
            int rowsCount = dt.Rows.Count;

            if (rowsCount > 0)
            {
                Maticsoft.Model.t_Favorites model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new Maticsoft.Model.t_Favorites();
                    if (dt.Rows[n]["favoriteId"].ToString() != "")
                    {
                        model.favoriteId = int.Parse(dt.Rows[n]["favoriteId"].ToString());
                    }
                    if (dt.Rows[n]["weiboId"].ToString() != "")
                    {
                        model.weiboId = int.Parse(dt.Rows[n]["weiboId"].ToString());
                    }
                    model.authorName = dt.Rows[n]["authorName"].ToString();


                    modelList.Add(model);
                }
            }
            return(modelList);
        }
示例#2
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(Maticsoft.Model.t_Favorites model)
 {
     return(dal.Update(model));
 }
示例#3
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public void  Add(Maticsoft.Model.t_Favorites model)
 {
     dal.Add(model);
 }