/// <summary> /// Metodo che restituisce la lista degli id opportuniti /// </summary> /// <param name="request"></param> /// <returns>Response</returns> public Services.AddressBook.GetOpportunity.GetOpportunityResponse GetOpportunityList(Services.AddressBook.GetOpportunity.GetOpportunityRequest request) { logger.Info("BEGIN"); Services.AddressBook.GetOpportunity.GetOpportunityResponse response = Manager.AddressBookManager.GetOpportunityList(request); Utils.CheckFaultException(response); logger.Info("END"); return(response); }
public static Services.AddressBook.GetOpportunity.GetOpportunityResponse GetOpportunityList(Services.AddressBook.GetOpportunity.GetOpportunityRequest request) { Services.AddressBook.GetOpportunity.GetOpportunityResponse response = new Services.AddressBook.GetOpportunity.GetOpportunityResponse(); try { DocsPaVO.utente.Utente utente = null; DocsPaVO.utente.InfoUtente infoUtente = null; //Inizio controllo autenticazione utente infoUtente = Utils.CheckAuthentication(request, "GetOpportunityList"); 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.CodiceUtente)) * { * //Codice dell'offer manager non presente * throw new PisException("REQUIRED_CODUTENTE"); * } */ List <string> oppIdlist = BusinessLogic.Utenti.UserManager.getIdOpportunityList(request.CodiceUtente); if (oppIdlist != null && oppIdlist.Count > 0) { response.IdOpportunityList = oppIdlist.ToArray(); } else { throw new PisException("OPPORTUNITY_NOT_FOUND"); } 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); }