Ejemplo n.º 1
0
 public bool addfavorite(SiteGroupCms.Entity.Favorite obj)
 {
     using (DbOperHandler _doh = new Common().Doh())
     {
         SiteGroupCms.Entity.Admin _admin = (SiteGroupCms.Entity.Admin)HttpContext.Current.Session["admin"];
         _doh.Reset();
         _doh.AddFieldItem("title", obj.Title);
         _doh.AddFieldItem("content", obj.Content);
         _doh.AddFieldItem("url", obj.Content);
         _doh.AddFieldItem("content", obj.Content);
         _doh.AddFieldItem("description", obj.Content);
         int _insert = _doh.Insert("yy_roleinfo");
         return(_insert >= 1);
     }
 }
Ejemplo n.º 2
0
        /// <summary>
        /// 获得单页内容的单条记录实体
        /// </summary>
        /// <param name="_id"></param>
        public SiteGroupCms.Entity.Favorite GetEntity(string _id)
        {
            SiteGroupCms.Entity.Favorite fav = new SiteGroupCms.Entity.Favorite();

            using (DbOperHandler _doh = new Common().Doh())
            {
                _doh.Reset();
                _doh.SqlCmd = "SELECT * FROM [yy_favoriteinfo] WHERE [Id]=" + _id;
                DataTable dt = _doh.GetDataTable();
                if (dt.Rows.Count > 0)
                {
                    fav.ID      = Convert.ToInt32(_id);
                    fav.Title   = dt.Rows[0]["title"].ToString();
                    fav.Content = dt.Rows[0]["content"].ToString();
                    fav.Icon    = dt.Rows[0]["icon"].ToString();
                    fav.Isshow  = dt.Rows[0]["isshow"].ToString() == "0" ? 0 : 1;
                    fav.Rightid = Convert.ToInt32(dt.Rows[0]["rightid"].ToString());
                    fav.Url     = dt.Rows[0]["url"].ToString();
                }
                return(fav);
            }
        }