Esempio n. 1
0
        public static Services.ClassificationScheme.GetClassificationSchemeById.GetClassificationSchemeByIdResponse GetClassificationSchemeById(Services.ClassificationScheme.GetClassificationSchemeById.GetClassificationSchemeByIdRequest request)
        {
            Services.ClassificationScheme.GetClassificationSchemeById.GetClassificationSchemeByIdResponse response = new Services.ClassificationScheme.GetClassificationSchemeById.GetClassificationSchemeByIdResponse();
            try
            {
                DocsPaVO.utente.Utente     utente     = null;
                DocsPaVO.utente.InfoUtente infoUtente = null;

                //Inizio controllo autenticazione utente
                infoUtente = Utils.CheckAuthentication(request, "GetClassificationSchemeById");

                utente = BusinessLogic.Utenti.UserManager.getUtenteById(infoUtente.idPeople);
                if (utente == null)
                {
                    //Utente non trovato
                    throw new PisException("USER_NO_EXIST");
                }
                //Fine controllo autenticazione utente

                if (request != null && string.IsNullOrEmpty(request.IdClassificationScheme))
                {
                    throw new PisException("ID_CLASSIFICATIONSCHEME_REQUIRED");
                }

                Domain.ClassificationScheme classificationSchemeResponse = new Domain.ClassificationScheme();

                DocsPaVO.amministrazione.OrgTitolario titolario = null;

                try
                {
                    titolario = BusinessLogic.Amministrazione.TitolarioManager.getTitolarioById(request.IdClassificationScheme);
                }
                catch
                {
                    //Titolari non trovati
                    throw new PisException("CLASSIFICATION_NOT_FOUND");
                }

                if (titolario != null)
                {
                    if (titolario.Stato == DocsPaVO.amministrazione.OrgStatiTitolarioEnum.Attivo)
                    {
                        classificationSchemeResponse.Active = true;
                    }
                    else
                    {
                        classificationSchemeResponse.Active = false;
                    }
                    classificationSchemeResponse.Description = titolario.Descrizione;
                    classificationSchemeResponse.Id          = titolario.ID;
                }
                else
                {
                    //Titolari non trovati
                    throw new PisException("CLASSIFICATION_NOT_FOUND");
                }

                response.ClassificationScheme = classificationSchemeResponse;

                response.Success = true;
            }
            catch (PisException pisEx)
            {
                logger.ErrorFormat("PISException: {0}, {1}", pisEx.ErrorCode, pisEx.Description);
                response.Error = new Services.ResponseError
                {
                    Code        = pisEx.ErrorCode,
                    Description = pisEx.Description
                };

                response.Success = false;
            }
            catch (Exception ex)
            {
                logger.ErrorFormat("Eccezione Generica: APPLICATION_ERROR, {0}", ex.Message);
                response.Error = new Services.ResponseError
                {
                    Code        = "APPLICATION_ERROR",
                    Description = ex.Message
                };

                response.Success = false;
            }

            return(response);
        }
Esempio n. 2
0
        /// <summary>
        /// Servizio per il reperimento del dettaglio di un titolario
        /// </summary>
        /// <param name="request"></param>
        /// <returns>Response </returns>
        public Services.ClassificationScheme.GetClassificationSchemeById.GetClassificationSchemeByIdResponse GetClassificationSchemeById(Services.ClassificationScheme.GetClassificationSchemeById.GetClassificationSchemeByIdRequest request)
        {
            logger.Info("BEGIN");
            Services.ClassificationScheme.GetClassificationSchemeById.GetClassificationSchemeByIdResponse response = Manager.ClassificationSchemesManager.GetClassificationSchemeById(request);

            Utils.CheckFaultException(response);
            logger.Info("END");

            return(response);
        }