Beispiel #1
0
        public void Destroy(TargetGroupViewModel user)
        {
            var entity = new TargetGroup_Table();

            entity.TargetGroupID = user.TargetGroupID;
            entities.TargetGroup_Table.Attach(entity);
            entities.TargetGroup_Table.Remove(entity);
            entities.SaveChanges();
        }
Beispiel #2
0
        public void Create(TargetGroupViewModel user)
        {
            var entity = new TargetGroup_Table();

            entity.TargetGroupName = user.TargetGroupName;

            entities.TargetGroup_Table.Add(entity);
            entities.SaveChanges();

            user.TargetGroupID = entity.TargetGroupID;
        }
Beispiel #3
0
        public void Update(TargetGroupViewModel user)
        {
            var entity = new TargetGroup_Table();

            entity.TargetGroupID   = user.TargetGroupID;
            entity.TargetGroupName = user.TargetGroupName;



            entities.TargetGroup_Table.Attach(entity);
            entities.Entry(entity).State = EntityState.Modified;
            entities.SaveChanges();
        }