示例#1
0
        public void DeleteResponseQuality(ResponseQualityItem ResponseQualityItem)
        {
            var entity = new ResponseQuality
            {
                ResponseQualityID = ResponseQualityItem.ResponseQualityID
            };

            db.ResponseQualities.Attach(entity);
            db.ResponseQualities.Remove(entity);
            db.SaveChanges();
        }
示例#2
0
        public void CreateResponseQuality(ResponseQualityItem ResponseQualityItem)
        {
            var entity = new ResponseQuality
            {
                ResponseQualityName = ResponseQualityItem.ResponseQualityName
            };

            db.ResponseQualities.Add(entity);
            db.SaveChanges();
            ResponseQualityItem.ResponseQualityID = entity.ResponseQualityID;
        }
示例#3
0
        public void UpdateResponseQuality(ResponseQualityItem ResponseQualityItem)
        {
            var entity = new ResponseQuality
            {
                ResponseQualityID   = ResponseQualityItem.ResponseQualityID,
                ResponseQualityName = ResponseQualityItem.ResponseQualityName
            };

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