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

            if (rowsCount > 0)
            {
                NewXzc.Model.HRENH_ARTICLE_REVIEW_REPLY model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new NewXzc.Model.HRENH_ARTICLE_REVIEW_REPLY();
                    if (dt.Rows[n]["ID"] != null && dt.Rows[n]["ID"].ToString() != "")
                    {
                        model.ID = int.Parse(dt.Rows[n]["ID"].ToString());
                    }
                    if (dt.Rows[n]["USERID"] != null && dt.Rows[n]["USERID"].ToString() != "")
                    {
                        model.USERID = int.Parse(dt.Rows[n]["USERID"].ToString());
                    }
                    if (dt.Rows[n]["REPLY_ID"] != null && dt.Rows[n]["REPLY_ID"].ToString() != "")
                    {
                        model.REPLY_ID = int.Parse(dt.Rows[n]["REPLY_ID"].ToString());
                    }
                    if (dt.Rows[n]["PUB_USERID"] != null && dt.Rows[n]["PUB_USERID"].ToString() != "")
                    {
                        model.PUB_USERID = int.Parse(dt.Rows[n]["PUB_USERID"].ToString());
                    }
                    if (dt.Rows[n]["REVIEW_PID"] != null && dt.Rows[n]["REVIEW_PID"].ToString() != "")
                    {
                        model.REVIEW_PID = int.Parse(dt.Rows[n]["REVIEW_PID"].ToString());
                    }
                    if (dt.Rows[n]["CONTENTS"] != null && dt.Rows[n]["CONTENTS"].ToString() != "")
                    {
                        model.CONTENTS = dt.Rows[n]["CONTENTS"].ToString();
                    }
                    if (dt.Rows[n]["ISLIKE"] != null && dt.Rows[n]["ISLIKE"].ToString() != "")
                    {
                        model.ISLIKE = int.Parse(dt.Rows[n]["ISLIKE"].ToString());
                    }
                    if (dt.Rows[n]["TYPES"] != null && dt.Rows[n]["TYPES"].ToString() != "")
                    {
                        model.TYPES = int.Parse(dt.Rows[n]["TYPES"].ToString());
                    }
                    if (dt.Rows[n]["ARTICLE_ID"] != null && dt.Rows[n]["ARTICLE_ID"].ToString() != "")
                    {
                        model.ARTICLE_ID = int.Parse(dt.Rows[n]["ARTICLE_ID"].ToString());
                    }
                    if (dt.Rows[n]["ADDTIME"] != null && dt.Rows[n]["ADDTIME"].ToString() != "")
                    {
                        model.ADDTIME = DateTime.Parse(dt.Rows[n]["ADDTIME"].ToString());
                    }
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
Esempio n. 2
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(NewXzc.Model.HRENH_ARTICLE_REVIEW_REPLY model)
 {
     return(dal.Update(model));
 }
Esempio n. 3
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public bool Add(NewXzc.Model.HRENH_ARTICLE_REVIEW_REPLY model)
 {
     return(dal.Add(model));
 }