Exemple #1
0
        /// <summary>
        /// Method Name     : GetEstimateList
        /// Author          : Pratik Soni
        /// Creation Date   : 11 Jan 2018
        /// Purpose         : Gets the list of estimate id for the Customer number.
        /// Revision        :
        /// </summary>
        /// <param name="customerId"></param>
        /// <returns></returns>
        public ServiceResponse <List <Estimate> > GetEstimateList(string customerId)
        {
            Dictionary <string, string> customerResponse, moveResponse;
            string        retrieveFieldList;
            StringBuilder filterString;

            filterString = new StringBuilder();

            customerResponse = objCrmUtilities.ExecuteGetRequest(contactEntityName, "contactid", "jkmoving_customernumber eq '" + customerId + "'");
            if (objCrmUtilities.ContainsNullValue(customerResponse))
            {
                logger.Info(resourceManager.GetString("msgUnregisteredCustomer"));
                return(new ServiceResponse <List <Estimate> > {
                    Message = resourceManager.GetString("msgUnregisteredCustomer")
                });
            }

            retrieveFieldList = "jkmoving_movenumber,_jkmoving_contactofmoveid_value,statecode";

            filterString.Append("_jkmoving_contactofmoveid_value eq " + General.GetSpecificAttributeFromCRMResponse(customerResponse, "contactid") + " and statecode eq 0");
            filterString.Append(" and statuscode eq " + " 676860000");

            moveResponse = objCrmUtilities.ExecuteGetRequest(moveEntityName, retrieveFieldList, filterString.ToString());
            return(objCRMToDTOMapper.MapEstimateIdResponseToDTO(moveResponse));
        }