public Organization Add(Organization entity)
        {
            if (entity.Id > 0) return entity;

            context.Profile.AddObject(entity);

            try
            {
                context.SaveChanges();
            }
            catch (OptimisticConcurrencyException e)
            {
                //An optimistic concurrency violation has occurred in the data source.
                throw new ConcurrencyException(e.Message);
            }

            return entity;
        }
 public void Visit(Organization organization)
 {
     TypeOfProfile = "ONG";
 }
        private void FixupOrganization(Organization previousValue)
        {
            if (previousValue != null && previousValue.Emergency.Contains(this))
            {
                previousValue.Emergency.Remove(this);
            }

            if (Organization != null)
            {
                if (!Organization.Emergency.Contains(this))
                {
                    Organization.Emergency.Add(this);
                }
                if (Organization_id != Organization.Id)
                {
                    Organization_id = Organization.Id;
                }
            }
        }
 public void Delete(Organization entity)
 {
     context.DeleteObject(entity);
 }
 public Organization Update(Organization entity)
 {
     return entity;
 }
        private void FixupOrganization(Organization previousValue)
        {
            if (previousValue != null && previousValue.Transaction.Contains(this))
            {
                previousValue.Transaction.Remove(this);
            }

            if (Organization != null)
            {
                if (!Organization.Transaction.Contains(this))
                {
                    Organization.Transaction.Add(this);
                }
                if (Organization_id != Organization.Id)
                {
                    Organization_id = Organization.Id;
                }
            }
            else if (!_settingFK)
            {
                Organization_id = null;
            }
        }