Esempio n. 1
0
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List<Maticsoft.Model.t_Reviews> DataTableToList(DataTable dt)
        {
            List<Maticsoft.Model.t_Reviews> modelList = new List<Maticsoft.Model.t_Reviews>();
            int rowsCount = dt.Rows.Count;
            if (rowsCount > 0)
            {
                Maticsoft.Model.t_Reviews model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new Maticsoft.Model.t_Reviews();
                                                    if(dt.Rows[n]["reviewId"].ToString()!="")
                {
                    model.reviewId=int.Parse(dt.Rows[n]["reviewId"].ToString());
                }
                                                                                                                                if(dt.Rows[n]["weiboId"].ToString()!="")
                {
                    model.weiboId=int.Parse(dt.Rows[n]["weiboId"].ToString());
                }
                                                                                                                                                model.reAuthorName= dt.Rows[n]["reAuthorName"].ToString();
                                                                                                                                model.returnContent= dt.Rows[n]["returnContent"].ToString();

                    modelList.Add(model);
                }
            }
            return modelList;
        }
Esempio n. 2
0
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List <Maticsoft.Model.t_Reviews> DataTableToList(DataTable dt)
        {
            List <Maticsoft.Model.t_Reviews> modelList = new List <Maticsoft.Model.t_Reviews>();
            int rowsCount = dt.Rows.Count;

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


                    modelList.Add(model);
                }
            }
            return(modelList);
        }
Esempio n. 3
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(Maticsoft.Model.t_Reviews model)
 {
     return(dal.Update(model));
 }
Esempio n. 4
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public void  Add(Maticsoft.Model.t_Reviews model)
 {
     dal.Add(model);
 }