Esempio n. 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            int id = Convert.ToInt32(RouteData.Values["id"]);
            post = BulletinHelper.GetBulltin(id);

            //bshare需要抓取的两个内容
            Page.Header.Title = post.Title;
            Page.Header.Description = post.Title;

            //更新统计数据
            using (var db = new SCenterEntities())
            {
                post.ClickCount += 1;
                db.Attach(post);
                db.ObjectStateManager.ChangeObjectState(post, System.Data.EntityState.Modified);
                db.SaveChanges(System.Data.Objects.SaveOptions.AcceptAllChangesAfterSave);
            }
        }
Esempio n. 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //获取要查看的新闻ID
            int id = Convert.ToInt32(RouteData.Values["id"]);

            Msg = ArtiHelper.GetArticle(id);

            //bshare需要抓取的两个内容
            Page.Header.Title = Msg.Title;
            Page.Header.Description = Msg.Title;

            //更新统计数据
            using (var db = new SCenterEntities())
            {
                Msg.ClickCount += 1;
                db.Attach(Msg);
                db.ObjectStateManager.ChangeObjectState(Msg, System.Data.EntityState.Modified);
                db.SaveChanges(System.Data.Objects.SaveOptions.AcceptAllChangesAfterSave);
            }
        }