Esempio n. 1
0
        protected override void PersistUpdatedItem(IMemberGroup entity)
        {
            var dto = MemberGroupFactory.BuildDto(entity);

            Database.Update(dto);

            entity.ResetDirtyProperties();
        }
Esempio n. 2
0
        protected override void PersistNewItem(IMemberGroup entity)
        {
            //Save to db
            entity.AddingEntity();
            var group = (MemberGroup)entity;
            var dto   = MemberGroupFactory.BuildDto(group);
            var o     = Database.IsNew(dto) ? Convert.ToInt32(Database.Insert(dto)) : Database.Update(dto);

            group.Id = dto.NodeId; //Set Id on entity to ensure an Id is set

            //Update with new correct path and id
            dto.Path = string.Concat("-1,", dto.NodeId);
            Database.Update(dto);
            //assign to entity
            group.Id = o;
            group.ResetDirtyProperties();
        }