Ejemplo n.º 1
0
        public bool Update(Article newArticle)
        {
            Article nowArticle = db.Article.Single(x => x.article_id == newArticle.article_id);

            newArticle.article_kuser = nowArticle.article_kuser;
            newArticle.article_kdate = nowArticle.article_kdate;

            db.Entry(nowArticle).CurrentValues.SetValues(newArticle);//更新
            return(db.SaveChanges() > 0);
        }
        public bool Update(ArticleCategory ac)
        {
            ArticleCategory acModel = db.ArticleCategory.Single(x => x.category_id == ac.category_id);

            ac.category_type_name = "";
            db.Entry(acModel).CurrentValues.SetValues(ac);
            return(db.SaveChanges() > 0);
        }
Ejemplo n.º 3
0
        public bool Update(SiteMenu sm)
        {
            SiteMenu mModel = db.SiteMenu.Single(x => x.menu_id == sm.menu_id);


            db.Entry(mModel).CurrentValues.SetValues(sm);
            return(db.SaveChanges() > 0);
        }
Ejemplo n.º 4
0
        public bool Update(Function m)
        {
            Function mModel = db.Function.Single(x => x.function_id == m.function_id);

            m.kuser = mModel.kuser;
            m.kdate = mModel.kdate;

            db.Entry(mModel).CurrentValues.SetValues(m);
            return(db.SaveChanges() > 0);
        }
Ejemplo n.º 5
0
        public bool Update(Member m)
        {
            Member mModel = db.Member.Single(x => x.member_id == m.member_id);

            mModel.member_name     = m.member_name;
            mModel.member_nickname = m.member_nickname;
            if (string.IsNullOrEmpty(m.member_password))
            {
                mModel.member_password = m.member_password;
            }
            mModel.muser = m.muser;
            mModel.mdate = m.mdate;

            db.Entry(mModel).CurrentValues.SetValues(mModel);
            return(db.SaveChanges() > 0);
        }