예제 #1
0
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List <MobileSoft.Model.Unified.Tb_User_Recommended> DataTableToList(DataTable dt)
        {
            List <MobileSoft.Model.Unified.Tb_User_Recommended> modelList = new List <MobileSoft.Model.Unified.Tb_User_Recommended>();
            int rowsCount = dt.Rows.Count;

            if (rowsCount > 0)
            {
                MobileSoft.Model.Unified.Tb_User_Recommended model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model                    = new MobileSoft.Model.Unified.Tb_User_Recommended();
                    model.Id                 = dt.Rows[n]["Id"].ToString();
                    model.UserId             = dt.Rows[n]["UserId"].ToString();
                    model.CommunityId        = dt.Rows[n]["CommunityId"].ToString();
                    model.RecommendedContent = dt.Rows[n]["RecommendedContent"].ToString();
                    if (dt.Rows[n]["SubmitTime"].ToString() != "")
                    {
                        model.SubmitTime = dt.Rows[n]["SubmitTime"].ToString();
                    }
                    model.ReplyContent = dt.Rows[n]["ReplyContent"].ToString();
                    model.ReplyState   = dt.Rows[n]["ReplyState"].ToString();
                    if (dt.Rows[n]["EvaluationLevel"].ToString() != "")
                    {
                        model.EvaluationLevel = int.Parse(dt.Rows[n]["EvaluationLevel"].ToString());
                    }
                    if (dt.Rows[n]["ReplyTime"].ToString() != "")
                    {
                        model.ReplyTime = DateTime.Parse(dt.Rows[n]["ReplyTime"].ToString());
                    }
                    model.ReplyPeople = dt.Rows[n]["ReplyPeople"].ToString();
                    if (dt.Rows[n]["IsDelete"].ToString() != "")
                    {
                        model.IsDelete = int.Parse(dt.Rows[n]["IsDelete"].ToString());
                    }
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
예제 #2
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public void Update(MobileSoft.Model.Unified.Tb_User_Recommended model)
 {
     dal.Update(model);
 }
예제 #3
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public void Add(MobileSoft.Model.Unified.Tb_User_Recommended model)
 {
     dal.Add(model);
 }