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

            if (rowsCount > 0)
            {
                ROYcms.Sys.Model.ROYcms_remark model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new ROYcms.Sys.Model.ROYcms_remark();
                    if (dt.Rows[n]["bh"].ToString() != "")
                    {
                        model.bh = int.Parse(dt.Rows[n]["bh"].ToString());
                    }
                    if (dt.Rows[n]["NewID"].ToString() != "")
                    {
                        model.NewID = int.Parse(dt.Rows[n]["NewID"].ToString());
                    }
                    if (dt.Rows[n]["userID"].ToString() != "")
                    {
                        model.userID = int.Parse(dt.Rows[n]["userID"].ToString());
                    }
                    model.userName = dt.Rows[n]["userName"].ToString();
                    model.contents = dt.Rows[n]["contents"].ToString();
                    model.Ip       = dt.Rows[n]["Ip"].ToString();
                    if (dt.Rows[n]["Time"].ToString() != "")
                    {
                        model.Time = DateTime.Parse(dt.Rows[n]["Time"].ToString());
                    }
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
Exemplo n.º 2
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public void Update(ROYcms.Sys.Model.ROYcms_remark model)
 {
     dal.Update(model);
 }
Exemplo n.º 3
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int  Add(ROYcms.Sys.Model.ROYcms_remark model)
 {
     return(dal.Add(model));
 }