Exemple #1
0
        /// Method Name     : GetMoveList
        /// Author          : Pratik Soni
        /// Creation Date   : 15 Feb 2018
        /// Purpose         : Get all active moves from JIM for windows service
        /// Revision        :
        /// </summary>
        /// <returns> returns dictionary with CRM response </returns>
        public ServiceResponse <List <Move> > GetMoveList(string statusReason)
        {
            Dictionary <string, string> moveResponse;
            StringBuilder selectFields = new StringBuilder();
            string        filterString = GetFilterString(statusReason);

            selectFields.Append("jkmoving_moveid,statecode,jkmoving_movenumber,_jkmoving_contactofmoveid_value");
            selectFields.Append("," + "jkmoving_packfrom,jkmoving_loadfrom,jkmoving_deliveryfrom,jkmoving_deliveryto");

            moveResponse = objCrmUtilities.ExecuteGetRequest(moveEntityName, selectFields.ToString(), filterString);
            var validatedResponse = objCRMToDTOMapper.ValidateResponse <List <Move> >(moveResponse);

            if (!string.IsNullOrEmpty(validatedResponse.Message) || !string.IsNullOrEmpty(validatedResponse.Information))
            {
                return(validatedResponse);
            }
            if (validatedResponse.Message != null)
            {
                logger.Error(resourceManager.GetString("msgServiceUnavailable"));
                return(new ServiceResponse <List <Move> > {
                    Message = resourceManager.GetString("msgServiceUnavailable")
                });
            }
            else if (validatedResponse.Information != null)
            {
                logger.Error(resourceManager.GetString("CRM_STATUS_204"));
                return(new ServiceResponse <List <Move> > {
                    Information = resourceManager.GetString("CRM_STATUS_204")
                });
            }
            return(objCRMToDTOMapper.MapMoveListResponseToDTO(moveResponse));
        }