public new void ProgramParticipantInsert(ProgramParticipant entity)
        {
            ProgramParticipant part = base.ProgramParticipantSelect(entity.ExpertRef, entity.ProgramRef);
              if (part != null)
              {
            return;
              }

              TraceCallEnterEvent.Raise();
              try
              {
            // logical checks:
            ProgramService progSrv = new ProgramService();
            Program selected = progSrv.ProgramSelect(entity.ProgramRef);
            if (selected == null)
              throw new ApplicationException("Ezzel az azonosítóval nem létezik program.");
            if (!selected.IsActive)
              throw new ApplicationException("A program nem aktív.");

            // check permission: Writer or Admin
            string writerRole = selected.OrganisationRef.Value.ToString() + ".Writer";
            PrincipalPermission permWriter = new PrincipalPermission(Thread.CurrentPrincipal.Identity.Name, writerRole);
            PrincipalPermission permAdmin = new PrincipalPermission(Thread.CurrentPrincipal.Identity.Name, "Administrator");
            permWriter.Union(permAdmin).Demand();

            ExpertService expSrv = new ExpertService();
            Expert participant = expSrv.ExpertSelect(entity.ExpertRef);
            if (participant == null)
              throw new ApplicationException("Ezzel az azonosítóval nem létezik szakember.");
            if (!participant.IsActive)
              throw new ApplicationException("A szakember nem aktív.");

            // save data:
            base.ProgramParticipantInsert(entity);

            BusinessAuditEvent.Success(
              new EventParameter("ProgramID", entity.ProgramRef.ToString()),
              new EventParameter("ExpertID", entity.ExpertRef.ToString())
              );
            TraceCallReturnEvent.Raise();
            return;
              }
              catch (Exception ex)
              {
            ExceptionManager.Publish(ex);
            BusinessAuditEvent.Fail(
              new EventParameter("Exception", ex.ToString()),
              new EventParameter("ProgramID", entity.ProgramRef.ToString()),
              new EventParameter("ExpertID", entity.ExpertRef.ToString())
              );
            TraceCallReturnEvent.Raise(false);
            throw;
              }
        }
        public void ProgramResponsibleUpdate(Program entity)
        {
            TraceCallEnterEvent.Raise();
              try
              {
            // logical checks:
            Program selected = base.ProgramSelect(entity.ID);
            if (selected == null)
              throw new ApplicationException("Ezzel az azonosítóval nem létezik program.");
            if (!selected.IsActive)
              throw new ApplicationException("A program nem aktív.");

            // check permission: Writer or Admin
            string writerRole = selected.OrganisationRef.Value.ToString() + ".Writer";
            PrincipalPermission permWriter = new PrincipalPermission(Thread.CurrentPrincipal.Identity.Name, writerRole);
            PrincipalPermission permAdmin = new PrincipalPermission(Thread.CurrentPrincipal.Identity.Name, "Administrator");
            permWriter.Union(permAdmin).Demand();

            if (!entity.ResponsibleRef.IsNull)
            {
              ExpertService expSrv = new ExpertService();
              Expert responsible = expSrv.ExpertSelect(entity.ResponsibleRef);
              if (responsible == null)
            throw new ApplicationException("Ezzel az azonosítóval nem létezik szakember.");
              if (!responsible.IsActive)
            throw new ApplicationException("A szakember nem aktív.");
            }

            // save data:
            selected.ResponsibleRef = entity.ResponsibleRef;
            selected.LastModifiedDate = DateTime.Now;
            base.ProgramUpdate(selected);

            BusinessAuditEvent.Success(
              new EventParameter("ProgramID", entity.ID.ToString()),
              new EventParameter("ProgramName", selected.Name),
              new EventParameter("ResponsibleID", entity.ResponsibleRef.ToString())
              );
            TraceCallReturnEvent.Raise();
            return;
              }
              catch (Exception ex)
              {
            ExceptionManager.Publish(ex);
            BusinessAuditEvent.Fail(
              new EventParameter("Exception", ex.ToString()),
              new EventParameter("ProgramID", entity.ID.ToString()),
              new EventParameter("ResponsibleID", entity.ResponsibleRef.ToString())
              );
            TraceCallReturnEvent.Raise(false);
            throw;
              }
        }