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

            if (rowsCount > 0)
            {
                ROYcms.Sys.Model.ROYcms_Objet model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new ROYcms.Sys.Model.ROYcms_Objet();
                    if (dt.Rows[n]["id"].ToString() != "")
                    {
                        model.id = int.Parse(dt.Rows[n]["id"].ToString());
                    }
                    model.Title          = dt.Rows[n]["Title"].ToString();
                    model.zhaiyao        = dt.Rows[n]["zhaiyao"].ToString();
                    model.logo           = dt.Rows[n]["logo"].ToString();
                    model.AppendixConfig = dt.Rows[n]["AppendixConfig"].ToString();
                    model.AppendixPath   = dt.Rows[n]["AppendixPath"].ToString();
                    if (dt.Rows[n]["Visible"].ToString() != "")
                    {
                        model.Visible = int.Parse(dt.Rows[n]["Visible"].ToString());
                    }
                    model.Role = dt.Rows[n]["Role"].ToString();
                    if (dt.Rows[n]["Time"].ToString() != "")
                    {
                        model.Time = DateTime.Parse(dt.Rows[n]["Time"].ToString());
                    }
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
Exemple #2
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public void Update(ROYcms.Sys.Model.ROYcms_Objet model)
 {
     dal.Update(model);
 }
Exemple #3
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int  Add(ROYcms.Sys.Model.ROYcms_Objet model)
 {
     return(dal.Add(model));
 }