Beispiel #1
0
        public bool DeleteComment(int dtid)
        {
            dongtaiComment e = db.dongtaiComment.Find(dtid);

            db.dongtaiComment.Remove(e);
            if (db.SaveChanges() > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Beispiel #2
0
        public bool AddComment(int dtid, string content, string name)
        {
            dongtaiComment dtc = new dongtaiComment
            {
                UserName  = name,
                dongtaiid = dtid,
                Time      = DateTime.Now,
                Likenum   = 0,
                Content   = content
            };

            db.dongtaiComment.Add(dtc);
            if (db.SaveChanges() > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }