Exemple #1
0
        /// <summary>
        /// Method Name     : ValidateAndGenerateResponse
        /// Author          : Pratik Soni
        /// Creation Date   : 02 Feb 2018
        /// Purpose         : To validate and generate proper response based on details received from CRM
        /// Revision        :
        /// </summary>
        /// <param name="alertResponse"></param>
        private ServiceResponse <List <Alert> > ValidateAndGenerateResponse(Dictionary <string, string> alertResponse)
        {
            ServiceResponse <List <Alert> > validatedResponse;

            validatedResponse = crmTODTOMapper.ValidateResponse <List <DTO.Alert> >(alertResponse);

            if (validatedResponse.Message != null)
            {
                return(new ServiceResponse <List <Alert> > {
                    Message = resourceManager.GetString("msgServiceUnavailable")
                });
            }
            else if (validatedResponse.Information != null)
            {
                logger.Error(resourceManager.GetString("msgInvalidCustomer"));
                return(new ServiceResponse <List <Alert> > {
                    Information = resourceManager.GetString("msgInvalidCustomer")
                });
            }
            return(crmTODTOMapper.MapAlertResponseToDTO(alertResponse));
        }