示例#1
0
        public void DeleteResponseContent(ResponseContentItem ResponseContentItem)
        {
            var entity = new ResponseContent
            {
                ResponseContentID = ResponseContentItem.ResponseContentID
            };

            db.ResponseContents.Attach(entity);
            db.ResponseContents.Remove(entity);
            db.SaveChanges();
        }
示例#2
0
        public void CreateResponseContent(ResponseContentItem ResponseContentItem)
        {
            var entity = new ResponseContent
            {
                ResponseContentName = ResponseContentItem.ResponseContentName
            };

            db.ResponseContents.Add(entity);
            db.SaveChanges();
            ResponseContentItem.ResponseContentID = entity.ResponseContentID;
        }
示例#3
0
        public void UpdateResponseContent(ResponseContentItem ResponseContentItem)
        {
            var entity = new ResponseContent
            {
                ResponseContentID   = ResponseContentItem.ResponseContentID,
                ResponseContentName = ResponseContentItem.ResponseContentName
            };

            db.ResponseContents.Attach(entity);
            db.Entry(entity).State = EntityState.Modified;
            db.SaveChanges();
        }