public string ConsumerScore(string xdsUrl, string cherwellUrl, string cmsUsrName, string cmsUsrPwd,
                                    string xdsUsrName, string xdsUsrPw, string reason, string idNo, string dob, string passportNumber,
                                    string reference, string ticket, string firstName, string lastname,
                                    string productionId, bool attachXml, bool attachPdf, string recId)
        {
            _webService.Url = XdsUrl;
            var myMatch = _webService.ConnectConsumerMatch(ticket, reason, int.Parse(productionId), idNo,
                                                           passportNumber,
                                                           firstName, lastname, dob, reference, string.Empty);

            _enquiryId       = int.Parse(XmlReaders.FindXmlValue(myMatch, "EnquiryID"));
            _enquiryResultId = int.Parse(XmlReaders.FindXmlValue(myMatch, "EnquiryResultID"));

            var xdsResult = _webService.ConnectGetResult(ticket, _enquiryId, _enquiryResultId, int.Parse(productionId),
                                                         string.Empty);

            var attachments = new Attachements();

            if (attachXml)
            {
                attachments.AttachXml(CherwellUrl, cmsUsrName, cmsUsrPwd, recId, xdsResult);
            }

            if (attachPdf)
            {
                attachments.AttachPdf(CherwellUrl, cmsUsrName, cmsUsrPwd, recId, ticket, productionId, _enquiryId, _enquiryResultId);
            }

            var results = new Results
            {
                Score           = XmlReaders.FindXmlValue(xdsResult, "FinalScore"),
                EnquiryID       = _enquiryId.ToString(),
                EnquiryResultID = _enquiryResultId.ToString(),
                Judgements      = XmlReaders.FindJudgements(xdsResult, "JudgmentsCount").ToString()
            };
            var           sw = new StringWriter();
            XmlTextWriter tw = null;

            try
            {
                var serializer = new XmlSerializer(results.GetType());
                tw = new XmlTextWriter(sw);
                serializer.Serialize(tw, results);
            }
            catch (Exception)
            {
                //Handle Exception Code
            }
            finally
            {
                sw.Close();
                tw?.Close();
            }

            return(sw.ToString());
        }
 public HomeData()
 {
     try
     {
         lock (rewriteOverviewLocker)
         {
             devices = XmlReaders.readOverview("OverviewFile.xml");
         }
     }
     catch (System.Xml.XmlException e) { }
     catch (IOException e) { }
 }
 internal void Reload()
 {
     try
     {
         lock (rewriteOverviewLocker)
         {
             devices = XmlReaders.readOverview("OverviewFile.xml");
         }
     }
     catch (System.Xml.XmlException e) { }
     catch (IOException e) { }
 }