Exemplo 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();
        }
Exemplo 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;
        }
Exemplo 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();
        }