/// <summary> /// Servizio per il reperimento del dettaglio di un registor dato un codice o l'id /// </summary> /// <param name="request"></param> /// <returns>Response </returns> public Services.Registers.GetRegisterOrRF.GetRegisterOrRFResponse GetRegisterOrRF(Services.Registers.GetRegisterOrRF.GetRegisterOrRFRequest request) { logger.Info("BEGIN"); Services.Registers.GetRegisterOrRF.GetRegisterOrRFResponse response = Manager.RegistersManager.GetRegisterOrRF(request); Utils.CheckFaultException(response); logger.Info("END"); return(response); }
public static Services.Registers.GetRegisterOrRF.GetRegisterOrRFResponse GetRegisterOrRF(Services.Registers.GetRegisterOrRF.GetRegisterOrRFRequest request) { Services.Registers.GetRegisterOrRF.GetRegisterOrRFResponse response = new Services.Registers.GetRegisterOrRF.GetRegisterOrRFResponse(); try { DocsPaVO.utente.Utente utente = null; DocsPaVO.utente.InfoUtente infoUtente = null; //Inizio controllo autenticazione utente infoUtente = Utils.CheckAuthentication(request, "GetRegisterOrRF"); utente = BusinessLogic.Utenti.UserManager.getUtenteById(infoUtente.idPeople); if (utente == null) { //Utente non trovato throw new PisException("USER_NO_EXIST"); } //Fine controllo autenticazione utente if (string.IsNullOrEmpty(request.CodeRegister) && string.IsNullOrEmpty(request.IdRegister)) { throw new PisException("REQUIRED_CODE_OR_ID_REGISTER"); } if (!string.IsNullOrEmpty(request.CodeRegister) && !string.IsNullOrEmpty(request.IdRegister)) { throw new PisException("REQUIRED_ONLY_CODE_OR_ID_REGISTER"); } Domain.Register registerResponse = new Domain.Register(); DocsPaVO.utente.Registro registro = null; if (!string.IsNullOrEmpty(request.CodeRegister)) { registro = BusinessLogic.Utenti.RegistriManager.getRegistroByCodAOO(request.CodeRegister, infoUtente.idAmministrazione); } else { if (!string.IsNullOrEmpty(request.IdRegister)) { try { registro = BusinessLogic.Utenti.RegistriManager.getRegistro(request.IdRegister); } catch { //Registro non trovato throw new PisException("REGISTER_NOT_FOUND"); } } } if (registro != null) { registerResponse = Utils.GetRegister(registro); } else { //Registro non trovato throw new PisException("REGISTER_NOT_FOUND"); } response.Register = registerResponse; 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); }