public MatchingDetails RetrieveMatchingDetails(GMPossibleDuplicate gMPossibleDuplicate)
        {
            MatchingDetails matchingDetails = new MatchingDetails();

            matchingDetails = goldmineImportServiceConnector.GetMatchingDetails(gMPossibleDuplicate.LASTNAME, gMPossibleDuplicate.ZIP, gMPossibleDuplicate.PHONE1, gMPossibleDuplicate.PHONE2, gMPossibleDuplicate.UEMAILADDR);
            return(matchingDetails);
        }
 private void DisplayMatchingDetails(MatchingDetails matchingDetails)
 {
     DisplayPhone1Match(matchingDetails.PHONE1Match);
     DisplayPhone2Match(matchingDetails.PHONE2Match);
     DisplayEmailMatch(matchingDetails.UEMAILADDRMatch);
     DisplayPostCodeMatch(matchingDetails.PostCodeMatch);
 }
        void panelControl_OnPossibleDuplicateUpdated(object sender, EventArgs e)
        {
            // fetch which duplicate details
            MatchingDetails matchingDetails = panelControl.RetrieveMatchingDetails(panelControl.PossibleDuplicate);

            // Display which duplicate details
            DisplayMatchingDetails(matchingDetails);
        }
        public MatchingDetails GetMatchingDetails(string lastname, string postCode, string PHONE1, string PHONE2, string UEMAILADDR)
        {
            MatchingDetails         matchingDetails            = new MatchingDetails();
            string                  jsonResult                 = string.Empty;
            GetMatchingDetailsSO    getMatchingDetailsSO       = new GetMatchingDetailsSO();
            GoldmineImportServiceDO goldmineImportServiceDO    = new GoldmineImportServiceDO();
            string                  getMatchingDetailsSOAsJson = string.Empty;

            // set getMatchingDetailSO Properties
            getMatchingDetailsSO = PropertyAddition.SetGetMatchingDetailsSOProperties(lastname, postCode, PHONE1, PHONE2, UEMAILADDR, getMatchingDetailsSO);

            // Create URL and WebRequest Object
            string     URL            = string.Format("{0}GetMatchingDetails", goldmineImportServiceAddress);
            WebRequest httpWebRequest = (HttpWebRequest)WebRequest.Create(URL);

            httpWebRequest = ConnectorHelper.SetUpWebRequestObject(httpWebRequest);

            getMatchingDetailsSOAsJson = SerializationHelper.SerializeGetMatchingDetailsSO(getMatchingDetailsSO);

            using (var streamWriter = new StreamWriter(httpWebRequest.GetRequestStream()))
            {
                // send request to service
                try
                {
                    streamWriter.Write(getMatchingDetailsSOAsJson);
                    streamWriter.Flush();
                    streamWriter.Close();
                }
                catch (Exception ex)
                {
                    ClientLogger.WriteError(ex, "Error retrieving the matching details.\nMethod: GoldmineImportServiceConnector.GetMatchingDetails", ClientGlobalData.CurrentUser.SystemName);
                    throw ex;
                }

                // get response object
                HttpWebResponse httpResponse = (HttpWebResponse)httpWebRequest.GetResponse();
                using (var streamReader = new StreamReader(httpResponse.GetResponseStream()))
                {
                    jsonResult = streamReader.ReadToEnd();
                    jsonResult = ConnectorHelper.ChangeArrayParentheses(jsonResult);
                }

                // deserialize
                try
                {
                    goldmineImportServiceDO = JsonConvert.DeserializeObject <GoldmineImportServiceDO>(jsonResult);
                    matchingDetails         = goldmineImportServiceDO.GetMatchingDetailsResult;
                }
                catch (Exception ex)
                {
                    ClientLogger.WriteError(ex, "Error deserializing the matching details.\nMethod: GoldmineImportServiceConnector.GetMatchingDetails", ClientGlobalData.CurrentUser.SystemName);
                    HandleDeserializationException(ex);
                }
            }
            return(matchingDetails);
        }