Esempio n. 1
0
        public void DeleteHumanRight(HumanRightItem humanRightItem)
        {
            var entity = new HumanRight
            {
                HumanRightID = humanRightItem.HumanRightID
            };

            db.HumanRights.Attach(entity);
            db.HumanRights.Remove(entity);
            db.SaveChanges();
        }
Esempio n. 2
0
        public void CreateHumanRight(HumanRightItem humanRightItem)
        {
            var entity = new HumanRight
            {
                HumanRightName = humanRightItem.HumanRightName
            };

            db.HumanRights.Add(entity);
            db.SaveChanges();
            humanRightItem.HumanRightID = entity.HumanRightID;
        }
Esempio n. 3
0
        public void UpdateHumanRight(HumanRightItem humanRightItem)
        {
            var entity = new HumanRight
            {
                HumanRightID   = humanRightItem.HumanRightID,
                HumanRightName = humanRightItem.HumanRightName
            };

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